evildead9000
Member
This is my object spawner, which I'm currently testing with to help me understand controlling objects better.
However, when I run it all the objects are behaving exactly the same. I've also tried it using the "with" constructor as follows:
Shouldn't each inst_1 get a speed of 1 or 9 and an image angle that is either -10 or +10? I've read through a few articles and I think it should work! Please help me understand why it's not working.
Code:
if alarm[0]==-1
{
var inst_1
inst_1 = instance_create_layer(irandom_range(200,1910), 200, layer, obj_Enemy_1);
inst_1.speed = choose(1,9);
inst_1.image_angle = choose(-10,+10);
alarm[0] = room_speed * 1
}
Code:
if alarm[0]==-1
{
var inst_1
inst_1 = instance_create_layer(irandom_range(200,1910), 200, layer, obj_Enemy_1);
with inst_1
{
speed = choose(1,9);
image_angle = choose(-10,+10);
}
alarm[0] = room_speed * 1
}