diff options
author | David Thompson <dthompson2@worcester.edu> | 2023-10-29 21:43:48 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2023-10-29 21:43:48 -0400 |
commit | 7177e8a6939b66594a6e8e1c87e86533ed3caadd (patch) | |
tree | f57e2be44b4b9bf9cb95df826ecadba1a86e3945 | |
parent | 6aec3c117162d1bc3865aef97fa7438828b63351 (diff) |
Add simple background music.
Wish I had more time!!
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | audio/music.ogg | bin | 0 -> 1011954 bytes | |||
-rw-r--r-- | audio/music.xm | bin | 0 -> 702129 bytes | |||
-rw-r--r-- | game.scm | 21 |
4 files changed, 11 insertions, 12 deletions
@@ -6,7 +6,7 @@ level.scm: level.tmx compile-map.scm bundle: game.wasm rm strigoform.zip || true - zip strigoform.zip -r audio/*.wav images/*.png fonts/ js-runtime/ boot.js game.css game.wasm index.html + zip strigoform.zip -r audio/*.{wav,ogg} images/*.png fonts/ js-runtime/ boot.js game.css game.wasm index.html serve: guile web-server diff --git a/audio/music.ogg b/audio/music.ogg Binary files differnew file mode 100644 index 0000000..32ec3c4 --- /dev/null +++ b/audio/music.ogg diff --git a/audio/music.xm b/audio/music.xm Binary files differnew file mode 100644 index 0000000..1eeb0b0 --- /dev/null +++ b/audio/music.xm @@ -351,18 +351,16 @@ (define sound:player-death (load-sound-effect "audio/player-death.wav")) (define sound:enemy-shoot (load-sound-effect "audio/enemy-shoot.wav")) (define sound:bullet-hit (load-sound-effect "audio/bullet-hit.wav")) - ;; (define music (load-audio "audio/music.wav")) - ;; (set-audio-loop! music 1) + (define music (load-audio "audio/music.ogg")) + (set-audio-loop! music 1) + (set-audio-volume! music 0.5) (define (music-play) - ;; (audio-play music) - #t) + (audio-play music)) (define (music-pause) - ;; (audio-pause music) - #t) + (audio-pause music)) (define (music-stop) - ;; (audio-pause music) - ;; (audio-seek music 0.0) - #t) + (audio-pause music) + (audio-seek music 0.0)) (define *debug?* #f) @@ -1367,7 +1365,7 @@ (wait 180) (phase-1)) (spawn-enemy - (make-enemy 'boss 1500 (vec2 x (- y 24.0)) (vec2 144.0 50.0) + (make-enemy 'boss 1500 (vec2 x (- y 32.0)) (vec2 144.0 50.0) (vec2 0.0 0.0) script 500000 #(0.0 144.0 288.0 432.0) image:boss (vec2 144.0 96.0)))) @@ -1570,10 +1568,11 @@ (do-splash))))) (define (do-game-over) (scheduler-reset! *countdown-scheduler*) - (music-stop) + (music-pause) (set! *game-state* 'game-over) (do-countdown)) (define (do-continue) + (music-play) (player-position-reset!) (set! *player-lives* 3) (set! *player-1cc?* #f) |