Game Development Reference
In-Depth Information
if( place_meeting( x+6, y+5, obj_dragon )
!
= true ) ( NOT option checked)
21. Include a Test Chance action with Sides of 150 .
if( irandom_range( 1, 150 ) == 1 )
22. Include a Wrap Screen action that sets Direction to horizontal .
move_wrap( true, false, sprite_width/2 );
( Direction to horizontal )
move_wrap(
false
,
true
,
sprite_height
/2 );
( Direction to vertical )
move_wrap(
true
,
true
, sprite_width/2 );
( Direction to both )
Note The move_wrap function does not provide identical results to the Wrap Screen action in all
situations, but the code preceding will provide comparable results providing the origins of your sprites are
centered.
23. Include a Draw Sprite action that draws the Sprite spr_dragon at X = 66 , Y = 55 , with a
Subimage of 3 .
draw_sprite( spr_dragon, 3, 66, 55 );
(standard)
55 ); ( Relative option checked)
24. Include a Create Instance action that creates an instance of the Object obj_dragon at
X = 66 , Y = 55 .
instance_create( 66, 55, obj_dragon );
draw_sprite( spr_dragon, 3,
x+
66,
y+
(standard)
55, obj_dragon ); ( Relative option checked)
25. Include a Create Moving action that creates an instance of the Object obj_dragon at
X = 66 , Y = 55 , with a Speed of 3 and Direction of 270 .
var instance;
instance = instance_create( 66, 55, obj_dragon );
instance.speed = 3;
instance.direction = 270;
instance_create(
x+
66,
y+
 
Search WWH ::




Custom Search