Загрузить файлы в «js»
This commit is contained in:
parent
04c2dc2e9d
commit
eeb53a27fa
12
js/main.js
12
js/main.js
@ -18,6 +18,18 @@ window.addEventListener("load", async function (){
|
||||
new AnimationManager(eventBus);
|
||||
new InputHandler(eventBus);
|
||||
|
||||
////////////////////////////////////////////
|
||||
const joystickUp = document.querySelector("#joystick-up");
|
||||
const joystickDown = document.querySelector("#joystick-down");
|
||||
const joystickLeft = document.querySelector("#joystick-left");
|
||||
const joystickRight = document.querySelector("#joystick-right");
|
||||
|
||||
joystickUp.addEventListener("click", () => eventBus.emit("rotate", {}));
|
||||
joystickDown.addEventListener("click", () => eventBus.emit("move", { dx: 0, dy: 1 }));
|
||||
joystickLeft.addEventListener("click", () => eventBus.emit("move", { dx: -1, dy: 0 }));
|
||||
joystickRight.addEventListener("click", () => eventBus.emit("move", { dx: 1, dy: 0 }));
|
||||
// ------------------------------------
|
||||
|
||||
////////////////////////////////////////////
|
||||
let game = null;
|
||||
let isAnimating = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user