G
Glo
Guest
Hey, guys,
What I'm trying to get done in the game I'm working on is having a set of health bars that are only visible when you click a button. The health bars don't actually represent health, though. They represent the number of enemies in the room, so the level ends when there are too many enemies.
My question is how to keep track of the number of enemies even when the health bar instance isn't created.
I was trying to do something like this
The thing is that Game Maker won't allow me to write if E_Coli+=2. How can I get the health to change whenever more enemies are made?
What I'm trying to get done in the game I'm working on is having a set of health bars that are only visible when you click a button. The health bars don't actually represent health, though. They represent the number of enemies in the room, so the level ends when there are too many enemies.
My question is how to keep track of the number of enemies even when the health bar instance isn't created.
I was trying to do something like this
Code:
//Enemy variable Create event
E_Coli+=2
Code:
//Health bar Step event
if
health=0
{
game_end()
}
if E_Coli+=2//This line is not functional
{
health+=2
}