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({
game.register_sfx({
win: {
path: 'sfx/win.wav',
- volume: 0.95,
+ volume: 0.8,
},
hop: {
path: 'sfx/hop.wav',
game.register_music({
bgm: {
path: 'music/bugjazz',
- volume: 0.9,
+ volume: 0.76,
},
feet: {
path: 'sfx/feet.wav',
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;
creatures = undo_stack.pop();
selected_creature = null;
game.state = State.STAND;
+ moving_creatures = [];
accessible_tiles.clear();
selector_info = null;
game.music.feet.pause();
game.music.slide.pause();
game.state = State.STAND;
+ selector_info = null;
selected_creature = null;
moving_creatures = [];
check_victory();
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>
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);
}