app/scripts/core/gameCoordinator.js
/**
   * Upon eating a power pellet, sets the ghosts to 'scared' mode
   */
Upon eating a power pellet, sets the ghosts to 'scared' mode
Upon eating a power pellet sets the ghosts to ' scared ' mode
powerUp() {
    if (this.remainingDots !== 0) {
      this.soundManager.setAmbience(powerUpSound);
    }
    this.removeTimer({ detail: { timer: this.ghostFlashTimer } });
    this.ghostCombo = 0;
    this.scaredGhosts = [];
    this.ghosts.forEach((ghost) => {
      if (ghost.mode !== 'eyes') {
        this.scaredGhosts.push(ghost);
      }
    });
    this.scaredGhosts.forEach((ghost) => {
      ghost.becomeScared();
    });
    const powerDuration = Math.max((7 - this.level) * 1000, 0);
    this.ghostFlashTimer = new Timer(() => {
      this.flashGhosts(0, 9);
    }, powerDuration);
  }
powerUp ( ) { if ( this . remainingDots !== 0 ) { this . soundManager . setAmbience ( powerUpSound ) ; } this . removeTimer ( { detail : { timer : this . ghostFlashTimer } } ) ; this . ghostCombo = 0 ; this . scaredGhosts = [ ] ; this . ghosts . forEach ( ( ghost ) => { if ( ghost . mode !== 'eyes' ) { this . scaredGhosts . push ( ghost ) ; } } ) ; this . scaredGhosts . forEach ( ( ghost ) => { ghost . becomeScared ( ) ; } ) ; const powerDuration = Math . max ( ( 7 - this . level ) * 1000 , 0 ) ; this . ghostFlashTimer = new Timer ( ( ) => { this . flashGhosts ( 0 , 9 ) ; } , powerDuration ) ; }
Upon eating a power pellet, sets the ghosts to 'scared' mode
Upon eating a power pellet sets the ghosts to ' scared ' mode