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);
 }
Exemple #2
0
 public Weapon(GameController game, MovableGameObject holder) : base(game)
 {
     Holder = holder;
     Initialize();
     projectileSpawnPoint = GetProjectileSpawnPoint();
     OnPositionChanged   += Weapon_OnPositionChanged;
 }
Exemple #3
0
 public Explosion(GameController game, MovableGameObject target) : base(game, target)
 {
     Initialize();
     if (ParticleSize == 0)
     {
         ParticleSize = 7.5;
     }
     explosionParticles = GetExplosionParticles();
     StartExplosion();
 }
        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);
        }
Exemple #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);
     }
 }
Exemple #6
0
 public TankBulletExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
Exemple #7
0
 public PathFollower(GameController game, MovableGameObject follower)
 {
     this.game     = game;
     this.follower = follower;
     Initialize();
 }
Exemple #8
0
 public TankMachineGun(GameController game, MovableGameObject holder) : base(game, holder)
 {
 }
 public WaterTurretProjectileExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
Exemple #10
0
 public SmallExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
        public static void StartExplosion(GameController game, MovableGameObject target, WeaponProjectile explosionSource)
        {
            Explosion explosionAnimation = GetExplosionType(game, target, explosionSource);

            explosionAnimation.Start();
        }
 public TankMissileLauncher(GameController game, MovableGameObject holder) : base(game, holder)
 {
 }