From 2edb9b08d2177e451daf9fc421a067543032d7cd Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 29 Oct 2023 22:33:58 -0400 Subject: Add basic shot patterns to electro guys. --- game.scm | 85 +++++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 20 deletions(-) diff --git a/game.scm b/game.scm index 8bd11e2..a3e1209 100644 --- a/game.scm +++ b/game.scm @@ -1109,13 +1109,33 @@ (define (spawn-tunnel-flyer1 x y) (define (script flyer) + (define (shoot dx dy) + (bullet-pool-add! enemy-bullets 2 + (enemy-x flyer) + (enemy-y flyer) + 4.0 4.0 + dx dy)) (set-enemy-dy! flyer 1.0) - (wait 80) + (wait 40) + (shoot 0.0 2.0) + (wait 40) (set-enemy-dx! flyer -1.0) (set-enemy-dy! flyer 0.0) + (run-script + (lambda () + (do ((i 0 (+ i 1))) + ((= i 3)) + (wait 20) + (shoot -2.0 0.0)))) (wait 140) (set-enemy-dx! flyer 0.0) - (set-enemy-dy! flyer 1.0)) + (set-enemy-dy! flyer 1.0) + (run-script + (lambda () + (do ((i 0 (+ i 1))) + ((= i 3)) + (wait 20) + (shoot 0.0 2.0))))) (spawn-flyer1* x y script)) (define (spawn-flyer1-down x y) @@ -1125,7 +1145,7 @@ (bullet-pool-add! enemy-bullets 2 (enemy-x flyer) (enemy-y flyer) - 2.0 2.0 + 4.0 4.0 (* (cos theta) speed) (* (sin theta) speed)))) (define (shoot) @@ -1135,43 +1155,65 @@ ) (set-enemy-dy! flyer 1.0) (wait 30) - (forever - (shoot) - (wait 10) - (shoot) - (wait 10) - (shoot) - (wait 45))) + (shoot) + (wait 15) + (shoot) + (wait 15) + (shoot)) (spawn-flyer1* x y script)) (define (spawn-flyer1-down-left x y) (define (script flyer) + (define (shoot dx dy) + (bullet-pool-add! enemy-bullets 2 + (enemy-x flyer) + (enemy-y flyer) + 4.0 4.0 + dx dy)) (set-enemy-dy! flyer 1.0) (wait 60) (set-enemy-dx! flyer -1.0) (set-enemy-dy! flyer 0.0) - (wait 60) + (wait 40) (tween (lambda (dx) (set-enemy-dx! flyer dx)) 30 -1.0 0.0 - smoothstep lerp)) + smoothstep lerp) + (forever + (wait 30) + (shoot 0.0 1.5))) (spawn-flyer1* x y script)) (define (spawn-flyer1-down-right x y) (define (script flyer) + (define (shoot dx dy) + (bullet-pool-add! enemy-bullets 2 + (enemy-x flyer) + (enemy-y flyer) + 4.0 4.0 + dx dy)) (set-enemy-dy! flyer 1.0) (wait 60) (set-enemy-dx! flyer 1.0) (set-enemy-dy! flyer 0.0) - (wait 60) + (wait 40) (tween (lambda (dx) (set-enemy-dx! flyer dx)) 30 1.0 0.0 - smoothstep lerp)) + smoothstep lerp) + (forever + (wait 30) + (shoot 0.0 1.5))) (spawn-flyer1* x y script)) (define (spawn-chaser x y) (define (script flyer) + (define (shoot dx dy) + (bullet-pool-add! enemy-bullets 2 + (enemy-x flyer) + (enemy-y flyer) + 4.0 4.0 + dx dy)) (set-enemy-dy! flyer -3.0) (wait 30) (tween (lambda (dy) @@ -1191,7 +1233,10 @@ (tween (lambda (dy) (set-enemy-dy! flyer dy)) 30 -1.2 0.0 - smoothstep lerp)) + smoothstep lerp) + (forever + (wait 30) + (shoot 0.0 1.5))) (spawn-flyer1* x (+ y game-height 8.0) script)) (define (spawn-boss x y) @@ -1798,12 +1843,12 @@ (music-play) (set! *game-state* 'play) (scheduler-reset! *scheduler*) - (set! *scroll* 0.0) - ;; (set! *scroll* (* 440.0 tile-height)) + ;; (set! *scroll* 0.0) + (set! *scroll* (* 140.0 tile-height)) (set! *last-scroll* 0.0) - (set! *last-row-scanned* (level-height level)) - ;; (set! *last-row-scanned* (- (level-height level) - ;; 440)) + ;; (set! *last-row-scanned* (level-height level)) + (set! *last-row-scanned* (- (level-height level) + 140)) (bullet-pool-reset! player-bullets) (bullet-pool-reset! enemy-bullets) (enemy-pool-reset! enemies) -- cgit v1.2.3