From 143a276a08238f9640209ed21554a4573d013d25 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 25 Oct 2023 09:01:26 -0400 Subject: Update map; don't play explosion sound when enemy goes out of bounds. --- game.scm | 15 ++++++++------- images/map.ase | Bin 1090 -> 1096 bytes images/map.png | Bin 401 -> 452 bytes level.tmx | 14 +++++++------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/game.scm b/game.scm index 30e04fb..7d8a6a3 100644 --- a/game.scm +++ b/game.scm @@ -688,7 +688,8 @@ (cond ((or (enemy-dead? enemy) (enemy-out-of-bounds? enemy)) - (sound-effect-play sound:explosion) + (when (enemy-dead? enemy) + (sound-effect-play sound:explosion)) (enemy-pool-remove! pool i) (loop i (- k 1))) (else @@ -1032,12 +1033,12 @@ (let ((x* (- x (/ w 2.0))) (y* (- y(/ h 2.0)))) (or (out-of-bounds? x* y* w h) - (rect-collides-with-level? level x* y* w h) - ;; (if (rect-collides-with-level? level x* y* w h) - ;; (begin - ;; (sound-effect-play sound:bullet-hit 0.1) - ;; #t) - ;; #f) + ;; (rect-collides-with-level? level x* y* w h) + (if (rect-collides-with-level? level x* y* w h) + (begin + (sound-effect-play sound:bullet-hit 0.01) + #t) + #f) (if (rect-within? x y w h (vec2-x player-hitbox-position) (vec2-y player-hitbox-position) diff --git a/images/map.ase b/images/map.ase index 81fed57..8985475 100644 Binary files a/images/map.ase and b/images/map.ase differ diff --git a/images/map.png b/images/map.png index 5338adf..58f01d7 100644 Binary files a/images/map.png and b/images/map.png differ diff --git a/level.tmx b/level.tmx index c16eb72..94b5628 100644 --- a/level.tmx +++ b/level.tmx @@ -58,17 +58,17 @@ 1,1,1,1,1,1,1,1,0,0,0,0,1,1,1, 1,1,1,1,1,1,1,1,0,0,0,0,1,1,1, 1,1,1,1,1,1,1,1,0,0,0,0,1,1,1, -1,1,1,1,1,1,1,0,0,0,0,3,1,1,1, -1,1,1,1,1,1,0,0,0,0,3,1,1,1,1, -1,1,1,1,1,0,0,0,0,3,1,1,1,1,1, +1,1,1,1,1,1,1,5,0,0,0,3,1,1,1, +1,1,1,1,1,1,5,0,0,0,3,1,1,1,1, +1,1,1,1,1,5,0,0,0,3,1,1,1,1,1, 1,1,1,1,1,0,0,0,0,1,1,1,1,1,1, 1,1,1,1,1,0,0,0,0,1,1,1,1,1,1, 1,1,1,1,1,0,0,0,0,1,1,1,1,1,1, 1,1,1,1,1,0,0,0,0,1,1,1,1,1,1, -1,1,1,1,0,0,0,0,0,0,1,1,1,1,1, -1,1,1,0,0,0,0,0,0,0,0,1,1,1,1, -1,1,0,0,0,0,0,0,0,0,0,0,1,1,1, -1,0,0,0,0,0,0,0,0,0,0,0,0,1,1, +1,1,1,1,5,0,0,0,0,4,1,1,1,1,1, +1,1,1,5,0,0,0,0,0,0,4,1,1,1,1, +1,1,5,0,0,0,0,0,0,0,0,4,1,1,1, +1,5,0,0,0,0,0,0,0,0,0,0,4,1,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1, -- cgit v1.2.3