What can i do to make it create an arrow every 2 seconds?
i´ve got this step event:
[codebox]if distance_to_object(obj_playerb)<300{
instance_create(obj_orcarch.x,obj_orcarch.y,orcarr
ow)
}[/codebox]
Edited by Eistee21, 12 February 2009 - 07:04 PM.
Posted 12 February 2009 - 04:51 PM
Edited by Eistee21, 12 February 2009 - 07:04 PM.
Posted 12 February 2009 - 05:02 PM
if distance_to_object(obj_playerb)<300 && alarm[0]<=0
{instance_create(obj_orcarch.x,obj_orcarch.y,orcarrow)
alarm[0]=room_speed*2;}And then create an alarm0 event and put a random comment in it (whatever you want).
Edited by dmsuper, 12 February 2009 - 05:04 PM.
Posted 12 February 2009 - 05:03 PM
if distance_to_object(obj_playerb)<300
{
instance_create(obj_orcarch.x,obj_orcarch.y,orcarrow)
}Edited by Pregnant_Cow, 12 February 2009 - 05:06 PM.
Posted 12 February 2009 - 05:07 PM
Edited by Eistee21, 12 February 2009 - 05:09 PM.
Posted 12 February 2009 - 05:09 PM
can_attack = true
if can_attack = true
{
if distance_to_object(obj_playerb)<300
{
instance_create(obj_orcarch.x,obj_orcarch.y,orcarrow)
can_attack = false
alarm[0] = room_speed*2;
}
}can_attack = true
Edited by Kyon, 12 February 2009 - 05:10 PM.
Posted 12 February 2009 - 05:24 PM
Posted 12 February 2009 - 05:25 PM
Posted 12 February 2009 - 05:42 PM
Posted 12 February 2009 - 06:06 PM
image_angle=direction
if (place_free(x, y + 1))
{
gravity = 0.4;
}
else
{
gravity = 0;
}
vspeed = min(12, vspeed);if can_attack = true
{
if distance_to_object(obj_playerb) < 300
{
var shoot;
shoot=instance_create(x,y,obj_arrow);
shoot.direction=point_direction(x,y,obj_playerb.x,obj_playerb-20.y);
shoot.speed=15
can_attack = false
alarm[0] = room_speed*2
}
}Posted 12 February 2009 - 06:14 PM
Posted 12 February 2009 - 06:50 PM
if I start the game now this error appears:
FATAL ERROR inaction number 1of Step Eventfor object obj_orcarch:COMPILATION ERROR in code actionError in code at line 7: shoot.direction=point_direction(x,y,obj_playerb.x,obj_playerb-20.y);at position 67: Symbol , or ) expected.
Edited by Kyon, 12 February 2009 - 06:50 PM.
Posted 12 February 2009 - 07:03 PM
0 members, 0 guests, 0 anonymous users