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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16 = Push from top<br />

17 = Push from bottom<br />

18 = Rotate to the left<br />

19 = Rotate to the right<br />

20 = Blend the rooms<br />

21 = Fade out and in<br />

transition_steps Indicates the number of steps in the transition. The more<br />

steps, the longer the transition takes. Default is 80.<br />

transition_define(kind,name) You can actually create your own<br />

transitions. To this end you must define a script (possibly in an extension<br />

package) to do the transition. With this function you can then add the<br />

transition to the system. kind is the index of the transition (either a new one<br />

or an existing transitions). name is the name of the script. Note that the name<br />

of the script is a string! So there must be quotes around it. Note that this is<br />

really advanced stuff. The script must take five arguments: a surface <strong>with</strong> the<br />

image of the previous room, a surface <strong>with</strong> the image of the next room, the<br />

width of the surfaces, the height of the surfaces, and the fraction of the<br />

transition (between 0 and 1). It must then draw the image using the two<br />

surfaces.<br />

transition_exists(kind) This function returns whether a transition of the<br />

indicated kind exists.<br />

Please note that transitions do not work when using using 3d graphics. Also, room transitions<br />

in general do not work correctly when the sizes of the rooms (or to be more precise of the<br />

region on the screen) are not the same.<br />

Score<br />

Other important aspects of many games are the score, the health, and the number of lives.<br />

<strong>Game</strong> <strong>Maker</strong> keeps track of the score in a global variable score and the number of lives in<br />

a global variable lives. You can change the score by simply changing the value of this variable.<br />

The same applies to health and lives. If lives is larger than 0 and becomes smaller than or<br />

equal to 0 the no-more-lives event is performed for all instances. If you don't want to show<br />

the score and lives in the caption, set the variable show_score, etc., to false. Also you can<br />

change the caption. For more complicated games best display the score yourself.

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

Saved successfully!

Ooh no, something went wrong!