Seryal
Member
I'm trying to assign some IDs to instances to refer to them later. Somethings not right and I may just be tired. I'll try to post just the relevant code only. I don't know why I struggle so much with assigning IDs to instances.
In the Object: "Menu" Create:
In the Object: "Bullet" Collision Event with Object: "Border":
In the Object: "Border" Step:
In the Object: "Menu" Create:
GML:
newgame = instance_create_layer(x-hb, y-vb, "Instances", oBorder);
newgame = id;
exitgame = instance_create_layer(x-hb, y+pad-vb, "Instances", oBorder);
exitgame = id;
GML:
with (other) {
if (id == newgame) {
id.dmg = id.dmg + 15;
}
if (id == exitgame) {
id.dmg = id.dmg + 10;
}
}
instance_destroy();
GML:
if (dmg >= 250) && id == newgame {
startGame();
instance_create_layer(x, y, "Instances", oCountdown);
with (oMenu) instance_destroy();
with (oBorder) instance_destroy();
} else if (dmg >= 250 && id == exitgame) {
game_end();
}