DD Icons To GML
DD Icons To GML
1
Coding, Sprites © Mark Overmars, http://www.gamemaker.nl/
Prepared by D. Eugene Perry, http://www.blackratstudios.com/
Table of Contents
NOTES:........................................................................................... 2
Reference Colours........................................................................................................... 2
Assigning statements to other objects............................................................................. 2
TABS:.............................................................................................. 3
Move Tab ........................................................................................................................ 3
Move section............................................................................................................... 3
Jump Section............................................................................................................... 3
Paths Section............................................................................................................... 4
Steps Section............................................................................................................... 5
Main1 Tab....................................................................................................................... 5
Objects Section ........................................................................................................... 5
Sprite Section .............................................................................................................. 6
Sounds Section............................................................................................................ 6
Rooms Section ............................................................................................................ 7
Main 2 tab ....................................................................................................................... 8
Timing Section............................................................................................................ 8
Info Section................................................................................................................. 8
Game Section .............................................................................................................. 8
Resourses Section ....................................................................................................... 9
Control tab .................................................................................................................... 10
Questions Section...................................................................................................... 10
Other Section ............................................................................................................ 11
Code Section ............................................................................................................. 12
Variables Section ...................................................................................................... 12
Score tab........................................................................................................................ 13
Score Section ............................................................................................................ 13
Lives Section............................................................................................................. 13
Health Section........................................................................................................... 14
Extra tab ........................................................................................................................ 15
Particles Section........................................................................................................ 15
CD Section ................................................................................................................ 16
Other Section ............................................................................................................ 17
Drawing tab................................................................................................................... 17
Drawing Section........................................................................................................ 17
Settings Section......................................................................................................... 18
Other Section ............................................................................................................ 19
Thanks to the Following ............................................................... 20
1
NOTES:
Reference Colours
These are the colours that are used on the following pages and what they
mean…
Green - Comments
Purple – User input
Blue – Built in Variables or statements.
2
TABS:
Move Tab
Move section
Jump Section
3
'Jump to the start position'
x=xstart; //actual code.
y=ystart; //actual code.
'Snap to a grid'
move_snap(hsnap,vsnap);
Paths Section
4
'Set the speed for the path'
path_speed=value; //pixels per step.
Steps Section
Main1 Tab
Objects Section
5
'Destroy instance at position'
position_destroy(x,y);
Sprite Section
Sounds Section
'Play a sound'
sound_play(sound); //plays sound once.
sound_loop(sound); //loops sound.
'Stop a sound'
sound_stop(index); //Stops the indicates sound. If there are multiple sounds with
this index playing simultaneously, all will be stopped.
6
Rooms Section
//If you wish to use transitions with the following statements call this statement
first…
transition kind=value;
0 = no effect
1 = Create from left
2 = Create from right
3 = Create from top
4 = Create from bottom
5 = Create from center
6 = Shift from left
7 = Shift from right
8 = Shift from top
9 = Shift from bottom
10 = Interlaced from left
11 = Interlaced from right
12 = Interlaced from top
13 = Interlaced from bottom
7
'If next room exists'
if room_next(room)<>-1 then {
// actions here.
}
//'room' is constant variable for current room. Actual code.
Main 2 tab
Timing Section
'Set an alarm'
alarm[0]=value; //set 0 from 0 to 7 for alarm.
'Set a timeline'
timeline_index=timeline;
Info Section
'Display a message'
show_message('Hello');
'Show a video'
show_video(fname,full,loop); //full and loop are either 1 or 0 for yes or no.
Game Section
8
'End the game'
game_end();
Resourses Section
9
Control tab
Questions Section
10
'If the user answers yes to a question'
if show_question('Do you want to do this?') {
// actions here.
}
Other Section
'Start of block'
'End of block'
'Else'
//All above are part of if, else statements example...
if x=50 {
hspeed=2;
vspeed=-2;
}
else {
motion_set(90,1);
}
11
'Call the inhereted event'
event_inherited();
Code Section
'Call a script'
script_execute(ind,arguments);
// or call a script in code by the script name and the arguments in () beside it…
Variables Section
'Set a variable'
// Set a variable by either using a built-in variable or by using your own.
example...
health=50;
lives=3;
name='Gordon';
//Use 'global.' for your own variables that are to be used by more than one
object...
global.name='Gordon';
//You do not need to use global for built-in variables like 'lives', or 'score'.
12
Score tab
Score Section
Lives Section
13
'Draw the number of lives'
draw_text(x,y,'Lives: ' + string(lives));
Health Section
14
Extra tab
Particles Section
'Create a particle'
index=part_type_create(); //Assign to an index.
part_type_shape(index,shape); //see manual for shape types.
part_type_size(index,size_min,size_max,size_incr,size_rand);
part_type_color(index,color_start,color_middle,color_end);
//there are other functions forparticles; these just cover the Drag and Drop.
15
'Set the life time for the particle'
part_type_life(index,life_min,life_max);
'Destroy an emitter'
part_emitter_destroy_all(ps) //ps is the index of the emitter.
CD Section
//You must call the funtion cd_init(); before calling other Cd functions.
'Play a CD'
cd_play(first,last);
16
'Pause the CD'
cd_pause();
Other Section
Drawing tab
Drawing Section
'Draw a sprite'
draw_sprite(sprite,subimage,x,y);
17
'Draw a text'
draw_text(x,y,string);
'Draw a rectangle'
draw_rectangle(x1,y1,x2,y2,outline); //Outline is 1 or 0 for yes or no.
'Draw an ellipse'
draw_ellipse(x1,y1,x2,y2,outline); //outline is 1 or 0 for yes or no.
'Draw a line'
draw_line(x1,y1,x2,y2);
'Draw an arrow'
draw_arrow(x1,y1,x2,y2,size); //size is in pixels.
Settings Section
18
'Set the font'
draw_set_font(font);
draw_set_halign(halign); //Can be set to fa_left, fa_center, fa_right.
draw_set_valign(valign); //Can be set to fa_top, fa_middle, fa_bottom.
Other Section
Create an effect
effect_create_below(kind,x,y,size,color) //Creates an effect of the given kind (see
above) at the indicated position. size give the size as follows: 0 = small, 1 =
medium, 2 = large. color indicates the color to be used. The effect is created
below the instances, that is, at a depth of 100000.
effect_create_above(kind,x,y,size,color) //Similar to the previous function but this
time the effect is created on top of the instances, that is, at a depth of -100000.
ef_explosion
ef_ring
ef_ellipse
ef_firework
ef_smoke
ef_smokeup
ef_star
ef_spark
ef_flare
ef_cloud
ef_rain
ef_snow
19
Thanks to the Following
And many thanks to everyone who PM’d fixing my many grevious errors. I wish I
had remembered to jot down all your names but I rarely think ahead like that
(shoot). But you know who you are so….thanks!
20