Esempio n. 1
0
 public void PlaySoundEffect()
 {
     if (ProgramParameters.Get_MusicEnable())
     {
         OnMoveSoundEffect.Play(0.5f, 0f, 0f);
     }
 }
Esempio n. 2
0
        static private void ChceckTimerObjects()
        {
            for (int i = ObjectToDraw.Count - 1; i >= 0; i--)
            {
                if (ObjectToDraw[i] is Fire fire1)
                {
                    fire1.ShorterTimeToEndFire();
                    if (fire1.GetTimeToEndFire() <= 0)
                    {
                        ObjectToDraw.Remove(ObjectToDraw[i]);
                    }
                }
                else if (ObjectToDraw[i] is Powerups powerups1)
                {
                    if (powerups1.GetIndestructible() <= 0)
                    {
                        powerups1.SetNextTexture(PowerupsTextures[powerups1.GetTypePowerups() - 1].Count);
                    }
                    else
                    {
                        powerups1.IndestructibleDecrement();
                    }
                }
                else if (ObjectToDraw[i] is Bomb bomb1)
                {
                    bomb1.ShortenTheTimer();
                    if (bomb1.GetTimer() % ((int)(bomb1.GetMaxTime() / (BombTextures.Count)) + 1) == 0 && bomb1.GetMaxTime() != bomb1.GetTimer())
                    {
                        bomb1.SetNextTexture();
                    }
                    if (bomb1.CheckDestroyTimer())
                    {
                        DestroyBomb(i, bomb1);
                        if (ProgramParameters.Get_MusicEnable())
                        {
                            BombDestroy.Play(0.5f, 0f, 0f);
                        }
                    }
                }
            }

            foreach (Character Character1 in Player)
            {
                Character1.ShortenTheDelay();//Player shorten time to put bomb
            }
        }
Esempio n. 3
0
 static private void TryPickPowerUp(ref List <Powerups> powerups)
 {
     foreach (Character character1 in Player)
     {
         for (int i = powerups.Count - 1; i >= 0; i--)
         {
             if (powerups[i].ChceckColision(character1.GetPosX(), character1.GetPosY()))
             {
                 Powerups powerup1 = (Powerups)powerups[i];
                 powerup1.AddPower(character1);
                 powerups.Remove(powerups[i]);
                 if (ProgramParameters.Get_MusicEnable())
                 {
                     PowerupsPick.Play(0.5f, 0f, 0f);
                 }
             }
         }
     }
 }