Exemplo n.º 1
0
 protected override void Initialize()
 {
     base.Initialize();
     pawnModel = (Rectangle)GameHelper.Clone(Game.GameObjectModels["enemyPawnModel"]);
     HitPoints = maxHitPoints;
     speed     = normalSpeed;
 }
Exemplo n.º 2
0
 protected override void Initialize()
 {
     base.Initialize();
     turretModel        = (Canvas)GameHelper.Clone(Game.GameObjectModels["waterTurretModel"]);
     projectileLauncher = new WaterTurretLauncher(Game, this);
     enemies            = Game.GetEnemies();
 }
Exemplo n.º 3
0
 protected override void Initialize()
 {
     base.Initialize();
     wallModel          = (Rectangle)(GameHelper.Clone(Game.GameObjectModels["wallBody"]));
     Model.Opacity      = .7f;
     Center             = new Point(Position.X + Width / 2, Position.Y + Height / 2);
     OnPositionChanged += On_PositionChanged;
 }
Exemplo n.º 4
0
 protected override void Initialize()
 {
     base.Initialize();
     moveSpeed       = minSpeed;
     tankModel       = (Canvas)GameHelper.Clone(Game.GameObjectModels["tankModel"]);
     machineGun      = new TankMachineGun(Game, this);
     missileLauncher = new TankMissileLauncher(Game, this);
     Position        = new Point(Canvas.GetLeft(Model), Canvas.GetTop(Model));
     StartEventListeners();
     HitPoints = 10;
     Panel.SetZIndex(Model, 1);
 }
Exemplo n.º 5
0
        private Queue <ExplosionParticle> GetExplosionParticles(Type particleType, int particlesPerType)
        {
            Queue <ExplosionParticle> particles = new Queue <ExplosionParticle>();

            if (particleType == typeof(Rectangle))
            {
                for (int i = 0; i < particlesPerType; i++)
                {
                    ExplosionParticle particle = new ExplosionParticle(game, (Rectangle)GameHelper.Clone(game.GameObjectModels["rectangleExplosionParticle"]));
                    particles.Enqueue(particle);
                    particle.Model.Visibility = System.Windows.Visibility.Hidden;
                    game.PlayArea.Children.Add(particle.Model);
                }
            }
            if (particleType == typeof(Ellipse))
            {
                for (int i = 0; i < particlesPerType; i++)
                {
                    ExplosionParticle particle = new ExplosionParticle(game, (Ellipse)GameHelper.Clone(game.GameObjectModels["ellipseExplosionParticle"]));
                    particles.Enqueue(particle);
                    particle.Model.Visibility = System.Windows.Visibility.Hidden;
                    game.PlayArea.Children.Add(particle.Model);
                }
            }
            return(particles);
        }