public static void HandleGoombaCollision(Goomba goomba, IEnemy collidedEnemy, CollisionSide side) { Physics.GeneralPhysics.RepelObject(collidedEnemy, goomba, side); if (!IsHorizontalCollision(side)) { return; } switch (collidedEnemy) { case Goomba collidedGoomba: collidedGoomba.ChangeDirection(GetOppositeSide(side)); break; case Koopa collidedKoopa: if (collidedKoopa.IsKicked) { goomba.TakeDamage(); SoundFactory.Instance.PlayKickEnemySound(); } else { collidedKoopa.ChangeDirection(GetOppositeSide(side)); } break; } goomba.ChangeDirection(side); }