示例#1
0
 public static void StartExplosion(GameController game, MovableGameObject target, Type explosionType)
 {
     object[] parameters = new object[2];
     parameters[0] = game;
     parameters[1] = target;
     Explosion explosion = (Explosion)Activator.CreateInstance(explosionType, parameters);
 }
示例#2
0
 public Weapon(GameController game, MovableGameObject holder) : base(game)
 {
     Holder = holder;
     Initialize();
     projectileSpawnPoint = GetProjectileSpawnPoint();
     OnPositionChanged   += Weapon_OnPositionChanged;
 }
示例#3
0
 public Explosion(GameController game, MovableGameObject target) : base(game, target)
 {
     Initialize();
     if (ParticleSize == 0)
     {
         ParticleSize = 7.5;
     }
     explosionParticles = GetExplosionParticles();
     StartExplosion();
 }
示例#4
0
        private static Explosion GetExplosionType(GameController game, MovableGameObject target, WeaponProjectile explosionSource)
        {
            Explosion explosionAnimation = null;
            Type      projectileType     = explosionSource.GetType();

            if (projectileType == typeof(TankMachineGunBullet))
            {
                explosionAnimation = new MediumExplosion(game, target);
            }
            else if (projectileType == typeof(TankMissileLauncherMissile))
            {
                explosionAnimation = new BigExplosion(game, target);
            }
            return(explosionAnimation);
        }
示例#5
0
 public void RemoveGameObject(MovableGameObject obj)
 {
     PlayArea.Children.Remove(obj.Model);
     if (obj is Enemy)
     {
         enemies.Remove(obj as Enemy);
     }
     if (obj is IUpdate)
     {
         updatingObjects.Remove(obj as IUpdate);
     }
     if (obj is ICollidableGameObject)
     {
         collidableGameObjects.Remove(obj as ICollidableGameObject);
     }
 }
示例#6
0
 public TankBulletExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
示例#7
0
 public PathFollower(GameController game, MovableGameObject follower)
 {
     this.game     = game;
     this.follower = follower;
     Initialize();
 }
示例#8
0
 public TankMachineGun(GameController game, MovableGameObject holder) : base(game, holder)
 {
 }
 public WaterTurretProjectileExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
示例#10
0
 public SmallExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
示例#11
0
        public static void StartExplosion(GameController game, MovableGameObject target, WeaponProjectile explosionSource)
        {
            Explosion explosionAnimation = GetExplosionType(game, target, explosionSource);

            explosionAnimation.Start();
        }
示例#12
0
 public TankMissileLauncher(GameController game, MovableGameObject holder) : base(game, holder)
 {
 }