From 0ef4a323549ea72f4c5c3df17ac78ceda069ed03 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 21 Oct 2021 08:28:40 -0400 Subject: Add real boss fight. --- bonnie-bee/game.scm | 100 ++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 47 deletions(-) (limited to 'bonnie-bee/game.scm') 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 + (let ((boss (make #: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 #:name 'game-complete #:rank 5))) -- cgit v1.2.3