diff --git a/conf/keybinding_start_menu.json b/conf/keybinding_start_menu.json index f14fdd6..e392d3f 100644 --- a/conf/keybinding_start_menu.json +++ b/conf/keybinding_start_menu.json @@ -1,5 +1,6 @@ { "start_game": ["Return", 13], + "toggle_full_screen": ["F"], "quit": ["Q", 12] } \ No newline at end of file diff --git a/rats.py b/rats.py index adb3445..5cdb34d 100644 --- a/rats.py +++ b/rats.py @@ -86,6 +86,7 @@ class MiceMaze(controls.KeyBindings): self.background_texture = self.engine.create_texture(texture_tiles) self.engine.draw_background(self.background_texture) + def game_over(self): if self.game_end[0]: if not self.game_end[1]: @@ -121,7 +122,7 @@ class MiceMaze(controls.KeyBindings): rows = f.read().splitlines() for row in rows: table.append(row.split(" - ")) - table.sort(key=lambda x: int(x[1]), reverse=True) + table.sort(key=lambda x: int(x[1]), reverse=True) return table def update_maze(self): diff --git a/rats.wasm b/rats.wasm new file mode 100644 index 0000000..2da225b Binary files /dev/null and b/rats.wasm differ diff --git a/test.html b/test.html new file mode 100644 index 0000000..e6cb2f7 --- /dev/null +++ b/test.html @@ -0,0 +1,35 @@ + + + + + + + WASM test with XHR + + + + + + + diff --git a/test.js b/test.js new file mode 100644 index 0000000..4b12ff0 --- /dev/null +++ b/test.js @@ -0,0 +1,13 @@ +const fs = require('fs'); +const { promisify } = require('util'); + +const fileRead = promisify(fs.readFile); + +(async function() { + const wasmBuffer = await fileRead('./rats.wasm'); + const wasmModule = await WebAssembly.compile(wasmBuffer); + const wasmInstance = await WebAssembly.instantiate(wasmModule); + + // Assuming the WASM module exports a function named 'myFunction' + console.log('Result from myFunction:', wasmInstance.instance.exports.myFunction()); +})(); \ No newline at end of file