A splash screen is typically shown when a game starts. It is a great time to show off your logo and set up variables needed for the game. This room is an ideal place to load any saved game data, such as highscores.
If you look at Figure 15-1, you’ll see a house symbol next to room_splash. This tells you which room will be the first to run when the game is started.
Go ahead and create these rooms as shown in the Figure 15-1.
Splash Screen Example
This sets some initial variables for this example.
Place one instance of this object in room_splash and test.
Basic Projects
- A)
Set up so a sprite animates to its last frame, set an alarm for five seconds that then goes to a new room.
- B)
Set a menu room and three buttons that can take a player to two levels and an info room, return to the menu when the player presses spacebar. Make the buttons change color when mouse hovers over them.
Advanced Project
- C)
Make five buttons that become unlocked based on the player’s level. Use different subimages to graphically show this. Allow keys 1 through 5 to set current level.
Useful Functions
Summary
You should now understand the importance of setting up global variables at game start so you can access them later within your game.