app/scripts/core/gameCoordinator.js
/**
   * Reveals the game underneath the loading covers and starts gameplay
   */
Reveals the game underneath the loading covers and starts gameplay
Reveals the game underneath the loading covers and starts gameplay
startButtonClick() {
    let playerMail = this.validateField(this.playerMail);
    let playerName = this.validateField(this.playerName);
    if (!this.validate([playerName, playerMail]))
      return;
    this.leftCover.style.left = '-50%';
    this.rightCover.style.right = '-50%';
    this.mainMenu.style.opacity = 0;
    this.gameStartButton.disabled = true;
    setTimeout(() => {
      this.mainMenu.style.visibility = 'hidden';
    }, 1000);
    this.reset();
    if (this.firstGame) {
      this.firstGame = false;
      this.init();
    }
    this.gameBackend
      .createSession({name: playerName, email: playerMail})
      .then(response => {
        this.gameSession = response;
        this.startGameplay(true);    
      });
  }
startButtonClick ( ) { let playerMail = this . validateField ( this . playerMail ) ; let playerName = this . validateField ( this . playerName ) ; if ( ! this . validate ( [ playerName , playerMail ] ) ) return ; this . leftCover . style . left = '-50%' ; this . rightCover . style . right = '-50%' ; this . mainMenu . style . opacity = 0 ; this . gameStartButton . disabled = true ; setTimeout ( ( ) => { this . mainMenu . style . visibility = 'hidden' ; } , 1000 ) ; this . reset ( ) ; if ( this . firstGame ) { this . firstGame = false ; this . init ( ) ; } this . gameBackend . createSession ( { name : playerName , email : playerMail } ) . then ( response => { this . gameSession = response ; this . startGameplay ( true ) ; } ) ; }
Reveals the game underneath the loading covers and starts gameplay
Reveals the game underneath the loading covers and starts gameplay