Exemplo n.º 1
0
 private void OnShotCollision(object sender, ShotCollisionEventArgs e)
 {
     if (e.OtherEntity is WallTileEntity)
     {
         if (e.Shot.ShotType == ShotType.Bullet)
         {
             _effectsManager.AddSparksEffect(e.Shot.Sprite.Location, e.Shot.Velocity);
         }
         else
         {
             CreateLargeExplosion(e.Shot.Sprite.Location);
         }
     }
 }
    private static void CheckShotWallImpacts(Sprite shot)
    {
        if (shot.Expired)
        {
            return;
        }

        if (TileMap.IsWallTile(TileMap.GetSquareAtPixel(shot.WorldCenter)))
        {
            shot.Expired = true;

            if (shot.Frame == 0)
            {
                EffectsManager.AddSparksEffect(shot.WorldCenter, shot.Velocity);
            }
            else
            {
                CreateLargeExplosion(shot.WorldCenter);
                CheckRocketSplashDamage(shot.WorldCenter);
            }
        }
    }