The end
The end
Ending the game
Each time the player collides with a tree or a rock one life is subtracted from the number of lives and the game is restarted. We need to end the game when the number of lives reaches 0. This simple event achieves the task.
- Number of lives of (Player 1) reaches 0
: Next frame
Conclusion
You can now launch the game and play it. Notice that the difficulty level increases with the time. To complete the game, you can :
- Create a title screen. You will find a title image ready to be used in the library. Just insert a new frame before the game frame, drop this object, and test for a key (or mouse) press to jump to the next frame.
- Create a hi-score screen. You will also find a hi-score background image ready to be used. Create a frame after the game frame, drop this image and drop a new hi-score object. Detect a key (or mouse) press to quit this frame.
There are many ways to improve this game :
- Add new obstacles : you will find a number of them in the library
- Make another snowboarder come in the game, just to annoy the player
- Vary the difficulty level depending on the score, or position of the player
- Add musics and sound effects
Thank you for following this tutorial. It has shown you how to control the movement of an object directly from the keyboard with events, how to create objects and position them randomly, how to handle complex collision detection, how to create a scrolling game by moving only the objects and more.
Graphics by Oliver Pearl
Spread the word!
You can share this document using the following buttons.