예제 #1
0
        /// <summary>
        ///This method is called when it's this player's turn
        ///The player will need to call methods in gameplayForm
        ///such as SelectWeapon(), SetAngle(), SetForce() and finally Launch() to aim and fire the weapon.
        /// </summary>
        public override void NewTurn(GameplayForm gameplayForm, Battle currentGame)
        {
            GameplayTank gameplayTank = currentGame.GetCurrentGameplayTank();

            int numPlayers = currentGame.NumPlayers();
            //for each player find the first player who still exists and aim at them. //There has to be an easier way

            Random random = new Random();
            int    angle  = random.Next(-90, 91);
            int    power  = random.Next(25, 101);

            gameplayForm.SetForce(power);
            gameplayForm.SetAngle(angle);
            gameplayForm.Launch();
        }
예제 #2
0
 public void Launch()
 {
     currentGame.GetCurrentGameplayTank().Launch();
     controlPanel.Enabled = false;
     timer1.Enabled       = true;
 }