-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
27 lines (20 loc) · 784 Bytes
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import Game from "./src/Game";
document.addEventListener("DOMContentLoaded", function () {
const game = new Game();
const onChangeDifficulty = (event) =>
game.onChangeDifficulty(event.target.value);
const onClickStart = () => game.onClickStart();
const onClickReset = () => game.onClickReset();
const difficultySelect = document.getElementById(
"difficultySelect"
) as HTMLElement;
difficultySelect.addEventListener("change", onChangeDifficulty);
const startGameButton = document.getElementById(
"startGameButton"
) as HTMLElement;
startGameButton.addEventListener("click", onClickStart);
const resetGameButton = document.getElementById(
"resetGameButton"
) as HTMLElement;
resetGameButton.addEventListener("click", onClickReset);
});