app/scripts/core/gameCoordinator.js
/**
   * Displays "Ready!" and allows Pacman to move after a breif delay
   * @param {Boolean} initialStart - Special condition for the game's beginning
   */
Displays "Ready!" and allows Pacman to move after a breif delay
@param {Boolean} initialStart - Special condition for the game's beginning
Displays " Ready! " and allows Pacman to move after a breif delay @param { Boolean } initialStart - Special condition for the game ' s beginning
startGameplay(initialStart) {
    if (initialStart) {
      this.soundManager.play(gameStart);
    }
    this.scaredGhosts = [];
    this.eyeGhosts = 0;
    this.allowPacmanMovement = false;
    const left = this.scaledTileSize * 11;
    const top = this.scaledTileSize * 16.5;
    const duration = initialStart ? 4500 : 2000;
    const width = this.scaledTileSize * 6;
    const height = this.scaledTileSize * 2;
    this.displayText({ left, top }, 'ready', duration, width, height);
    this.updateExtraLivesDisplay();
    new Timer(() => {
      this.allowPause = true;
      this.cutscene = false;
      this.soundManager.setCutscene(this.cutscene);
      this.soundManager.setAmbience(this.determineSiren(this.remainingDots));
      this.allowPacmanMovement = true;
      this.pacman.moving = true;
      this.ghosts.forEach((ghost) => {
        const ghostRef = ghost;
        ghostRef.moving = true;
      });
      this.ghostCycle('scatter');
      this.idleGhosts = [this.pinky, this.inky, this.clyde];
      this.releaseGhost();
    }, duration);
  }
startGameplay ( initialStart ) { if ( initialStart ) { this . soundManager . play ( gameStart ) ; } this . scaredGhosts = [ ] ; this . eyeGhosts = 0 ; this . allowPacmanMovement = false ; const left = this . scaledTileSize * 11 ; const top = this . scaledTileSize * 16.5 ; const duration = initialStart ? 4500 : 2000 ; const width = this . scaledTileSize * 6 ; const height = this . scaledTileSize * 2 ; this . displayText ( { left , top } , 'ready' , duration , width , height ) ; this . updateExtraLivesDisplay ( ) ; new Timer ( ( ) => { this . allowPause = true ; this . cutscene = false ; this . soundManager . setCutscene ( this . cutscene ) ; this . soundManager . setAmbience ( this . determineSiren ( this . remainingDots ) ) ; this . allowPacmanMovement = true ; this . pacman . moving = true ; this . ghosts . forEach ( ( ghost ) => { const ghostRef = ghost ; ghostRef . moving = true ; } ) ; this . ghostCycle ( 'scatter' ) ; this . idleGhosts = [ this . pinky , this . inky , this . clyde ] ; this . releaseGhost ( ) ; } , duration ) ; }
Displays "Ready!"
Displays " Ready! "