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.

the keys pressed happen. Note that the keys on the numeric keypad only produce the<br />

corresponding events when is pressed.<br />

Mouse events<br />

A mouse event happens for an instance whenever the mouse cursor lies inside the sprite<br />

representing the instance. Depending on which mouse buttons are pressed you get the no<br />

button, left button, right button, or middle button event. The mouse button events are<br />

generated in each step as long as the player keeps the mouse button pressed. The press<br />

events are only generated once when the button is pressed. The release events are only<br />

generated when the button is released. Note that these events only occur when the mouse is<br />

above the instance. If you want to react to mouse press or release events at an arbitrary<br />

place, use the global mouse events that can be found in a submenu. There are two special<br />

mouse events. The mouse enter event happens when the mouse enters the instance. The<br />

mouse leave event happens when the mouse leaves the instance. These events are typically<br />

used to change the image or play some sound. Mouse wheel up and mouse wheel down events<br />

happen when the user moves the mouse wheel. Finally there are a number of events related<br />

to the joystick. You can indicate actions for the four main directions of the joystick (in a<br />

diagonal direction both events happen). Also you can define actions for up to 8 joystick<br />

buttons. You can do this both for the primary joystick and the secondary joystick.<br />

Other events<br />

There are a number of other events that can be useful in certain games. They are found in this<br />

menu. The following events can be found here:<br />

• Outside: This event happens when the instance lies completely outside the room. This<br />

is typically a good moment to destroy it.<br />

• Boundary: This event happens when the instance intersects the boundary of the<br />

room, that is, it lies (at least) partially outside the room.<br />

• Views: Here you find a number of events that are useful when you use views in your<br />

rooms. These events test whether the instance lies completely outside a particular<br />

view or interesects the view boundary.<br />

• <strong>Game</strong> start: This event happens for all instances in the first room when the game<br />

starts. It happens before the room start event (see below) but after the creation<br />

events for the instances in the room. This event is typically defined in only one<br />

"controller" object and is used to start some background music and to initialize some<br />

variables, or load some data.

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

Saved successfully!

Ooh no, something went wrong!