Example #1
0
 /// <summary>
 /// Obtient la vitesse de pacman et gère l'exitation du bonbon
 /// </summary>
 /// <returns>vitesse</returns>
 public int getVitesse()
 {
     if (!AMangéBonbon)
     {
         return(m_vitesse);
     }
     if (TempsBonbon - (tempsPasséEnBonbon++ / 60) == 0)
     {
         MangerBonbon?.Invoke(this, PacManType.PacManNormal);
         tempsPasséEnBonbon        = 0;
         AMangéBonbon              = false;
         Jeu.Instance.nbFantomeTué = 0;
     }
     else if (TempsBonbon - (tempsPasséEnBonbon / 60) <= 1)
     {
         MangerBonbon?.Invoke(this, PacManType.PacManMoyen);
     }
     return(m_vitesse * 3);
 }
Example #2
0
 /// <summary>
 /// Démarre l'exitation du bonbon
 /// </summary>
 public void bonbonTime()
 {
     MangerBonbon?.Invoke(this, PacManType.SuperPacMan);
     AMangéBonbon       = true;
     tempsPasséEnBonbon = 0;
 }