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.

Here you select the event you want to add. Sometimes a menu pops up <strong>with</strong> extra choices.<br />

Here is a description of the various events. (Again remember that you normally use only a few<br />

of them.)<br />

Create event<br />

This event happens when an instance of the object is created. It is normally used to set the<br />

instance in motion and/or to set certain variables for the instance.<br />

Destroy event<br />

This event happens when the instance is destroyed. To be precise, it happens just before it is<br />

destroyed, so the instance does still exist when the event is executed! Most of the time this<br />

event is not used but you can for example use it to change the score or to create some other<br />

object.<br />

Alarm events<br />

Each instance has 12 alarm clocks. You can set these alarm clocks using certain actions (see<br />

next chapter). The alarm clock then ticks down until it reaches 0 at which moment the alarm<br />

event is generated. To indicate the actions for a given alarm clock, you first need to select it in<br />

the menu. Alarm clocks are very useful. You can use them to let certain things happen from<br />

time to time. For example a monster can change its direction of motion every 20 steps. (In<br />

such cases one of the actions in the event must set the alarm clock again.)<br />

Step events<br />

The step event happens every step of the game. Here you can put actions that need to be<br />

executed continuously. For example, if one object should follow another, here you can adapt<br />

the direction of motion towards the object we are following. Be careful <strong>with</strong> this event though.<br />

Don't put many complicated actions in the step event of objects of which there are many<br />

instances. This might slow the game down. To be more precise, there are three different step<br />

events. Normally you only need the default one. But using the menu you can also select the<br />

begin step event and the end step event. The begin step event is executed at the beginning of<br />

each step, before any other events take place. The normal step event is executed just before

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

Saved successfully!

Ooh no, something went wrong!