示例#1
0
        /*
         * This function sets a new round. It takes the new round number as its argument.
         */
        void SetNewRound(int newRoundNumber)
        {
            //store in the values needed for the enemy
            const int NUMBER_OF_ENEMY_EXPENDING_RATE = 2;
            const int ENEMY_SPEED_EXPENDING_RATE     = 10;
            const int ENEMY_HEALTH_EXPENDING_RATE    = 75;
            const int MONEY_EXPENDING_RATE           = 5;
            //store in the values needed for the round number
            const int ROUND_TWO = 2, ROUND_THREE = 3;

            //set the round depending on the input round number. Each round gets harder
            switch (newRoundNumber)
            {
            case ROUND_TWO:
                enemyCurrentRound = new EnemyList(FIRST_ROUND_NUMBER_OF_ENEMIES + newRoundNumber * NUMBER_OF_ENEMY_EXPENDING_RATE, ENEMY_STARTING_X_LOCATION, ENEMY_STARTING_Y_LOCATION, FIRST_ROUND_ENEMY_SPEED + ENEMY_SPEED_EXPENDING_RATE * newRoundNumber, GAP_DISTANCE_BETWEEN_ENEMIES, enemySize, FIRST_ROUND_ENEMY_HEALTH + ENEMY_HEALTH_EXPENDING_RATE * newRoundNumber, 25 + newRoundNumber * MONEY_EXPENDING_RATE, Properties.Resources.Enemy2);
                break;

            case ROUND_THREE:
                enemyCurrentRound = new EnemyList(FIRST_ROUND_NUMBER_OF_ENEMIES + newRoundNumber * NUMBER_OF_ENEMY_EXPENDING_RATE, ENEMY_STARTING_X_LOCATION, ENEMY_STARTING_Y_LOCATION, FIRST_ROUND_ENEMY_SPEED + ENEMY_SPEED_EXPENDING_RATE * newRoundNumber, GAP_DISTANCE_BETWEEN_ENEMIES, enemySize, FIRST_ROUND_ENEMY_HEALTH + ENEMY_HEALTH_EXPENDING_RATE * newRoundNumber, 25 + newRoundNumber * MONEY_EXPENDING_RATE, Properties.Resources.Enemy3);
                break;

            default:
                break;
            }
        }
示例#2
0
 public Main()
 {
     //store in the health of the enemy
     InitializeComponent();
     ClientSize = new Size(MAX_CLIENT_WIDTH, MAX_CLIENT_HEIGHT);
     // Lock program size
     MaximizeBox     = false;
     FormBorderStyle = FormBorderStyle.FixedSingle;
     size            = ClientSize;
     //set the first round
     enemyCurrentRound = new EnemyList(FIRST_ROUND_NUMBER_OF_ENEMIES, ENEMY_STARTING_X_LOCATION, ENEMY_STARTING_Y_LOCATION, FIRST_ROUND_ENEMY_SPEED, GAP_DISTANCE_BETWEEN_ENEMIES, enemySize, FIRST_ROUND_ENEMY_HEALTH, 25, Properties.Resources.Enemy1);
     //tell the program we have already finished setting the new round
     newRoundSetted = true;
     // GUI
     gui = new UI(UIState.Start);
 }
示例#3
0
 public static void Restart()
 {
     enemyCurrentRound = new EnemyList(10, 735, -100, 100, 70, new SizeF(30, 30), 200, 25, Properties.Resources.Enemy1);
     gui.RestartGame();
 }