-
-
Save parzibyte/a7ff15444d5d068dcc9f59f567c36263 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init() { | |
this.showWelcome(); | |
this.initDomElements(); | |
this.initSounds(); | |
this.resetGame(); | |
this.draw(); | |
this.initControls(); | |
} | |
resetGame() { | |
this.score = 0; | |
this.sounds.success.currentTime = 0; | |
this.sounds.success.pause(); | |
this.sounds.background.currentTime = 0; | |
this.sounds.background.pause(); | |
this.initBoardAndExistingPieces(); | |
this.chooseRandomFigure(); | |
this.restartGlobalXAndY(); | |
this.syncExistingPiecesWithBoard(); | |
this.refreshScore(); | |
this.pauseGame(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment