Esempio n. 1
0
        public void NewRound()
        {
            this.currentPlayer = this.startingGenericPlayer;
            //initialising map
            this.drawBattleGround = new Map();

            ///making an array to store the positions of players
            int[] positionPlayers = new int[arrNumPlayer.Length];
            positionPlayers = CalculatePlayerPositions(arrNumPlayer.Length);

            //random positioning for players
            Randomise(positionPlayers);

            //player to keep start looping through the player
            int player = 0;

            do
            {
                //if null means its all matching and no need to create anymore players
                //so we break it
                if (modelPlayerController[player] == null)
                {
                    break;
                }
                //if not null then keep making each player
                else
                {
                    //for each player to start the round
                    modelPlayerController[player].StartRound();
                    //taking the horizontal position from positionPlayer array at the current index
                    int tHorizontalPosition = positionPlayers[player];

                    //getting positioning for tank from map class
                    int tVerticalPosition = drawBattleGround.TankVerticalPosition(tHorizontalPosition);

                    //create the tank itself with values that we gathered from above
                    BattleTank tank = new BattleTank(modelPlayerController[player], tHorizontalPosition, tVerticalPosition, this);

                    //each instance that we are looping through creates a tank
                    modelPlayerTank[player] = tank;
                    player++;
                }
            } while (player < this.arrNumPlayer.Length);

            //random number, wind speed, initialising form
            Random rnd = new Random();

            this.windSpeed = rnd.Next(-100, 100);
            GameForm newForm = new GameForm(this);

            newForm.Show();
        }
Esempio n. 2
0
 public abstract void CommenceTurn(GameForm gameplayForm, GameController currentGame);
Esempio n. 3
0
 public override void CommenceTurn(GameForm gameplayForm, GameController currentGame)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 public override void StartTurn(GameForm gameplayForm, Game currentGame)
 {
     gameplayForm.EnableControlPanel();
 }
 public override void BeginTurn(GameForm gameplayForm, Game currentGame)
 {
     gameplayForm.EnableTankControls();
 }
Esempio n. 6
0
 public abstract void StartTurn(GameForm gameplayForm, Game currentGame);
Esempio n. 7
0
 public abstract void BeginTurn(GameForm gameplayForm, Game currentGame);
Esempio n. 8
0
 public override void BeginTurn(GameForm gameplayForm, Game currentGame)
 {
 }