have a ship that can move on the screen.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user