Ejemplo n.º 1
0
        public void HandleCollision(IEnemy enemy)
        {
            if (mario.IsStarMario() && result != Direction.None)
            {
                enemy.Beflipped();
                SoundManager.Instance.PlaySoundEffect(SoundString.flip);
                ScoringSystem.Instance.AddPointsForStompingEnemy(enemy);
            }


            if (result == Direction.Up)
            {
                enemy.BeStomped();
                SoundManager.Instance.PlaySoundEffect(SoundString.stomp);
            }

            if (enemy.EnemyState is StompedKoopaState && result == Direction.Right)
            {
                enemy.TurnLeft();
                SoundManager.Instance.PlaySoundEffect(SoundString.flip);
            }
            else if (enemy.EnemyState is StompedKoopaState && result == Direction.Left)
            {
                enemy.TurnRight();
                SoundManager.Instance.PlaySoundEffect(SoundString.flip);
            }
        }
Ejemplo n.º 2
0
 public void EnemyBumpedBlockReact(IEnemy enemy)
 {
     if (block is BumpedBlockDecorator)
     {
         enemy.Beflipped();
         ScoringSystem.Instance.AddPointsForEnemyBelowBlockHit(enemy);
     }
 }
Ejemplo n.º 3
0
 private void GoombaKoopaReact(IEnemy enemyParam)
 {
     if (enemyParam.EnemyState is LeftStompedKoopaState && result == Direction.Right ||
         enemyParam.EnemyState is RightStompedKoopaState && result == Direction.Left)
     {
         enemy.Beflipped();
         Timer.ExtendTime(TimerUtil.Two);
         FloatingTimeBar.CreateNewTimeAnimation(enemyParam, TimerUtil.Three * TimerUtil.ExtentTime);
         ScoringSystem.Instance.AddPointsForEnemyHitByShell(enemyParam);
     }
 }
 public void HandleCollision(IEnemy enemy)
 {
     enemy.Beflipped();
     if (enemy.IsGoomba())
     {
         ScoringSystem.Instance.AddPointsForFireballGoombaHit(enemy);
     }
     else
     {
         ScoringSystem.Instance.AddPointsForFireballKoopaHit(enemy);
     }
 }