08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• <strong>Game</strong> end: The event happens to all instances when the game ends. Again typically<br />

just one object defines this event. It is for example used to store certain data in a file.<br />

• Room start: This event happens for all instances initially in a room when the room<br />

starts. It happens after the creation events.<br />

• Room end: This event happens to all existing instances when the room ends.<br />

• No more lives: <strong>Game</strong> <strong>Maker</strong> has a built-in lives system. There is an action to set and<br />

change the number of lives. Whenever the number of lives becomes less than or equal<br />

to 0, this event happens. It is typically used to end or restart the game.<br />

• No more health: <strong>Game</strong> <strong>Maker</strong> has a built-in health system. There is an action to set<br />

and change the health. Whenever the health becomes less than or equal to 0, this<br />

event happens. It is typically used to reduce the number of lives or to restart the<br />

game.<br />

• End of animation: As indicated above, an animation consists of a number of images<br />

that are shown one after the other. After the last one is shown we start again <strong>with</strong> the<br />

first one. The event happens at precisely that moment. As an example, this can be<br />

used to change the animation, or destroy the instance.<br />

• End of path: This event happens when the instance follows a path and the end of the<br />

path is reached.<br />

• Close button: This event happens when the user clicks on the close button of the<br />

window. This only happens when disabling in the game settings the option to have the<br />

close button behave as the Escape key.<br />

• User defined: There are 16 of these events. They normally never happen unless you<br />

yourself call them from a piece of code.<br />

Drawing event<br />

Instances, when visible, draw their sprite in each step on the screen. When you specify actions<br />

in the drawing event, the sprite is not drawn, but these actions are executed instead. This can<br />

be used to draw something other than the sprite, or first make some changes to sprite<br />

parameters. There are a number of drawing actions that are especially meant for use in the<br />

drawing event. Note that the drawing event is only executed when the object is visible. Also<br />

note that, independent of what you draw, collision events are based on the sprite that is<br />

associated <strong>with</strong> the instance.<br />

Key press events<br />

This event is similar to the keyboard event but it happens only once when the key is pressed,<br />

rather than continuously. This is useful when you want an action to happen only once.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!