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.

Paths<br />

move_bounce_all(adv) Bounces against all instances, instead of just the<br />

solid ones.<br />

move_contact_solid(dir,maxdist) Moves the instance in the direction<br />

until a contact position <strong>with</strong> a solid object is reached. If there is no collision at<br />

the current position, the instance is placed just before a collision occurs. If<br />

there already is a collision the instance is not moved. You can specify the<br />

maximal distance to move (use a negative number for an arbitrary distance).<br />

move_contact_all(dir,maxdist) Same as the previous function but this<br />

time you stop at a contact <strong>with</strong> any object, not just solid objects.<br />

move_outside_solid(dir,maxdist) Moves the instance in the direction<br />

until it no longer lies <strong>with</strong>in a solid object. If there is no collision at the current<br />

position the instance is not moved. You can specify the maximal distance to<br />

move (use a negative number for an arbitrary distance).<br />

move_outside_all(dir,maxdist) Same as the previous function but this<br />

time you move until outside any object, not just solid objects.<br />

distance_to_point(x,y) Returns the distance of the bounding box of the<br />

current instance to (x,y).<br />

distance_to_object(obj) Returns the distance of the instance to the<br />

nearest instance of object obj.<br />

position_empty(x,y) Returns whether there is nothing at position (x,y).<br />

position_meeting(x,y,obj) Returns whether at position (x,y) there is an<br />

instance obj. obj can be an object, an instance id, or the keywords self,<br />

other, or all.<br />

In <strong>Game</strong> <strong>Maker</strong> you can define paths and order instances to follow such paths. Although you<br />

can use actions for this, there are functions and variables that give you more flexibility:<br />

path_start(path,speed,endaction,absolute) Starts a path for the<br />

current instance. The path is the name of the path you want to start. The<br />

speed is the speed <strong>with</strong> which the path must be followed. A negative speed<br />

means that the instance moves backwards along the path. The endaction<br />

indicates what should happen when the end of the path is reached. The<br />

following values can be used:

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

Saved successfully!

Ooh no, something went wrong!