Goto when all instances of object destroyed ?

Get help using Construct 2

Post » Fri Nov 02, 2012 1:42 pm

Howdy,
I have a demo i am working on, and need to have the System goto the next layout when all of the instances of an object are destroyed on screen in the layout i am on.
Say i have 5 or 10 instances of the same object < a circle > && have them set to destroy when collision occurs w/ another object < say, a square > that has 8 direction movement and they go one at a time as this happens. I need the system to move to a new Level_Page when all of them are destroyed but not before. I suspect i need to do it with instance variables, but don't know how && have been back and forth, and back and forth, through the menus trying to work it out but no dice. I wonder if someone might help me work this out, or point me to a tutorial that shows how as i couldn't really find anything relevant. I would be grateful for any reply at all &&
kind regards, mark-p.
B
12
S
3
G
3
Posts: 92
Reputation: 3,949

Post » Fri Nov 02, 2012 2:15 pm

Its super simple. Just use the "count" feature

https://www.scirra.com/manual/133/common-expressions

Compare the sprite count to 0 in your case and if so, goto next layout



System "Every Tick> - Compare Sprite.count is equal to 0
goto layout 2justifun2012-11-02 14:17:08
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Fri Nov 02, 2012 2:17 pm

Compare two variables: Circle.count = 0
-> go to layout
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Nov 02, 2012 2:25 pm

Hey Guys, thanks a lot, really. I was snagged up on that all last night.
kind regards, mark-p.
B
12
S
3
G
3
Posts: 92
Reputation: 3,949


Return to How do I....?

Who is online

Users browsing this forum: mjj1990 and 7 guests