WiiDuktape/source/game.js
Fries e5dfbf0e0c read javascript code from a js file!
the wii does the game loop now, as i passed some c functions to javascript. those functions are inside objects to make the js api easier to read and use.
2024-06-19 00:39:01 -07:00

19 lines
323 B
JavaScript

const PAD_BUTTON_START = 0x1000;
const PAD_BUTTON_A = 0x0100;
while (wii.running) {
wii.pad.scan_pads();
const pressed = wii.pad.buttons_down();
if (pressed & PAD_BUTTON_START) {
wii.print("exiting from js");
wii.exit();
}
if (pressed & PAD_BUTTON_A) {
wii.print("a pressed");
}
wii.video.wait_vsync();
}