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.

Create Effect<br />

With this action you can create all sorts of effects in a very simple way. You specify the type of<br />

effect, e.g. an explosion or smoke, its position, its size and its color and whether it should be<br />

shown below the objects or on top of them. For the rest it works automatic. (For rain and<br />

snow the position is irrelevant as it always falls down from the top of the screen. To get<br />

continuous rain you should create it in each step.) This action is only available in the Pro<br />

Edition.<br />

Using expressions and variables<br />

In many actions you need to provide values for parameters. Rather than just typing a number,<br />

you can also type a formula, e.g. 32*12. But you can actually type much more complicated<br />

expressions. For example, if you want to double the horizontal speed, you could set it to<br />

2*hspeed. Here hspeed is a variable indicating the current horizontal speed of the instance.<br />

There are a large number of other variables that you can use. Some of the most important<br />

ones are:<br />

x the x-coordinate of the instance<br />

y the y-coordinate of the instance<br />

hspeed the horizontal speed (in pixels per step)<br />

vspeed the vertical speed (in pixels per step)<br />

direction the current direction of motion in degrees (0-360)<br />

speed the current speed in this direction<br />

visible whether the object is visible (1) or invisible (0)<br />

image_index this variable indicate which subimage in the current sprite is<br />

currently shown. If you change it and set the speed to 0 (see below) you can<br />

display a fixed subimage.<br />

image_speed this variable indicates the speed <strong>with</strong> which the subimages are<br />

shown. The default value is 1. If you make this value larger than 1 some<br />

subimages are skipped to make the animation faster. If you make it smaller<br />

than 1 the animation becomes slower by repeating subimages.<br />

score the current value of the score<br />

lives the current number of lives<br />

health the current health (0-100)<br />

mouse_x x-position of the mouse<br />

mouse_y y-position of the mouse

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

Saved successfully!

Ooh no, something went wrong!