public void Execute(Collision collision) { IProjectile proj = ((IProjectile)collision.Collider); IEnvironment envo = (IEnvironment)collision.Collidee; if (envo is LaserField) { proj.BeginDespawn(); } else if (envo is PortalBlock portalBlock) { PortalUtil.HandleProjectilePortal(portalBlock, proj, game.Screen); } else if (proj is BombProjectile && proj.GetHitbox().Width > bombWidth && proj.GetHitbox().Height > bombHeight) { RoomUtil.OpenBombableDoor(game.Screen, envo); } else if (!(proj is SwordBeam) && !(proj is BombProjectile)) { if (collision.IntersectionRec.X >= rightBorder || collision.IntersectionRec.X <= leftBorder || collision.IntersectionRec.Y >= bottomBorder || collision.IntersectionRec.Y <= topBorder) { proj.BeginDespawn(); } } else if (proj is Fireballs) { proj.BeginDespawn(); } }