I've been going mad trying to work this out. I've searched all over and cannot find the right way. Some instances come close but are still not fitting for what I want.
In my game, fires can occur and they can spread to other objects. When a fire is created it is assigned a special ID in the form of an instant variable to identify that exact fire, when it spreads to other objects those fires will also carry the same ID as the initially created one so the game knows that it is the same fire just spread to another object. So in my game it is possible to have two different fires with two different IDs so the game can differentiate two different scenarios.
What I'm trying to do is when a fire burns out (gets destroyed) and there are no other fires of that ID instance variable anymore, the game will update the player with that information.
I know I can do
- HUD icon for fire is on screen.
- Pick HUD icon by comparison (with the same ID instance variable associated with the fire)
- HUD icon is HappeningNow (boolean)
- Change HappeningNow boolean to false (which initiates other actions that tell the player the fire is not happening anymore).
This works for every fire of that same ID so even if one of the fires of the same ID gets destroyed, and other fires with the same ID are still present, it will update the HUD icon. I just need to see how I can tell construct 2 that if the last fire with that ID instance variable is destroyed to initiate the action instead. I can't seem to get it right.
Help much appreciated, thanks all in advance!