TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
Books & Courses
FORUMS
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Chat
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
How to switch scene when all of one actor dies in scene
Pages:
1
How to switch scene when all of one actor dies in scene
Holypeanut187
Posts: 12
November 24, 2018, 11:59:35 am
Im making a game sort of like missle command and i was wondering how to make it to when all of my cities die in a scene to go to a different scene (main menu)
If you can please post screenshot
Bombini
Posts: 1394
November 24, 2018, 12:15:20 pm
Hi,
You can get the amount of one actor type with something like “for each actortype add 1 to a number attribute(which you have to create)”.
Go to next scene if number is 0.
Cheers!
Holypeanut187
Posts: 12
November 24, 2018, 12:32:01 pm
im in the scene behavior menu and i made it and im editing it i have the code up until you add 1, how do i do that?
NerdinaNutshell
Posts: 251
November 24, 2018, 12:40:26 pm
Your going to want to show a picture it’s hard to understand the problem if we can’t see it.
*Puff*
Holypeanut187
Posts: 12
November 24, 2018, 12:44:13 pm
here
Holypeanut187
Posts: 12
November 24, 2018, 12:45:43 pm
my game is about shooting missles and AA guns at meteors that fall from sky and i want it to go back to main menu when all of your cities are destroyed
JeffreyDriver
Posts: 2262
November 24, 2018, 12:46:08 pm
For each actor of type
Increment (your number attribute) by 1
When actor of type is killed
Decrement (your number attribute) by 1
If (your number attribute) equals 0 or less
Switch to (your scene)
Current Projects:
The Grand Grimoire Chronicles Episode 3
Twitter@JeffreyDriver
apps.jeffreydriver.co.uk
JeffreyDriver
Posts: 2262
November 24, 2018, 12:47:28 pm
You need to create a number attribute to record the number of cities remaining.
ATTRIBUTES > GETTERS > CREATE ATTRIBUTE
Current Projects:
The Grand Grimoire Chronicles Episode 3
Twitter@JeffreyDriver
apps.jeffreydriver.co.uk
Holypeanut187
Posts: 12
November 24, 2018, 12:53:31 pm
the if block dosent accept number attributes just boolean
JeffreyDriver
Posts: 2262
November 24, 2018, 01:06:22 pm
You need the blocks under CONDITIONS > COMPARISONS
Stick the <= block in the if statement first
Can I ask if you've done teh crash course yet? If not, you will find it helpful.
Current Projects:
The Grand Grimoire Chronicles Episode 3
Twitter@JeffreyDriver
apps.jeffreydriver.co.uk
Holypeanut187
Posts: 12
November 24, 2018, 01:09:49 pm
i started using stencyl a long time ago on my old pc and got it on my new one, signed into my account and when i looked for crash course i couldnt find it and i dont know how to get it
Holypeanut187
Posts: 12
November 24, 2018, 01:19:31 pm
i stopped using it for a while
JeffreyDriver
Posts: 2262
November 24, 2018, 01:34:39 pm
Well here's the crash course -
http://www.stencyl.com/help/start/
But see attached image.
Current Projects:
The Grand Grimoire Chronicles Episode 3
Twitter@JeffreyDriver
apps.jeffreydriver.co.uk
Pages:
1