M
Mosaknows
Guest
Hey, Recently I've been working on my own boss A.I., but I've encountered an annoying problem.
Whenever I try to use the function "instance_create_depth" on my bot, on the first frame the instance that it creates spawns in the wrong coordinates which makes it look bad. I've tried many things to fix this, but no luck.
2 examples of some code
and
Whenever I try to use the function "instance_create_depth" on my bot, on the first frame the instance that it creates spawns in the wrong coordinates which makes it look bad. I've tried many things to fix this, but no luck.
2 examples of some code
Code:
if (time >= 12 and time <= 13) && (cooldown < 1)
{
instance_create_depth(x - 50 ,y,1,Obj_rocket)
cooldown = 20;
}
if (time >= 16 and time <= 17) && (cooldown < 1)
{
instance_create_depth(x + 50 ,y,1,Obj_rocket)
cooldown = 20;
}
//Code by Mosaknows
GMS 2.1.5
and
Code:
if (x <= 960)
{
s = instance_create_depth(x + 50 ,y,1,Obj_lazer);
s.direction = 0;
s.speed = spd;
s = instance_create_depth(x + 50,y + 50,2,Obj_lazer);
s.direction = 315;
s.speed = spd;
s = instance_create_depth(x,y + 50,3,Obj_lazer);
s.direction = 270;
s.speed = spd;
}
//Code by Mosaknows
GMS 2.1.5
Last edited by a moderator: