Starting the attack waves
But how do you tell the game when to use the asteroids? For that, I created a controller object with an extremely thin, but room height tall sprite! I placed this a screens width in front of the player and left it to move with the room. The idea here was that the player started off with nothing but his ship on screen moving throught the level, after a short while the player would collide with this controller object (being the entire height of the screen, there was no way to avoid it) and this would trigger a set of alarms in the controllers collision event with the player at certain intervals, something like this
/* First wave: Asteroids ************************************
These will move from right to left at different speeds and cannot be destroyed, the player has to dodge them.
--Set number of asteroids */
asteroids = 100;
// Start them moving
alarm[0] = 10;
// ***********************************************************
/* Second Wave Wave: Stop - Fire ships ***********************
These ships come down from the top downwards at random intervals and stop at random positions, they then turn and fire towards the player.
--Set number of Stop - Fire ships */
stopfireships = 30;
// Start them moving
alarm[2] = 1050;
At 10 steps after the player has collided with the controller object, I created 100 asteroids one after the other at random heights just outside the right-hand side of the view and then had them move left at different speeds. When put together, this gave the illusion of the player going through an asteroid field, which he had to dodge. And darned good luck to him too! :)
/* First wave: Asteroids ************************************
These will move from right to left at different speeds and cannot be destroyed, the player has to dodge them.
--Set number of asteroids */
asteroids = 100;
// Start them moving
alarm[0] = 10;
// ***********************************************************
/* Second Wave Wave: Stop - Fire ships ***********************
These ships come down from the top downwards at random intervals and stop at random positions, they then turn and fire towards the player.
--Set number of Stop - Fire ships */
stopfireships = 30;
// Start them moving
alarm[2] = 1050;
At 10 steps after the player has collided with the controller object, I created 100 asteroids one after the other at random heights just outside the right-hand side of the view and then had them move left at different speeds. When put together, this gave the illusion of the player going through an asteroid field, which he had to dodge. And darned good luck to him too! :)


0 Comments:
Post a Comment
<< Home