Ejemplo n.º 1
0
        public static void HandleGoombaCollision(Goomba goomba, IBlock block, CollisionSide side)
        {
            Physics.GeneralPhysics.RepelObject(block, goomba, side);

            if (block.BlockPhysics.BlockBumped)
            {
                goomba.BeFlipped();
                SoundFactory.Instance.PlayKickEnemySound();
            }
            else
            {
                if (IsHorizontalCollision(side))
                {
                    goomba.ChangeDirection(side);
                }
            }
        }
Ejemplo n.º 2
0
 public static void HandleGoombaCollision(IPlayer player, Goomba goomba, CollisionSide side)
 {
     if (player.IsInvincible)
     {
         goomba.BeFlipped();
         ScoreManager.CollectEnemyScore(goomba, false);
         SoundFactory.Instance.PlayKickEnemySound();
     }
     else
     {
         if (side == CollisionSide.Top)
         {
             goomba.BeStomped();
             ScoreManager.CollectEnemyScore(goomba, true);
             player.MovementState.Bounce();
             SoundFactory.Instance.PlayStompEnemySound();
         }
         else
         {
             player.TakeDamage();
         }
     }
 }
Ejemplo n.º 3
0
 public void TakeDamage()
 {
     goomba.BeFlipped();
 }