Пример #1
0
        public void Load(Round round)
        {
            this.titleText.Text = "Round Scoring Summary";
            this.shotsFired.Text = round.ShotsFired.ToString();
            this.shotsHit.Text = round.VehiclesHit.ToString();
            this.shotsHitScore.Text = (round.VehiclesHit * Scoring.PointsPerVehicleHit).ToString();
            float percentage = (float)round.VehiclesHit / (float)round.ShotsFired * 100f;
            this.shotPercentage.Text = percentage.ToString("#0.00");
            this.shotPercentageScore.Text = ((int)percentage * Scoring.PointsPerShotPercent).ToString();
            this.kills.Text = round.Kills.ToString();
            this.killsScore.Text = (round.Kills * Scoring.PointsPerKill).ToString();
            this.hitsTaken.Text= round.HitsTaken.ToString();
            this.hitsTakenScore.Text = (round.HitsTaken * (Scoring.PointsPerHitAgainst)).ToString();
            this.powerupsHit.Text = round.PowerupsHit.ToString();
            this.powerupsHitScore.Text = (round.PowerupsHit * (Scoring.PointsPerPowerupHit)).ToString();
            this.projectilesHit.Text = round.ProjectilesHit.ToString();
            this.projectilesHitScore.Text = (round.ProjectilesHit * (Scoring.PointsPerProjectileHit)).ToString();
            this.enemiesFlipped.Text = round.EnemiesFlippedOver.ToString();
            this.enemiesFlippedScore.Text = (round.EnemiesFlippedOver * (Scoring.PointsPerFlippedEnemy)).ToString();
            if (round.Pass)
            {
                this.bonusScore.Text = Scoring.PointsPerRound.ToString();
            }
            else
            {
                this.bonusScore.Text = "0";
            }

            this.totalScore.Text = round.Score.ToString();
        }
Пример #2
0
 public Vehicle(PhysicsSimulator simulator, Round round)
     : base(simulator)
 {
     this.flipCheckInterval = 50;
     this.round = round;
     this.IsDead = false;
     this.MaxHitPoints = 100;
     this.HitPoints = this.MaxHitPoints;
     this.Geometry = null;
     this.Initialize();
 }
Пример #3
0
 void SetUpRound(Round round)
 {
     //round.Wind.Changed += new EventHandler<WindEventArgs>(Wind_Changed);
     round.UserTank.MaxHitPointsChanged += new EventHandler<HitPointsChangedEventArgs>(UserTank_MaxHitPointsChanged);
     round.UserTank.RateOfFireBonusChanged += new EventHandler(UserTank_RateOfFireBonusChanged);
     round.UserTank.DamageBonusChanged += new EventHandler(UserTank_DamageBonusChanged);
     round.UserTank.AccuracyChanged += new EventHandler<VehicleEventArgs>(UserTank_AccuracyChanged);
     this.UserTank_MaxHitPointsChanged(null, null);
     this.game_ScoreChanged(null, null);
     this.UserTank_RateOfFireBonusChanged(null, null);
     this.UserTank_DamageBonusChanged(null, null);
     this.UserTank_AccuracyChanged(null, null);
        // this.Wind_Changed(null, null);
 }
Пример #4
0
        public Round GetNextRound()
        {
            if (this.currentRound != null)
            {
                this.UpdateScore();
            }

            if (this.currentRound == null)
            {
                this.currentRound = new Round1(this.simulator, this);
            }
            else
            {
                this.currentRound = this.currentRound.GetNextRound();
            }

            this.rounds.Add(this.currentRound);
            this.currentRound.ScoreChanged += new EventHandler<RoundEventArgs>(currentRound_ScoreChanged);
            this.currentRound.RoundOver += new EventHandler<RoundEventArgs>(currentRound_RoundOver);
            this.currentRound.PowerupAcquired += new EventHandler<PowerupAcquiredEventArgs>(currentRound_PowerupAcquired);
            this.player.ApplyAllPowerups(this.currentRound.UserTank);
            this.computer.ApplyAllPowerups(this.currentRound.Enemies);
            this.currentRound.UserTank.ResetHitPoints();

            if (this.RoundChanged != null)
            {
                this.RoundChanged(this, new GameEventArgs(this));
            }

            return this.currentRound;
        }
Пример #5
0
 public EnemyVehicle(PhysicsSimulator simulator, Round round)
     : base(simulator, round)
 {
 }
Пример #6
0
 public RoundEventArgs(Round round)
 {
     this.Round = round;
 }
Пример #7
0
        void title_Closed(object sender, EventArgs e)
        {
            this.viewerCanvas.Children.Remove(sender as RoundTitle);

            this.round = game.GetNextRound();
            if (this.round != null)
            {
                this.round.RoundOver += new EventHandler<RoundEventArgs>(round_RoundOver);
                this.round.PowerupCreated += new EventHandler<PowerupEventArgs>(round_PowerupCreated);
                this.InitializeRound();
            }
        }