A
Artwark
Guest
Ok so I got enemies that spawn and will move towards a certain object. How do I make them spawn outside the room? I tried the following.....
I tried doing it so that it respawn from the minus of x2 and y2 but that's not working either. How to fix this?
Code:
if --comet == 0//if variable comet reaches 0
{
//if !instance_exists(obj_comet)
//instance_create(irandom_range(x+35,x+50),irandom_range(y+35,y+50),obj_comet);
//instance_create(irandom_range(x-sprite_width,x+sprite_width),irandom_range(y-sprite_height,y+sprite_height),obj_comet)
//instance_create(random(room_width-10),-20,obj_comet)
instance_create(irandom_range(room_width,-65),irandom_range(room_height,-120),obj_comet)
comet = 500;
}