okasion
Member
I have this code on the obj_boss and obj_bossGhost:
I have an obj_bossGhost which is the same as obj_boss except a fake copy with no collision events.
I need to count how mant obj_boss and obj_bossGhost I create, but if I use a variable on create of the object, it obviously resets every time it creates another itself, I have uploaded a video so you guys can see my problem:
This is the first thread I make asking for help, I only ask for help when I really don't know what to do anymore after hours of different methods. Sorry if missed something.
Thanks in advance.
Code:
CREATE:
//variables to move in loop
coordx = room_width/2;
coordy = room_height/2;
r = 100;
theta = 0;
theta_speed = 2;
boss_alpha = 1;
yukari_instances = 1;
Code:
STEP:
//circle movement
theta += theta_speed;
if (theta >= 360) theta -= 360;
x = coordx + lengthdir_x(r, theta);
y = coordy + lengthdir_y(r, theta);
//ghosting
//FROM HERE ONLY ON obj_boss, obj_bossGhost does NOT CREATE COPIES
if (image_alpha != 0){
image_alpha = clamp(image_alpha - 0.01, 0, 1);
}
if (image_alpha = 0)
{
instance_destroy();
if (yukari_instances < 4){
instance_create_layer(x + random_range(50,50),y + random_range(50,50),"Instances",obj_boss);
instance_create_layer(x + random_range(50,50),y + random_range(50,50),"Instances",obj_bossGhost);
yukari_instances++;
}
//image_alpha = clamp(image_alpha + 0.01, 0, 1);
}
I need to count how mant obj_boss and obj_bossGhost I create, but if I use a variable on create of the object, it obviously resets every time it creates another itself, I have uploaded a video so you guys can see my problem:
This is the first thread I make asking for help, I only ask for help when I really don't know what to do anymore after hours of different methods. Sorry if missed something.
Thanks in advance.