Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 2, 2020 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a7ff15444d5d068dcc9f59f567c36263 to your computer and use it in GitHub Desktop.
Save parzibyte/a7ff15444d5d068dcc9f59f567c36263 to your computer and use it in GitHub Desktop.
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