Space Game

Klik & Play Home      Mindtools Home


 
   

Space Game Story

This is a space ship shooting game. The player controls a space ship that moves left and right across the bottom of the screen. There is an asteroid that bounces around the screen. To get points you must shoot the asteroid. When you have 100 points you go to the next level. If the asteroid hits you, you lose a life.  When you have lost all your lives the game ends.


Step 1 - Set up the opening screen

Put in a background: add a colour and one or two background space objects (Don’t add in any active objects)
When you have your background the way you want it, on the menus go to Edit > Preferences and choose to Lock Backdrop and Quick Backdrop.

That way you won't accidentally move objects.

Use the text tool to put in a title: Space Game
Use the text tool to put in: Press F1 for instructions. Press enter to start.

Put in game information

On the menus go to Edit > Game Setup    Put in Title and Author

Choose Create Game Instructions:  Choose a text file and type in

Shoot the asteroid to get points.
Press space to fire.
If the asteroid hits you, you lose a life and lose 20 points.
When you have 100 points you go to the next level.
 

Save your file.

 

Go to the Event Editor

Add an event by clicking the + button: Choose a keyboard event: Upon pressing Enter, go to next frame



Go to the Storyboard Editor and add in a new frame, ready for your first level.

 

 

Step 2 - Make the first level

Go to the Level Editor.  Unlock the background so you can adjust your objects (Edit > Preferences)

Put in a space background and add in background objects. Lock the background when you are finished. (Edit > Preferences)

 

Put in a skyrocket on the bottom of the screen: Choose 8 direction movement, but turn off all directions except left and right.

Add in an asteroid – give it bouncing ball movement.

Add in lives and score objects (Double click to edit lives or score objects to change their colour)

 


Step 3 - Try your game

Go to the Step Through Editor and try your game.  Put in these actions:
Event Actions
Collision between asteroid and space ship Bounce asteroid, lose life, subtract 20 points, add a sound
Space ship leaves on left or right Stop
Asteroid leaves anywhere Bounce
Number of lives reaches zero End Game

Step 4  Put in Shooting

Go to Event Editor

Add a new condition:

Keyboard: Upon pressing spacebar: Spaceship > Shoot an object.  Choose a bullet and set the direction of shooting to be vertical.

 

 

Go back to the Step Through Editor. Play your game using Space Bar to shoot and add in these actions:

Event Actions
Bullet collides with rocket Ignore
Bullet leaves play area on top Ignore
Last bullet has been destroyed Ignore
Bullet collides with asteroid Add 5 points, Make a sound, Destroy bullet
 

Step 5: Move to the next level

To get to the next level, when the score is 100:

Go to the Event Editor
Add in a new event: Test to see if score = 100, go to next level.

Create your next level!


Extension 1: Ending the Game More Gracefully

You will have noticed that the game just ends abruptly when you have lost all your lives.  Rather than choosing 'End the Game' when you have used all your lives, choose 'Jump to Frame'.  Put in a frame that has some text saying 'Game Over'.  Add a score object on it, so you can see the final score.  Add an event for this frame 'On mouse click' and End the Game.

Extension 2: To make an explosion when the bullet hits

When the bullet hits the asteroid, we will set a counter to be 0.  Every second the value will count up by 1.  When it reaches 3, we will destroy the explosion.  (So the explosion will last 3 seconds before it is destroyed.)

Go to the Event Editor

For Bullet collides with Asteroid Event:

Create an explosion at (0,0) relative to asteroid
Set the alterable value A of asteroid to be 0  (This is the counter, set to 0)

Add in a new event: Every 1 second, increase the alterable value A of the asteroid by 1.
Add in a new event: Test if alterable value of A = 3, then destroy Explosion

 

Extension 3: To slow down shooting

To slow down shooting so the player has to wait 3 seconds before they can shoot again:

Set the alterable value of the space ship to 0 when it shoots.

Add in a new event: Every 1 second, add 1 to spaceship’s alterable value

Modify Upon pressing space bar event to add a new condition: If alterable value A of space ship > = 3


 

 


This page has been produced by Margaret Meijers.  Questions concerning its content may be directed by email to margaret.meijers@education.tas.gov.au.  This page was last modified on Tuesday, 05 September 2006. The URL for this page is http://www.mindtools.tased.edu.au/knp/space/space_game.htm .
This work is licensed under a Creative Commons Licence.
Some pages of this site have been developed with support from the SiMERR Project.