• Posts: 27
i need help, i want change scene when all enemies are destroied, as you can see in the game ODD DUCKS
please help me


  • Posts: 92
create a number attribute and set it when the scene is created to the number of enemies in the scene. After that you can decrement by 1 everytime an enemy gets killed, then use an IF block to end the scene when enemies=zero. hope this helps.

« Last Edit: April 16, 2012, 06:42:46 am by Derelikt »


  • Posts: 27
can you see me with a image, for me is a first time use Stencyl...sorry but is my english sucks


  • Posts: 90
If your enemies are actors, try out this code (please note that it only works if you start off the scene with at least one actor already created else it will start off true :P). If not, can adjust the loop (it's in Scene -> Actors) to your needs. The "Count" is simply a number attribute I created.
If you need help, feel free to stop by the livestream:


  • Posts: 122
You could also short-circuit the counting, like this:

For (each Actor of Type "Duck") {
Fade blah blah blah

There's no point in continuing the loop or behavior if a single Duck (or whatever) is found. If there are no Actors of the specified type, the Fade code will execute.


  • Posts: 27
ok thanks, i try..
but the code of just4yoshi is only for flash game?for mobile?
and another...for change scene if the actor ( after destroy enemies ) stay alive 10 sec?


  • Posts: 27
sorry but i don't find the similar code for build a behavior...are you sure,
i'm sorry but for me is the first time with this program