First time here? First time here? Newsletter Signup Newsletter
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!


  • 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: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.