From: cassowarii <2374677+cassowarii@users.noreply.github.com> Date: Tue, 8 Oct 2024 03:26:38 +0000 (-0700) Subject: fix a couple other minor bugs X-Git-Url: https://git.cassowary.me/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;p=ld56.git fix a couple other minor bugs --- diff --git a/game.js b/game.js index b693313..d49575c 100644 --- a/game.js +++ b/game.js @@ -25,7 +25,7 @@ let State = { STAND: 0, MOVE: 1, WIN: 2 }; let can_continue = false; let save_data = 1; -const SAVE_KEY = "casso.lizardwizard.save" +const SAVE_KEY = "casso.minibeasts.save" zb.ready(function() { game = zb.create_game({ @@ -101,7 +101,7 @@ zb.ready(function() { game.register_sfx({ win: { path: 'sfx/win.wav', - volume: 0.95, + volume: 0.8, }, hop: { path: 'sfx/hop.wav', @@ -112,7 +112,7 @@ zb.ready(function() { game.register_music({ bgm: { path: 'music/bugjazz', - volume: 0.9, + volume: 0.76, }, feet: { path: 'sfx/feet.wav', @@ -467,6 +467,8 @@ function handle_gamestart(game) { intitle = true; wonitall = false; + level_number = 1; + let save_data = parseInt(game.load('level_num') || "1"); console.log("save data: ", save_data); level_number = save_data; @@ -503,6 +505,7 @@ function undo() { creatures = undo_stack.pop(); selected_creature = null; game.state = State.STAND; + moving_creatures = []; accessible_tiles.clear(); selector_info = null; @@ -664,6 +667,7 @@ function do_update(delta) { game.music.feet.pause(); game.music.slide.pause(); game.state = State.STAND; + selector_info = null; selected_creature = null; moving_creatures = []; check_victory(); diff --git a/index.html b/index.html index a2ddd5e..4d1221a 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,11 @@ minibeast game - +
diff --git a/music/bugjazz.mp3 b/music/bugjazz.mp3 index 3525ca9..ee0ca4f 100755 Binary files a/music/bugjazz.mp3 and b/music/bugjazz.mp3 differ diff --git a/sfx/feet.wav b/sfx/feet.wav index 5aa79be..4317bb2 100644 Binary files a/sfx/feet.wav and b/sfx/feet.wav differ diff --git a/sfx/slide.wav b/sfx/slide.wav index bb5a0d6..fc6cede 100644 Binary files a/sfx/slide.wav and b/sfx/slide.wav differ diff --git a/zucchinibread.js b/zucchinibread.js index 7ce6ff5..f67da67 100644 --- a/zucchinibread.js +++ b/zucchinibread.js @@ -521,8 +521,10 @@ let zb = (function() { if (!game.playing) return; const rect = game.canvas.getBoundingClientRect(); + console.log(game.canvas.offsetLeft, game.canvas.offsetTop); let x = Math.round((e.clientX - rect.left) / rect.width * game.screen_w) - 1; let y = Math.round((e.clientY - rect.top) / rect.height * game.screen_h) - 1; + console.log(rect, e.clientX, e.clientY); if (e.button === 0 && game.events.mousedown) { game.events.mousedown(game, e, x, y); }