fix a couple other minor bugs main
authorcassowarii <2374677+cassowarii@users.noreply.github.com>
Tue, 8 Oct 2024 03:26:38 +0000 (20:26 -0700)
committercassowarii <2374677+cassowarii@users.noreply.github.com>
Tue, 8 Oct 2024 03:26:38 +0000 (20:26 -0700)
game.js
index.html
music/bugjazz.mp3
sfx/feet.wav
sfx/slide.wav
zucchinibread.js

diff --git a/game.js b/game.js
index b693313..d49575c 100644 (file)
--- 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();
index a2ddd5e..4d1221a 100644 (file)
@@ -4,7 +4,11 @@
     minibeast game
 </title>
 <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=100%, target-densitydpi=device-dpi, user-scalable=no" />
-<style>* { border: 0; margin: 0; overflow: hidden }</style>
+<style>
+* { border: 0; margin: 0; overflow: hidden }
+/*body { height: 100vh }
+canvas { object-fit: contain; width: 100%; height: 100% }*/
+</style>
 </head>
 <body style="background: black">
     <canvas id="canvas" width="480" height="720" style="max-width:100%" tabindex=1> </canvas>
index 3525ca9..ee0ca4f 100755 (executable)
Binary files a/music/bugjazz.mp3 and b/music/bugjazz.mp3 differ
index 5aa79be..4317bb2 100644 (file)
Binary files a/sfx/feet.wav and b/sfx/feet.wav differ
index bb5a0d6..fc6cede 100644 (file)
Binary files a/sfx/slide.wav and b/sfx/slide.wav differ
index 7ce6ff5..f67da67 100644 (file)
@@ -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);
         }