How do i set a condition that will set the end of the game?
wroachbarrette
Member Posts: 101
I need to set a condition so that when all the actors of a cretin tag are destroyed that it will move to another sean can you tell me how to do this
Comments
#1 (probably not the best...)
Add an actor that covers the entire screen area. Turn off the visible attribute and move it to the back of the scene/layer. Add a rule that checks for collision/overlap with actors with the tag you mentioned. In the 'otherwise' section of this rule add the logic for the scene change.
#2
Create a global integer attribute (I'll call it `EnemyCount`). In each of your enemy actors, add a logic that increments EnemyCount.
`Change Attribute: EnemyCount to EnemyCount+1`
In the logic that destroys the enemy actor, add another `Change Attribute` that decrements EnemyCount, `EnemyCount -1`
In another actor that is always in the scene (a lot of people have a dedicated "scene control" actor), add logic that checks for `EnemyCount=0`. That would trigger the scene change. You may want to delay this logic with an "after" timer, that would give the increment logic time to build `EnemyCount` above 0.