diff options
author | David Thompson <dthompson2@worcester.edu> | 2023-10-29 22:12:24 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2023-10-29 22:12:24 -0400 |
commit | 672141384a30ea7a6d28c5b746bf74ca187365cd (patch) | |
tree | 3baf20ba8486891fa064364e1150ba76cfa223e7 | |
parent | 73f5d6eb39974160be36894eb27402baa796fc07 (diff) |
Use new bullet sprites.
-rw-r--r-- | game.scm | 66 | ||||
-rw-r--r-- | images/enemy-bullets.ase | bin | 413 -> 1148 bytes | |||
-rw-r--r-- | images/enemy-bullets.png | bin | 108 -> 979 bytes |
3 files changed, 34 insertions, 32 deletions
@@ -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)) diff --git a/images/enemy-bullets.ase b/images/enemy-bullets.ase Binary files differindex f7fc836..c2a42a0 100644 --- a/images/enemy-bullets.ase +++ b/images/enemy-bullets.ase diff --git a/images/enemy-bullets.png b/images/enemy-bullets.png Binary files differindex fec7c42..392305a 100644 --- a/images/enemy-bullets.png +++ b/images/enemy-bullets.png |