First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
Search tutorials
Author: David Doull | Website: http://www.artifactinteractive.com.au

Game Over

Great, now we want to set up a game over message, that is displayed if the players spaceship collides with an enemy.

You may want to do an animation sequence for the end of the game, but to keep this tutorial as simple as possible our end sequence will be one frame with the message Game Over and the final score.

Lets do it

Close the actions window if its still open.

On the main timeline add an extra frame to the end of every layer, so you will now have a 3 frame movie. Now, insert a blank keyframe (Insert > Blank key frame) on frame 3 of the enemy, laser, spaceship and control layers (as shown on the right)

The main timeline stops on frame 2 while the game is playing. When the game is over it will move to frame 3. We inserted blank keyframes on the laser, spaceship and enemy layers because we don't want these movieclip still visible at the end of the game.

Select the blank keyframe on frame 3 of the control layer and in the frame panel give the frame the label gameOver (as shown on the right).

Previously we set up the code for the main timeline to goto a frame labelled gameOver when a collision between the player and enemy is detected. We have now added in that label.

Still on the main timeline add in a new layer called game over and insert a blank keyframe on the third frame of this new layer (select frame 3 of the layer and Insert > Blank Keyframe).
Now, at this new keyframe add some text on the stage saying game over. It doesn't matter what font or size or colour - just pick something you like. Move the game over message to the middle of the stage.

 

OK, we now have the core game built. Give it a test!

Having tested the game you will probably have noticed two key things we need to improve.

1. We need a way to restart the game when its over.
2. At the moment you can fire lasers continuously which doesn't make the game very challenging. What we want to do is limit the amount of laser fire on the screen at any one time. This type of limited fire is common in arcade games and means that the player has to think before they fire.

We will make both of these improvements in the next step

» Level Intermediate

Added: 2001-05-04
Rating: 9 Votes: 517
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.