Пример #1
0
 void Construct()
 {
     this.powerupInterval = 280;
     Page.SceneLoop.Update += new EventHandler<SceneLoopEventArgs>(sceneLoop_Update);
     this.enemyCount = 1;
     this.enemyRateOfFireBonus = 0;
     this.enemyPercentError = .15f;
     this.enemySingleShot = true;
     this.vehicleList = new List<Vehicle>();
     this.projectileList = new List<Projectile>();
     this.powerups = new List<Powerup>();
     this.wind = new Wind();
     this.userTank = new Vehicle(simulator, this);
     this.userTank.HitPoints = 200;
     this.userTank.FiredShot += new EventHandler<FiredShotEventArgs>(userTank_FiredShot);
     this.userTank.HitTarget += new EventHandler<HitTargetEventArgs>(userTank_HitTarget);
     this.userTank.HitProjectile += new EventHandler<VehicleEventArgs>(userTank_HitProjectile);
     this.userTank.HitPowerup += new EventHandler<VehicleEventArgs>(userTank_HitPowerup);
     this.userTank.ProjectileCreated += new EventHandler<ProjectileEventArgs>(userTank_ProjectileCreated);
     this.userTank.TookHit += new EventHandler<VehicleEventArgs>(userTank_TookHit);
     this.userTank.RateOfFireBonus = .5;
     this.userTank.AllowedToFire = true;
     this.userTank.PercentError = .15d;
     this.userTank.ControlledByUser = true;
     this.userTank.Color = Colors.Orange;
     this.map = this.CreateMap(simulator);
     this.ceiling = new Ceiling(simulator);
     this.rightWall = this.CreateRightWall(simulator);
     this.leftWall = this.CreateLeftWall(simulator);
     this.vehicleList.Add(this.userTank);
     this.Initialize(simulator);
 }
Пример #2
0
 protected virtual Wall CreateRightWall(PhysicsSimulator simulator)
 {
     Wall wall = new Wall(simulator);
     wall.Position = new Vector2(Screen.Width - 10, Screen.Height / 2);
     return wall;
 }