Platform Game
5 Spikes & Fire

Section Menu

Platform Game Home | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Platform games usually have items which cause the player to lose a life or lose health. In our game, hitting a spike or fire will lose you some health and send you back to the start of the level.

Graphics & Sound

Save these to your user space before using them.

The Fire

Start by making a sprite called spr_fire and load the fire graphic.

Game Maker Screenshot

Create an object using this sprite and call it, obj_fire.

Game Maker Screenshot

The fire graphic is animated so that the flames flicker. If you place 2 of these graphics next to each other they will flicker at exactly the same time. That looks a bit odd. You can sort this out by starting the animations at a random point. Do this by adding a Create Event to the fire object and dragging in a Change Sprite action. Fill the pop-up in as shown below,

Game Maker Screenshot

Now add a sound called snd_uhh, importing the sound file you saved earlier.

Game Maker Screenshot

Go to the obj_character object window and add a Collision Event with the fire object. We will need the following actions for this event,

  • Reduce the health by 25%
  • Set the horizontal speed to 0
  • Set the vertical speed to 0
  • Move the character back to the start
  • Play the uhh sound

The following screenshots show how these actions have been made,

Game Maker Screenshot
Game Maker Screenshot Game Maker Screenshot
Game Maker Screenshot Game Maker Screenshot

Add some of the fire object to the room in a little fire pit somewhere and test that the game works as expected.

The Spikes

The spikes should work in exactly the same way as the fire. Using the example of how you made the fire, add sprites and objects to the game for the spikes.

This is a good opportunity to work out any other non-moving obstacles for the game. Search for and download some royalty-free graphics from the WWW, the network or from some of your previous games to use in the game.

⇐ Previous | Next ⇒