From 9523f936cf6f761ccc6127546540580cb57f9a5f Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 24 Oct 2021 11:53:05 -0400 Subject: Preparing for release! --- assets/images/chickadee.png | Bin 0 -> 6073 bytes assets/images/lightness.png | Bin 0 -> 1181 bytes assets/sounds/alarm.wav | Bin 0 -> 53122 bytes bonnie-bee/assets.scm | 6 ++++++ bonnie-bee/bullet.scm | 2 +- bonnie-bee/game.scm | 35 ++++++++++++++++++++++++----------- bonnie-bee/player.scm | 4 ++++ bonnie-bee/splash.scm | 14 ++++++++++---- bundle.scm | 5 +++++ 9 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 assets/images/chickadee.png create mode 100644 assets/images/lightness.png create mode 100644 assets/sounds/alarm.wav create mode 100644 bundle.scm diff --git a/assets/images/chickadee.png b/assets/images/chickadee.png new file mode 100644 index 0000000..d383312 Binary files /dev/null and b/assets/images/chickadee.png differ diff --git a/assets/images/lightness.png b/assets/images/lightness.png new file mode 100644 index 0000000..ebe75ac Binary files /dev/null and b/assets/images/lightness.png differ diff --git a/assets/sounds/alarm.wav b/assets/sounds/alarm.wav new file mode 100644 index 0000000..6dbf1ed Binary files /dev/null and b/assets/sounds/alarm.wav differ diff --git a/bonnie-bee/assets.scm b/bonnie-bee/assets.scm index 7c96307..38d6582 100644 --- a/bonnie-bee/assets.scm +++ b/bonnie-bee/assets.scm @@ -8,6 +8,8 @@ background-image particle-image darkness-image + lightness-image + chickadee-image bee-atlas bullet-atlas popcorn-atlas @@ -24,6 +26,7 @@ player-bomb-sound pollen-release-sound hehehe-sound + alarm-sound intro-music main-music)) @@ -36,6 +39,8 @@ (define-asset background-image (load-image (scope-datadir "assets/images/background.png"))) (define-asset particle-image (load-image (scope-datadir "assets/images/particle.png"))) (define-asset darkness-image (load-image (scope-datadir "assets/images/darkness.png"))) +(define-asset lightness-image (load-image (scope-datadir "assets/images/lightness.png"))) +(define-asset chickadee-image (load-image (scope-datadir "assets/images/chickadee.png"))) (define-asset bee-atlas (load-tileset (scope-datadir "assets/images/bee.png") 32 32)) (define-asset bullet-atlas (load-tileset (scope-datadir "assets/images/bullets.png") 16 16)) (define-asset flower-atlas (load-tileset (scope-datadir "assets/images/flower.png") 64 64)) @@ -52,5 +57,6 @@ (define-asset player-bomb-sound (load-audio (scope-datadir "assets/sounds/player-bomb.wav"))) (define-asset pollen-release-sound (load-audio (scope-datadir "assets/sounds/pollen-release.wav"))) (define-asset hehehe-sound (load-audio (scope-datadir "assets/sounds/hehehe.wav"))) +(define-asset alarm-sound (load-audio (scope-datadir "assets/sounds/alarm.wav"))) (define-asset intro-music (load-audio (scope-datadir "assets/sounds/intro.ogg") #:mode 'stream)) (define-asset main-music (load-audio (scope-datadir "assets/sounds/main.ogg") #:mode 'stream)) diff --git a/bonnie-bee/bullet.scm b/bonnie-bee/bullet.scm index 758ff5a..95c925c 100644 --- a/bonnie-bee/bullet.scm +++ b/bonnie-bee/bullet.scm @@ -202,7 +202,7 @@ (< (rect-left h) -16.0) (> (rect-right h) 336.0) (< (rect-bottom h) -16.0) - (> (rect-top h) 272.0)) + (> (rect-top h) 284.0)) (remove-bullet bullets i) (loop i)) ((and (= (vec2-x v) 0.0) diff --git a/bonnie-bee/game.scm b/bonnie-bee/game.scm index 4d02490..18b177b 100644 --- a/bonnie-bee/game.scm +++ b/bonnie-bee/game.scm @@ -90,7 +90,7 @@ #:end-color (make-color 1.0 1.0 1.0 0.0))) (make #:name 'bullets - #:rank 3 + #:rank 4 #:quadtree (quadtree game)) (make #:name 'hud-lives @@ -453,7 +453,7 @@ (when (< i 8) (let* ((arc-start (- (* pi 1.5) 0.2)) (arc-end (+ (* pi 1.5) 0.2)) - (n 8) + (n 9) (arc-step (/ (- arc-end arc-start) n)) (speed 1.9)) (audio-play (asset-ref enemy-shoot-sound)) @@ -474,7 +474,6 @@ (unless (getenv "SKIP_WAVE3") (spawn-moth (vec2 (* %game-width 0.5) (+ %game-height 16.0))) (spawn-flower (* %game-width 0.125)) - (spawn-flower (* %game-width 0.875)) (sleep 4.0) (spawn-moth (vec2 (* %game-width 0.25) (+ %game-height 16.0))) (spawn-flower (* %game-width 0.375)) @@ -508,6 +507,10 @@ (sleep 7.0)) ;; Boss (unless (getenv "SKIP_BOSS") + (run-script game + (repeat 8 + (audio-play (asset-ref alarm-sound)) + (sleep 1.0))) (run-script game (let ((warning (make #:name 'warning @@ -533,7 +536,8 @@ (tween 1.0 15.0 0.0 (lambda (speed) (change-scroll-speed game speed))) - (wait-until (dead? (& game boss)))) + (wait-until (dead? (& game boss))) + (clear-bullets (bullets game))) ;; Victory! (set! (invincible? (player game)) #t) (add-to-score (player game) (* (lives (player game)) 50000)) @@ -556,7 +560,7 @@ (spawn game (make #:name 'player - #:rank 4 + #:rank 3 #:position (vec2 (/ %game-width 2.0) 20.0) #:hitbox (make-rect -0.5 -0.5 1.0 1.0))) (run-level game)) @@ -654,11 +658,13 @@ (if (paused? game) (begin (detach (& game pause-overlay)) + (source-play (music-source game)) (resume game)) (let ((overlay (make #:name 'pause-overlay #:rank 99))) (pause game) + (source-pause (music-source game)) (attach-to overlay (make #:texture darkness-image @@ -673,6 +679,7 @@ (attach-to game overlay)))) (define-method (play-again (game )) + (change-state game 'play-again) (run-script game (tween 0.5 1.0 0.0 (lambda (volume) @@ -683,6 +690,12 @@ (fade-out game 1.0) (reset-game game))) +(define-method (close-game (game )) + (pop-scene (current-kernel))) + +(define-method (on-quit (game )) + (close-game game)) + (define-method (on-key-press (game ) key modifiers repeat?) (case (state game) ((play) @@ -699,20 +712,20 @@ (set! (shoot? (player game)) #t)) ((x) (bomb (player game))) - ((q) - (pop-scene (current-kernel))) + ((escape) + (close-game game)) ((return) (toggle-pause game)))) ((intro) (case key - ((q) - (pop-scene (current-kernel))) + ((escape) + (close-game game)) ((return) (toggle-pause game)))) ((game-over game-complete) (case key - ((q) - (pop-scene (current-kernel))) + ((escape) + (close-game game)) ((return) (play-again game)))))) diff --git a/bonnie-bee/player.scm b/bonnie-bee/player.scm index f990657..1a524e7 100644 --- a/bonnie-bee/player.scm +++ b/bonnie-bee/player.scm @@ -6,6 +6,7 @@ #:use-module (bonnie-bee flower) #:use-module (chickadee audio) #:use-module (chickadee game-loop) + #:use-module (chickadee graphics particles) #:use-module (chickadee math) #:use-module (chickadee math vector) #:use-module (chickadee scripting) @@ -116,6 +117,9 @@ (set! (pollen player) 0) (set! (invincible? player) #t) (audio-play (asset-ref player-death-sound)) + (add-particle-emitter (particles (particles (parent player))) + (make-particle-emitter (world-hitbox player) + 10 5)) (run-script player (blink player 20 (steps 5)) (set! (invincible? player) #f)))) diff --git a/bonnie-bee/splash.scm b/bonnie-bee/splash.scm index 98239d6..7059f91 100644 --- a/bonnie-bee/splash.scm +++ b/bonnie-bee/splash.scm @@ -14,16 +14,22 @@ (define-class ()) -(define %text-color (rgb #xfee761)) +(define %text-color (rgb #x181425)) (define-method (on-boot (splash )) (set-cameras! splash) (attach-to splash (make - #:texture darkness-image) + #:texture lightness-image) + (make + #:texture chickadee-image + #:position (vec2 (/ %game-width 2.0) + (/ %game-height 2.0)) + #:origin (vec2 8.0 8.0) + #:scale (vec2 4.0 4.0)) (make