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.

As you should know, every instance has 12 different alarm clocks that you can set. To change<br />

the values (or get the values) of the different alarm clocks use the following variable:<br />

alarm[0..11] Value of the indicated alarm clock. (Note that alarm clocks<br />

only get updated when the alarm event for the object contains actions!)<br />

We have seen that for complex timing issues you can use the time line resource. Each<br />

instance can have a time line resource associated <strong>with</strong> it. The following variables deal <strong>with</strong><br />

this:<br />

Rooms<br />

timeline_index Index of the time line associated <strong>with</strong> the instance. You can<br />

set this to a particular time line to use that one. Set it to -1 to stop using a<br />

time line for the instance.<br />

timeline_position Current position <strong>with</strong>in the time line. You can change<br />

this to skip certain parts or to repeat parts.<br />

timeline_speed Normally, in each step the position in the time line is<br />

increased by 1. You can change this amount by setting this variable to a<br />

different value. You can use real numbers like 0.5. If the value is larger than<br />

one, several moments can happen <strong>with</strong>in the same time step. They will all be<br />

performed in the correct order, so no actions will be skipped.<br />

<strong><strong>Game</strong>s</strong> work in rooms. Each room has an index that is indicated by the name of the room. The<br />

current room is stored in variable room. You cannot assume that rooms are numbered in a<br />

consecutive order. So never add or subtract a number from the room variable. Instead use the<br />

functions and variables indicated below. So a typical piece of code you will use is:<br />

{<br />

if (room != room_last)<br />

{<br />

}<br />

room_goto_next();<br />

else<br />

{<br />

game_end();

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

Saved successfully!

Ooh no, something went wrong!