|
Written by Geoff Hill
|
|
Saturday, 03 April 2010 13:53 |
Begin
Open the moving target game developed in tutorial 3 and save it with a new name. You will be able to re-use a lot of the movieclips and code in this game.
In previous tutorials the emphasis has been on changing text values, controlling the movement of movieclips and detecting mouse clicks. In this tutorial, the learner will modify the moving target game developed in Tutorial 3. Simple Moving Target, to use the keyboard to control movement and shooting at the target.
The Game
This game requires two additional movie clips:
- The dart – that will be fired at the balloon
- The blowpipe – this will move either left or right and will be used to fire the dart.
In this game the player will be presented with a number of moving targets (balloons) and a shooter (blowpipe). Left and right arrow keys will control movement of the blowpipe and pressing the space bar will fire a dart from the blowpipe. When a predetermined number of darts have been fired, the game is over. The click counter from tutorial 3, will be modified to count down and display the number of darts remaining to be fired.
Learning Outcomes:
- To write actionscript to use keys pressed on the keyboard to control movieclip movement.
- To load multiple movieclips from the library. (blowpipe, darts, targets).
- To write code to control game play.
|
|
Last Updated on Saturday, 03 April 2010 13:54 |