OK rexrainbow, I looked into this thing some more. There is something that I can't understand, can you please have a look at this simple capx.
1. Open capx and run the game.
2. In the game, click the Continue button.
- it says "You lose, 4 enemies still alive"
3. Go back to Construct 2, on the event sheet there is a disabled action "system wait 0 seconds". Enable this action
4. Run the game again
5. Click Continue button
- this time it says "You win, all enemies destroyed"
This is what troubles me. The sprites should get destroyed before the function gets called, regardless of the wait 0 seconds.
The function call just counts the enemies and displays a message.
Can you help me figure this out? Why does the count return 0 with the wait, and 4 without the wait?