From 672141384a30ea7a6d28c5b746bf74ca187365cd Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 29 Oct 2023 22:12:24 -0400 Subject: Use new bullet sprites. --- game.scm | 66 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) (limited to 'game.scm') diff --git a/game.scm b/game.scm index 52086ed..8bd11e2 100644 --- a/game.scm +++ b/game.scm @@ -1001,7 +1001,7 @@ (define (current-dir) (direction-to-player (enemy-position enemy))) (define (shoot dir) - (bullet-pool-add! enemy-bullets 0 + (bullet-pool-add! enemy-bullets 1 (enemy-x enemy) (enemy-y enemy) 2.0 2.0 @@ -1121,8 +1121,8 @@ (define (spawn-flyer1-down x y) (define (script flyer) (define (shoot* theta) - (let ((speed 3.5)) - (bullet-pool-add! enemy-bullets 0 + (let ((speed 2.0)) + (bullet-pool-add! enemy-bullets 2 (enemy-x flyer) (enemy-y flyer) 2.0 2.0 @@ -1130,15 +1130,16 @@ (* (sin theta) speed)))) (define (shoot) (shoot* pi/2) - (shoot* (+ pi/2 0.1)) - (shoot* (- pi/2 0.1))) + ;; (shoot* (+ pi/2 0.1)) + ;; (shoot* (- pi/2 0.1)) + ) (set-enemy-dy! flyer 1.0) (wait 30) (forever (shoot) - (wait 5) + (wait 10) (shoot) - (wait 5) + (wait 10) (shoot) (wait 45))) (spawn-flyer1* x y script)) @@ -1202,16 +1203,17 @@ (dy 1.0)) (particle-pool-add! particles 'muzzle-flash life x y ldx dy) (particle-pool-add! particles 'muzzle-flash life x y rdx dy))) - (define (shoot x y dx dy) - (bullet-pool-add! enemy-bullets 0 x y 2.0 2.0 dx dy)) + (define (shoot type x y dx dy) + (let ((s (if (= type 4) 4.0 2.0))) + (bullet-pool-add! enemy-bullets 0 x y s s dx dy))) (define (xoff dx) (+ (enemy-x boss) dx)) (define (yoff dy) (+ (enemy-y boss) dy)) - (define (shoot+flash xo yo dx dy) + (define (shoot+flash type xo yo dx dy) (let ((x (xoff xo)) (y (yoff yo))) - (shoot x y dx dy) + (shoot type x y dx dy) (muzzle-flash x y))) (define main-left-x -43.0) (define main-right-x 43.0) @@ -1219,14 +1221,14 @@ (define alt-left-x -58.0) (define alt-right-x 58.0) (define alt-y 28.0) - (define (shoot-main-left dx dy) - (shoot+flash main-left-x main-y dx dy)) - (define (shoot-main-right dx dy) - (shoot+flash main-right-x main-y dx dy)) - (define (shoot-alt-left dx dy) - (shoot+flash alt-left-x alt-y dx dy)) - (define (shoot-alt-right dx dy) - (shoot+flash alt-right-x alt-y dx dy)) + (define (shoot-main-left type dx dy) + (shoot+flash main-left-x type main-y dx dy)) + (define (shoot-main-right type dx dy) + (shoot+flash main-right-x type main-y dx dy)) + (define (shoot-alt-left type dx dy) + (shoot+flash alt-left-x type alt-y dx dy)) + (define (shoot-alt-right type dx dy) + (shoot+flash alt-right-x type alt-y dx dy)) (define (player-dir dx dy) (let ((p (enemy-position boss))) (direction-to-player @@ -1254,8 +1256,8 @@ (dy 4.0)) (do ((i 0 (+ i 1))) ((= i 30)) - (shoot-alt-left dx dy) - (shoot-alt-right (- dx) dy) + (shoot-alt-left 0 dx dy) + (shoot-alt-right 0 (- dx) dy) (wait 4)) (wait-if 60 pred loop nop))))) (run-script @@ -1266,7 +1268,7 @@ (vec2-mul-scalar! v 3.5) (do ((i 0 (+ i 1))) ((= i 5)) - (shoot-alt-left (vec2-x v) (vec2-y v)) + (shoot-main-left 0 (vec2-x v) (vec2-y v)) (wait 4))) (wait-if 120 pred loop nop)))) (run-script @@ -1277,7 +1279,7 @@ (vec2-mul-scalar! v 3.5) (do ((i 0 (+ i 1))) ((= i 5)) - (shoot-alt-right (vec2-x v) (vec2-y v)) + (shoot-main-right 0 (vec2-x v) (vec2-y v)) (wait 4))) (wait-if 120 pred loop nop)))) (let ((x (enemy-x boss)) @@ -1287,7 +1289,7 @@ (do-circle (lambda (theta) (let ((theta* (+ theta offset))) - (shoot x y (* (cos theta*) speed) (* (sin theta*) speed)))) + (shoot 0 x y (* (cos theta*) speed) (* (sin theta*) speed)))) 3) (wait-if 10 pred (lambda () (loop (+ offset 0.3))) phase-3)))) ;; intense alt fire aimed at player @@ -1303,7 +1305,7 @@ (vec2-mul-scalar! v 3.5) (let inner ((i 0)) (when (< i 15) - (shoot-alt-left (vec2-x v) (vec2-y v)) + (shoot-alt-left 0 (vec2-x v) (vec2-y v)) (wait 4) (inner (+ i 1)))) (wait-if 10 pred outer nop))))) @@ -1315,7 +1317,7 @@ (vec2-mul-scalar! v 3.5) (let inner ((i 0)) (when (< i 15) - (shoot-alt-right (vec2-x v) (vec2-y v)) + (shoot-alt-right 0 (vec2-x v) (vec2-y v)) (wait 4) (inner (+ i 1)))) (wait-if 10 pred outer nop))))) @@ -1325,8 +1327,8 @@ (let inner ((i 0)) (when (<= i k) (let ((theta (* (inexact (/ i k)) pi))) - (shoot-main-left (* (cos theta) speed) (* (sin theta) speed)) - (shoot-main-right (* (cos theta) speed) (* (sin theta) speed)) + (shoot-main-left 4 (* (cos theta) speed) (* (sin theta) speed)) + (shoot-main-right 4 (* (cos theta) speed) (* (sin theta) speed)) (inner (+ i 1))))) (wait-if 60 pred outer nop)))) ;; alt guns fired aimed shots at player @@ -1341,7 +1343,7 @@ (vec2-mul-scalar! v 3.5) (do ((i 0 (+ i 1))) ((= i 5)) - (shoot-alt-left (vec2-x v) (vec2-y v)) + (shoot-alt-left 0 (vec2-x v) (vec2-y v)) (wait 4))) (wait-if 120 pred loop nop)))) (run-script @@ -1352,15 +1354,15 @@ (vec2-mul-scalar! v 3.5) (do ((i 0 (+ i 1))) ((= i 5)) - (shoot-alt-right (vec2-x v) (vec2-y v)) + (shoot-alt-right 0 (vec2-x v) (vec2-y v)) (wait 4))) (wait-if 120 pred loop nop)))) (let ((speed 0.75)) (let loop ((theta 0.0)) (let ((dx (* (cos theta) speed)) (dy (* (sin theta) speed))) - (shoot-main-left dx dy) - (shoot-main-right (- dx) dy) + (shoot-main-left 0 dx dy) + (shoot-main-right 0 (- dx) dy) (wait-if 5 pred (lambda () (loop (+ theta 0.4))) phase-2))))) (wait 180) (phase-1)) -- cgit v1.2.3