summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-10-28 22:57:31 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-10-28 22:57:31 -0400
commit0ef1e9734ba2e10d74ca2f265241331788ef2559 (patch)
treeb54900c18549bd2bdc4252c5a3742fb1e473e5c9
parent8319098784fdad9fa985afd344f894e702384cc8 (diff)
Add tense chasing section.
-rw-r--r--game.scm27
-rw-r--r--level.tmx25
2 files changed, 50 insertions, 2 deletions
diff --git a/game.scm b/game.scm
index 5f1d5d8..1c857b0 100644
--- a/game.scm
+++ b/game.scm
@@ -736,6 +736,7 @@
(duration (or (assq-ref properties 'duration) 0)))
(when speed
(change-scroll-speed speed duration))))
+ ('chaser (spawn-chaser x y))
('warning (do-warning))
(_ #t)))
(define max-scroll (- (* (level-height level) tile-height) game-height))
@@ -957,7 +958,7 @@
(define (spawn-flyer1* x y script)
(spawn-enemy
- (make-enemy 'flyer1 10 (vec2 x y) (vec2 16.0 16.0)
+ (make-enemy 'flyer1 30 (vec2 x y) (vec2 22.0 16.0)
(vec2 0.0 0.0) script 1000
#(0.0 24.0 48.0 72.0) image:flyer1 (vec2 24.0 24.0))))
@@ -1012,6 +1013,30 @@
(define (spawn-flyer1 x y)
(spawn-flyer1* x y #f))
+ (define (spawn-chaser x y)
+ (define (script flyer)
+ (set-enemy-dy! flyer -3.0)
+ (wait 30)
+ (tween (lambda (dy)
+ (set-enemy-dy! flyer dy))
+ 30 -3.0 -1.0
+ smoothstep lerp)
+ (tween (lambda (dy)
+ (set-enemy-dy! flyer dy))
+ 30 -1.0 -2.9
+ smoothstep lerp)
+ (wait (* 5 60))
+ (tween (lambda (dy)
+ (set-enemy-dy! flyer dy))
+ 30 -2.9 -1.2
+ smoothstep lerp)
+ (wait (+ (* 3 60) 30))
+ (tween (lambda (dy)
+ (set-enemy-dy! flyer dy))
+ 30 -1.2 0.0
+ smoothstep lerp))
+ (spawn-flyer1* x (+ y game-height 8.0) script))
+
(define (spawn-boss x y)
(spawn-enemy
(make-enemy 'boss 300 (vec2 x (- y 24.0)) (vec2 144.0 50.0)
diff --git a/level.tmx b/level.tmx
index 0a02fa4..d925b2b 100644
--- a/level.tmx
+++ b/level.tmx
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<map version="1.8" tiledversion="1.8.6" orientation="orthogonal" renderorder="right-down" width="15" height="500" tilewidth="16" tileheight="16" infinite="0" nextlayerid="8" nextobjectid="258">
+<map version="1.8" tiledversion="1.8.6" orientation="orthogonal" renderorder="right-down" width="15" height="500" tilewidth="16" tileheight="16" infinite="0" nextlayerid="8" nextobjectid="287">
<tileset firstgid="1" source="tiles.tsx"/>
<tileset firstgid="7" source="background.tsx"/>
<objectgroup id="7" name="background" visible="0" parallaxy="0.75">
@@ -1228,5 +1228,28 @@
<object id="226" type="popcorn" x="48" y="2064" width="16" height="16"/>
<object id="256" type="turret" x="96" y="7712" width="16" height="16"/>
<object id="257" type="warning" x="0" y="224" width="16" height="16"/>
+ <object id="258" type="chaser" x="112" y="3520" width="16" height="16"/>
+ <object id="262" type="chaser" x="96" y="3488" width="16" height="16"/>
+ <object id="263" type="chaser" x="128" y="3488" width="16" height="16"/>
+ <object id="264" type="chaser" x="80" y="3456" width="16" height="16"/>
+ <object id="265" type="chaser" x="144" y="3456" width="16" height="16"/>
+ <object id="266" type="popcorn" x="96" y="3424" width="16" height="16"/>
+ <object id="267" type="popcorn" x="128" y="3392" width="16" height="16"/>
+ <object id="268" type="popcorn" x="96" y="3360" width="16" height="16"/>
+ <object id="269" type="popcorn" x="128" y="3328" width="16" height="16"/>
+ <object id="270" type="popcorn" x="96" y="3296" width="16" height="16"/>
+ <object id="271" type="popcorn" x="128" y="3264" width="16" height="16"/>
+ <object id="272" type="popcorn" x="96" y="3232" width="16" height="16"/>
+ <object id="273" type="popcorn" x="128" y="3200" width="16" height="16"/>
+ <object id="274" type="popcorn" x="96" y="3168" width="16" height="16"/>
+ <object id="276" type="popcorn" x="128" y="3136" width="16" height="16"/>
+ <object id="279" type="popcorn" x="96" y="3104" width="16" height="16"/>
+ <object id="280" type="popcorn" x="128" y="3072" width="16" height="16"/>
+ <object id="281" type="popcorn" x="96" y="3040" width="16" height="16"/>
+ <object id="282" type="popcorn" x="128" y="3008" width="16" height="16"/>
+ <object id="283" type="popcorn" x="96" y="2976" width="16" height="16"/>
+ <object id="284" type="popcorn" x="128" y="2944" width="16" height="16"/>
+ <object id="285" type="popcorn" x="96" y="2912" width="16" height="16"/>
+ <object id="286" type="popcorn" x="128" y="2880" width="16" height="16"/>
</objectgroup>
</map>