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.

Scripts<br />

an empty path.<br />

path_reverse(ind) Reverses the path.<br />

path_mirror(ind) Mirrors the path horizontally (<strong>with</strong> respect to its center).<br />

path_flip(ind) Flips the path vertically (<strong>with</strong> respect to its center).<br />

path_rotate(ind,angle) Rotates the path counter clockwise over angle<br />

degrees (around its center).<br />

path_scale(ind,xscale,yscale) Scales the path <strong>with</strong> the given factors<br />

(from its center).<br />

path_shift(ind,xshift,yshift) Shifts the path over the given amount.<br />

Scripts cannot be changed during the execution of the game. The scripts are part of the game<br />

logic. Changing scripts would lead to self-rewriting code which very easily leads to errors. Also<br />

there are other ways to achieve this. If you really need to execute a piece of code that is not<br />

known at design time (e.g. from a file) you can use the following functions:<br />

execute_string(str,arg0,arg1,...) Execute the piece of code in the<br />

string str <strong>with</strong> the indicated arguments.<br />

execute_file(fname,arg0,arg1,...) Execute the piece of code in the<br />

file <strong>with</strong> the indicated arguments.<br />

Sometimes you want to store a script index in a variable and execute it. For this you can use<br />

the following function<br />

script_execute(scr,arg0,arg1,...) Execute the script <strong>with</strong> index scr<br />

<strong>with</strong> the given arguments.<br />

Time lines<br />

The following routines are available for creating and changing time lines. Don't change time<br />

lines that are in use!<br />

timeline_add() Adds a new time line. It returns the index of the time line.<br />

timeline_delete(ind) Deletes the time line <strong>with</strong> the given index. Make<br />

sure no instances uses the time line in any room.<br />

timeline_moment_add(ind,step,codestr) Adds a code action to the<br />

time line at moment step. codestr contains the code for the actions. If the step

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

Saved successfully!

Ooh no, something went wrong!