help!

filippusis5

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

Derelikt

  • 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 »

filippusis5

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

just4yoshi

  • 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: livestream.com/poweredbyflowers

Nomosoft

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

For (each Actor of Type "Duck") {
  Stop;
}
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.

filippusis5

  • 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?

filippusis5

  • 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