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.

peferably only for small pieces of code. For longer pieces you are strongly advised to use<br />

scripts which are described in part 2 of the documentation.<br />

Comment<br />

Use this action to add a line of comment to the action list. The line is shown in italic font.<br />

Adding comments helps you remember what your events are doing. The action does not do<br />

anything. But realize that it still is an action. So when you place it after a conditional action it<br />

is the action that is executed if the condition is true (even though it does not do anything).<br />

Set Variable<br />

There are many built-in variables in the game. With this action you can change these. Also<br />

you can create your own variables and assign values to them. You specify the name of the<br />

variable and the new value. When you check the Relative box, the value is added to the<br />

current value of the variable. Please note that this can only be done if the variable already has<br />

a value assigned to it! See below for more information about variables.<br />

Test Variable<br />

With this action you can check what the value of a particular variable is. If the value of the<br />

variable is equal to the number provided, the question returns true. Otherwise it returns false.<br />

You can also indicate that the check should be whether the value is smaller than the given<br />

value or larger than the given value. See below for more information about variables. Actually,<br />

you can use this action also to compare two expressions.<br />

Draw Variable<br />

With this action you can draw the value of a variable at a particular position on the screen.<br />

Note that this can only be used in the draw event of an object.<br />

Score actions<br />

In most games the player will have a certain score. Also many games give the player a<br />

number of lives. Finally, often the player has a certain health. The following actions make it<br />

easy to deal <strong>with</strong> the score, lives, and health of the player.<br />

Set Score<br />

<strong>Game</strong> <strong>Maker</strong> has a built-in score mechanism. The score is normally displayed in the window<br />

caption. You can use this action to change the score. You simply provide the new value for the

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

Saved successfully!

Ooh no, something went wrong!