From 73aad137fb8ee5a2b5b6dc0c66d515dddccb5096 Mon Sep 17 00:00:00 2001 From: adrien Date: Tue, 4 Jul 2023 00:04:47 +0200 Subject: [PATCH] restart --- app.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 97ffe7f..09f3ad5 100644 --- a/app.js +++ b/app.js @@ -132,6 +132,11 @@ class Scheduler { class Matrix extends THREE.Group { + constructor() { + super() + this.init() + } + init() { this.cells = Array(ROWS).fill().map(() => Array(COLUMNS)) this.unlockedMinoes = new Set() @@ -967,10 +972,13 @@ messagesSpan.onanimationend = function (event) { let piece = null let game = { - init: function() { - this.playing = false + playing: false, + start: function() { + startButton.hide() stats.init() + stats.gui.show() + settings.gui.close() holdQueue.remove(holdQueue.piece) holdQueue.piece = null @@ -981,13 +989,6 @@ let game = { piece = null scene.remove(ghost) music.currentTime = 0 - }, - - start: function() { - startButton.hide() - stats.gui.show() - settings.gui.close() - edge.visible = true this.playing = true @@ -1089,6 +1090,8 @@ let game = { stats.clock.stop() localStorage["teTraHighScore"] = stats.highScore messagesSpan.addNewChild("div", { className: "show-level-animation", innerHTML: `

GAME
OVER

` }) + + startButton.show() }, } @@ -1194,8 +1197,6 @@ if (debug) { }) } -game.init() - // Handle player inputs const REPEATABLE_ACTIONS = [ playerActions.moveLeft,