Landers | Adding some crackle.

The core mechanics of the game are now complete, but we can extend the development to embed what we have learned and create a better game. These extensions are presented in three levels of increasing difficulty we call, 'snap', 'crackle' and 'pop'. You are now on your own, but none of these extensions require you to learn anything new that was not introduced in this or previous tutorials. Challenge yourself to see how far you can get using the stages in the tutorials for reference.

  1. When a wave of invaders has been destroyed, a new wave should appear.

    You learned how to call user defined functions in stage 3c. Use a new attribute in the swarm script to keep track of how many invaders are alive. Increase this by one when invaders are added to the table. Decrease this by one when an invader is removed from the table. If the invader count is zero in the swarm update function, call the code to spawn a new wave.
  2. Introduce a special invader object that randomly appears periodically and travels across the top of the screen. It is worth extra points if shot.

    You learned about creating and positioning single instances of an object in stage 5.
  3. Use a factory to spawn random stars that move down the screen. You can achieve this with an animation path in the way comets moved towards the earth in the Incoming tutorial. This will give the effect of the space ship travelling forwards.

    You learned how to use a factory to spawn multiple instances of a game object in Incoming stage 4.

    Alternatively, instead of using an animation path you could spawn the stars with a factory and give them a script to update their position and then despawn when they reach the bottom of the screen

Now progress to the next set of challenges. Stage 9 >