if any sprite excluding x on screen, do nothing, else, reset

Get help using Construct 2

Post » Wed Jan 21, 2015 10:57 am

Hi guys, I'm pretty new to Construct 2 and enjoying it very much thus far.

In my game the player must remove the enemy from the screen without destroying every other object on the screen.

I am able to apply different loss scenarios to my levels by using multiple event sheets and events for each one, but I can't help but feel there is a more elegant way than the one I'm currently using.

Main event sheet is included in all layouts and it just has "Level complete if enemy is outside layout" and works fine.

Level 1 has wooden boxes. Level fail if wooden boxes count = 0.

Level 2 has metal boxes. Same as above but metal this time.

Level 3 has a 3rd kind of box, same as above...

etc... Some levels also have multiple different kinds of boxes which mean even more unique events required to cover those levels.

What I really want is something like "if any sprite other than "Enemy" + "Floor" is on screen, do nothing, else, level fail." but I'm not sure how to do this.

Thanks in advance for the help! :D

edit: changed title to something more in line of what I'm asking
Posts: 22
Reputation: 244

Post » Wed Jan 21, 2015 2:25 pm

Is each level housing a certain amount of boxes? predefined?
Need Sprites For Your Next Project?
100% Vector Animated Sprites
Posts: 170
Reputation: 1,086

Post » Wed Jan 21, 2015 3:47 pm

Yes. For example level 1 will have 8 boxes forming a structure, the aim of the player is to destroy some of the boxes to make the structure fall over so the enemy rolls off the screen.
Posts: 22
Reputation: 244

Post » Wed Jan 21, 2015 8:34 pm

I think this is might be something best solved by using Families. (See the manual for how they work.)
That would let you deal with all "boxes" the same way for some effects. Unfortunately, families are not available to free users (like myself.)
Posts: 152
Reputation: 1,236

Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Google [Bot], Kira8 and 6 guests