have a ship that can move on the screen.

This commit is contained in:
2025-08-22 19:55:03 -05:00
parent 6c7662b5e6
commit 0f351593ab
2 changed files with 167 additions and 59 deletions

View File

@@ -13,6 +13,13 @@ async function run() {
let game = new Game("game-canvas");
let last = performance.now();
window.addEventListener("keydown", e => {
game.key_down(e.key);
});
window.addEventListener("keyup", e => {
game.key_up(e.key);
});
function loop(now) {
const dt = (now - last);
last = now;