TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
help!
Pages:
1
help!
filippusis5
Posts: 27
April 16, 2012, 01:41:21 am
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
April 16, 2012, 04:57:53 am
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 »
https://twitter.com/DereliktDev
filippusis5
Posts: 27
April 16, 2012, 10:32:31 am
can you see me with a image, for me is a first time use Stencyl...sorry but is my english sucks
just4yoshi
Posts: 90
April 16, 2012, 10:46:25 am
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
). 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
April 16, 2012, 11:23:48 am
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
April 16, 2012, 11:12:07 pm
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
April 17, 2012, 01:16:56 pm
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
Pages:
1