protected override void Initialize() { base.Initialize(); pawnModel = (Rectangle)GameHelper.Clone(Game.GameObjectModels["enemyPawnModel"]); HitPoints = maxHitPoints; speed = normalSpeed; }
protected override void Initialize() { base.Initialize(); turretModel = (Canvas)GameHelper.Clone(Game.GameObjectModels["waterTurretModel"]); projectileLauncher = new WaterTurretLauncher(Game, this); enemies = Game.GetEnemies(); }
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; }
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); }
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); }