N
NeoIdea
Guest
Hey all!
So I have a few different spawning objects.
I would like to set a certain vspeed/hspeed for the instances created by the each of spawning objects.
For example an instance created with obj_spawner_a would have a vspeed of 1, but if that same object was instanced through obj_spawner_b, it would then have a speed of -1.
Here's what I have in alarm[0] for obj_spawner_a;
if instance_exists(obj_player){
instance_create(view_xview+random(view_wview),obj_player.y-450,obj_fast_asteroid);
alarm[0] = random(500);
}
So my question is, is there a simple/straight forward way of doing this from within the code I have in the alarm of the spawner_obj?
I figure I could go into the create event of each object and have something to the effect of;
if spawned through obj_spawner_a then vspeed = 1
if spawned through obj_spawner_b then vspeed = -1 and so forth.
Well, other than creating a variable... Is there a more obvious way I should know about?
Thanks you!
So I have a few different spawning objects.
I would like to set a certain vspeed/hspeed for the instances created by the each of spawning objects.
For example an instance created with obj_spawner_a would have a vspeed of 1, but if that same object was instanced through obj_spawner_b, it would then have a speed of -1.
Here's what I have in alarm[0] for obj_spawner_a;
if instance_exists(obj_player){
instance_create(view_xview+random(view_wview),obj_player.y-450,obj_fast_asteroid);
alarm[0] = random(500);
}
So my question is, is there a simple/straight forward way of doing this from within the code I have in the alarm of the spawner_obj?
I figure I could go into the create event of each object and have something to the effect of;
if spawned through obj_spawner_a then vspeed = 1
if spawned through obj_spawner_b then vspeed = -1 and so forth.
Well, other than creating a variable... Is there a more obvious way I should know about?
Thanks you!