How to Destroy Multiple Enemies Before Moving On?

Get help using Construct 2

Post » Mon Jun 10, 2013 1:12 am

Hi everyone; I need help, I have a little problem... OK, right now, I have it so that when the "greenball" (or bullet) collides with "leveloneEnemy", you win and move on to level 2.

My question is... for level 2, how do I make it so that you have to shoot or collide the "greenball" with two enemies (leveltwoEnemy1+leveltwoEnemy2) instead of just one of them before moving to level 3? I already have the two sprites for the level 2 enemies made.





Thanks,
guannstar
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Mon Jun 10, 2013 3:10 am

Please, any help at all would be appreciated:)
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Mon Jun 10, 2013 4:02 am

You'll want to hold a variable for number of enemies destroyed (typically a global variable).

[code]+ Green Ball: On Collision with Enemy
-> Add 1 to Score

+ Score = 2
-> End Level[/code]
Also, you should typically wait a whole day before bumping your topic. 2 hours is not a whole lot of time for someone to look at your question and answer it on a forum.TL222013-06-10 04:03:34
B
80
S
30
G
8
Posts: 308
Reputation: 10,437

Post » Mon Jun 10, 2013 6:41 am

Hi, thanks for posting:)

I don't think I can do it by score, because the point system in my game is meant to be random. Meaning, there's more than one way to generate points, so it's hard to say exactly what score should send you to the next level.

Do you know what I mean?
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Mon Jun 10, 2013 7:13 am

Give the green slime an instance number variable called health

When bullet collides with slime, subtract 1 from health

When health is 0, call your end of level events.

For level 1 set health to 1
For level 2 set health to 2
etc.ArcadEd2013-06-10 07:14:17
B
100
S
31
G
11
Posts: 1,552
Reputation: 21,497

Post » Mon Jun 10, 2013 8:31 am

I don't think that would work either. The green slime is the bullet, so it can't collide with itself. Can't I just put a condition so that the bullet has to hit/collide with both enemies to move on, not just one enemy?
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Mon Jun 10, 2013 5:32 pm

Can somebody help me with this... I still can't get this to work:(
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Mon Jun 10, 2013 6:15 pm

This is what I've been trying, but yea, it isn't working at all. It should be able to collide with both enemies before moving on to level 2.

B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Mon Jun 10, 2013 6:28 pm

Do you mean hit one enemy and then another enemy ?
Because at the moment, what your event does is it checks it is colliding with one enemy and it has to be colliding/overlapping with the other enemy at the same time to be executed.

If you want to check for a consecutive action (like it goes through an enemy and then another one) use global variables to count the "hits".

It would be simpler to figure out if you'd post your complete capx directly.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
268
S
96
G
67
Posts: 7,219
Reputation: 73,739

Post » Mon Jun 10, 2013 6:45 pm

Yea, I mean hit one enemy and then another enemy:)

OK, so I've created the global variables like you said ("varfirstleveltwoEnemy" and "varfirstleveltwoEnemy")... How would I count the hits now?
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Next

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], skrotar, yme, Youtopize and 8 guests