Add a button for resetting the game
This commit is contained in:
parent
ba28926219
commit
7950572ede
2 changed files with 8 additions and 0 deletions
|
@ -9,5 +9,8 @@
|
|||
<body>
|
||||
<div class="board" id="board">
|
||||
</div>
|
||||
<button class="button new-game">
|
||||
New Game
|
||||
</button>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -14,6 +14,11 @@ function initialize()
|
|||
{
|
||||
game = new Game("board");
|
||||
game.initialize();
|
||||
|
||||
(/** @type {HTMLElement} */ (document.querySelector(".new-game"))).onclick = () =>
|
||||
{
|
||||
game.reset();
|
||||
};
|
||||
}
|
||||
|
||||
initialize();
|
||||
|
|
Loading…
Reference in a new issue