public void HandleCollision() { HandleScore(); if (enemy is Boo) { HandlePacMarioCollision(); } else if (!MarioDeadState() && !mario.IsStarMario() && enemy is GreenKoopa && ((GreenKoopa)enemy).IsHit) { WeaponizedKoopa(); } else if (!MarioDeadState() && !mario.IsStarMario() && side is TopSideCollision && !enemy.IsFlipped) { MarioEnemyTopSide(); } else if (!MarioDeadState() && !mario.IsStarMario() && !mario.IsHurt() && enemy.CanDealDamage && !(enemy is Boo)) { collision.ResolveOverlap(mario, side); if (mario.IsBigMario()) { SoundEffectManager.ShrinkingOrPipeEffect(); } mario.Damage(); } else if (mario.IsStarMario()) { enemy.CanDealDamage = false; enemy.Flipped(); } }