summaryrefslogtreecommitdiff
path: root/bonnie-bee/game.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2021-10-21 08:28:40 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2021-10-21 08:28:40 -0400
commit0ef4a323549ea72f4c5c3df17ac78ceda069ed03 (patch)
tree3831dd2459b626922e897d85499e359feb1f8782 /bonnie-bee/game.scm
parentba887d36cd96e188771eda44ddfb7c31c9811fc0 (diff)
Add real boss fight.
Diffstat (limited to 'bonnie-bee/game.scm')
-rw-r--r--bonnie-bee/game.scm100
1 files changed, 53 insertions, 47 deletions
diff --git a/bonnie-bee/game.scm b/bonnie-bee/game.scm
index b5d1eaf..7957a10 100644
--- a/bonnie-bee/game.scm
+++ b/bonnie-bee/game.scm
@@ -257,39 +257,40 @@
(spawn game (make-popcorn (vec2-copy spawn-point) velocity))
(sleep delay)
(loop (+ i 1)))))
- (spawn game (make-flower (vec2 (- %game-width 64.0) (+ %game-height 32.0))))
- (popcorn-line 5 (vec2 64.0 (+ %game-height 16.0))
- (vec2 0.0 -2.0) 0.2)
- (sleep 0.5)
- (popcorn-line 5 (vec2 (- %game-width 64.0) (+ %game-height 16.0))
- (vec2 0.0 -2.0) 0.2)
- (sleep 0.5)
- (spawn game (make-flower (vec2 64.0 (+ %game-height 32.0))))
- (popcorn-line 5 (vec2 (/ %game-width 2.0) (+ %game-height 16.0))
- (vec2 0.0 -2.0) 0.2)
- (sleep 1.0)
- (run-script game
- (popcorn-line 10 (vec2 -16.0 220.0)
- (vec2 3.0 -0.5) 0.2))
- (popcorn-line 10 (vec2 (+ %game-width 16.0) 200.0)
- (vec2 -3.0 -0.5) 0.2)
- (spawn game (make-flower (vec2 (/ %game-width 2.0) (+ %game-height 32.0))))
- (sleep 1.0)
- (run-script game
- (popcorn-line 30 (vec2 -16.0 220.0)
- (vec2 2.0 -2.0) 0.2))
- (run-script game
- (popcorn-line 30 (vec2 (+ %game-width 16.0) 220.0)
- (vec2 -2.0 -2.0) 0.2))
- (spawn game (make-flower (vec2 128.0 (+ %game-height 32.0))))
- (sleep 2.0)
- (run-script game
- (popcorn-line 20 (vec2 -16.0 20.0)
- (vec2 2.0 2.0) 0.2))
- (spawn game (make-flower (vec2 256.0 (+ %game-height 32.0))))
- (popcorn-line 20 (vec2 (+ %game-width 16.0) 20.0)
- (vec2 -2.0 2.0) 0.2)
- (sleep 3.0)
+ (unless (getenv "SKIP_WAVE1")
+ (spawn game (make-flower (vec2 (- %game-width 64.0) (+ %game-height 32.0))))
+ (popcorn-line 5 (vec2 64.0 (+ %game-height 16.0))
+ (vec2 0.0 -2.0) 0.2)
+ (sleep 0.5)
+ (popcorn-line 5 (vec2 (- %game-width 64.0) (+ %game-height 16.0))
+ (vec2 0.0 -2.0) 0.2)
+ (sleep 0.5)
+ (spawn game (make-flower (vec2 64.0 (+ %game-height 32.0))))
+ (popcorn-line 5 (vec2 (/ %game-width 2.0) (+ %game-height 16.0))
+ (vec2 0.0 -2.0) 0.2)
+ (sleep 1.0)
+ (run-script game
+ (popcorn-line 10 (vec2 -16.0 220.0)
+ (vec2 3.0 -0.5) 0.2))
+ (popcorn-line 10 (vec2 (+ %game-width 16.0) 200.0)
+ (vec2 -3.0 -0.5) 0.2)
+ (spawn game (make-flower (vec2 (/ %game-width 2.0) (+ %game-height 32.0))))
+ (sleep 1.0)
+ (run-script game
+ (popcorn-line 30 (vec2 -16.0 220.0)
+ (vec2 2.0 -2.0) 0.2))
+ (run-script game
+ (popcorn-line 30 (vec2 (+ %game-width 16.0) 220.0)
+ (vec2 -2.0 -2.0) 0.2))
+ (spawn game (make-flower (vec2 128.0 (+ %game-height 32.0))))
+ (sleep 2.0)
+ (run-script game
+ (popcorn-line 20 (vec2 -16.0 20.0)
+ (vec2 2.0 2.0) 0.2))
+ (spawn game (make-flower (vec2 256.0 (+ %game-height 32.0))))
+ (popcorn-line 20 (vec2 (+ %game-width 16.0) 20.0)
+ (vec2 -2.0 2.0) 0.2)
+ (sleep 3.0))
;; Wave 2
;; popcorn that shoots, more flowers
@@ -304,15 +305,20 @@
(tween 1.0 15.0 0.0
(lambda (speed)
(change-scroll-speed game speed)))
- (spawn game (make <boss>
+ (let ((boss (make <boss>
#:name 'boss
#:rank 2
- #:position (vec2 (/ %game-width 2.0) (- %game-height 64.0))
+ #:position (vec2 (/ %game-width 2.0) (+ %game-height 32.0))
#:hitbox (make-rect -64.0 -32.0 128.0 64.0)
- #:health 100
- #:points 1000000))
+ #:health 3000
+ #:points 1000000)))
+ (spawn game boss)
+ (change-velocity boss 0.0 -1.0)
+ (sleep 1.4)
+ (change-velocity boss 0.0 0.0))
;; Victory
(wait-until (dead? (& game boss)))
+ (set! (invincible? (player game)) #t)
(game-complete game)
;; (let loop ((i 0))
@@ -359,17 +365,9 @@
(lambda (volume)
(set-source-volume! (music-source game) volume)))
(source-stop (music-source game))
- (set-source-volume! (music-source game) 1.0)
(play-music game intro-music)
- (change-state game 'game-complete)
- (stop-scripts game)
- (run-script game
- (sleep 1.0)
- (spawn game (make-flower (vec2 (/ %game-width 4) 160.0)))
- (sleep 1.0)
- (spawn game (make-flower (vec2 (/ %game-width 2) 160.0)))
- (sleep 1.0)
- (spawn game (make-flower (vec2 (- %game-width (/ %game-width 4)) 160.0))))
+ (set-source-volume! (music-source game) 1.0)
+ (change-state game 'pre-game-complete)
(let ((p (player game)))
(stop-scripts p)
(set! (shoot? p) #f)
@@ -377,6 +375,14 @@
(set! (move-right? p) #f)
(set! (move-down? p) #f)
(set! (move-up? p) #f))
+ (sleep 1.0)
+ (spawn game (make-flower (vec2 (/ %game-width 4) 160.0)))
+ (sleep 1.0)
+ (spawn game (make-flower (vec2 (/ %game-width 2) 160.0)))
+ (sleep 1.0)
+ (spawn game (make-flower (vec2 (- %game-width (/ %game-width 4)) 160.0)))
+ (sleep 1.0)
+ (change-state game 'game-complete)
(let ((group (make <node-2d>
#:name 'game-complete
#:rank 5)))