web design template web design template web design template

Page : 1 2 3 4

1. Insert a new layer above Clock layer and name it as 'Game Over'

2. Select frame 3 and choose Insert > Keyframe

3. With the help of 'Text' tool type 'GAME OVER'

4. Select the text on the stage, convert it into a Movie Clip and name it as 'game over'

5. Select the game over movie clip and choose Window > Actions

6. In the Actions panel type the following actions

onClipEvent (load) {
  Mouse.show();
}  

7. Below the game over movie clip type text as 'You Scored:' and 'You Missed:' one below another

8. Create two Dynamic text fields to show the final scores

9. Select the Dynamic text field for 'You Scored' and in the Properties panel type variable name as 'score'

10. Similarly, select Dynamic text field for 'You Missed' and in the Properties panel type variable name as 'missed'

When the game is over, there should be an option for user to play it again. So we need to create a 'Play Again' button.

11. Insert a new layer above Game Over layer and name it as 'Play Again'

12. Select frame 3 and choose Insert > Keyframe

13. With the help of 'Text' tool type 'Play Again' below the final scores

14. Select the text, convert it into a Button and name it as 'play again'

15. Double click the play again button to go inside it

16. Select frame 2 at Over stage and choose Insert > Keyframe

17. With the help of 'Fill Color' option in the 'Tools' panel change the text color to 'Red'

18. Select frame 4 at Hit stage and choose Insert > Frame

19. Rename the layer as 'Play Again Button'

20. Insert a new layer above Play Again Button layer and drag it downward so that it appears below Play Again Button

21. Select frame at 'Hit' stage and choose Insert > Keyframe

22. Draw a rectangle patch as a 'hit area' of the button

23. Come back into Scene 1

24. Select the play again button on the stage and choose Window > Actions

25. In the Actions panel type the following action

on (release) {
  gotoAndStop(2);
}  

26. Select frame 3 on Actions layer and choose Insert > Keyframe

27. Select keyframe 3 and assign the following action to it

stop();

28. Choose Control > Test Movie

Start playing the game. After 1 minute the game will get over. After the game is over you can see the final scores and with the help of 'Play Again' button you can restart the game.

To add more interaction into the game we can create a gun target which will move with the mouse but mouse can not be seen. This can give a feel like you are aiming towards the balloon.


1. Choose Insert > New Symbol, create a Movie Clip and name it as 'target'

2. Create a gun target of 22px. X 22px. as shown in the image


3. Come back into Scene 1

4. Insert a new layer above Play Again layer and name it as 'Target'

5. Select frame 2 and choose Insert > Keyframe

6. Choose Window > Library > target movie clip

7. Drag the target movie clip on the stage and in the Properties panel type Instance Name as 'aim'

8. Select target movie clip on the stage and choose Window > Actions

9. In the Actions panel type the following actions

onClipEvent (load) {
  Mouse.hide();
}  
onClipEvent (enterFrame) {
  this._x = _root._xmouse;
  this._y = _root._ymouse;
  this.swapDepths(_root.z+1);
  if (_root._currentframe == 3) {
    removeMovieClip("");
  }  
}    


// this._x = _root._xmouse;
// this._y = _root._ymouse;
These actions help the movie clip to drag with the mouse.

// this.swapDepths(_root.z+1);
This action determines Depth of the movie clip.

10. Select frame 3 and choose Insert > Blank Keyframe

11. Choose Control > Test Movie and see how you can target the balloons

To make this game more interactive we can add a background to the game.

1. Insert a new layer below the Balloon Shooter layer

2. Choose File > Import to import a background image for the game

3. Here we have imported 'sky.jpg' as a background image

4. Rename the layer as 'Sky'

5. Insert a new layer above the Actions layer and create a stage outline


Balloon Shooter game is ready. Play the game and try to shoot as many balloons to collect maximum points.

Regards,

Manoj Kotak.
The author is Director of Image Online Pvt. Ltd.
Developer of Layout Galaxy web site design templates for photoshop and Flash.

All accompanying logos, brands and product names are trademarks of their respective companies.

Blood for humans comes only from humans : Donate Blood
http://www.donate-blood.org   E-mail - om@donate-blood.org




© Image Online  2001-2003