ForumsProgramming ForumHELP POR FAVOR

5 3934
jimmy155
offline
jimmy155
39 posts
Nomad

Please help me, i have a questions, how do i make it so when the player kills all enemies the game goes to a new frame?
instance names:
player= hero
enemy=enemy

  • 5 Replies
BeastMode10
offline
BeastMode10
374 posts
Nomad

At the function that kills a single enemy, you can add a conditional that says: If all enemies are dead, then go to frame X

jimmy155
offline
jimmy155
39 posts
Nomad

whats the code for it?

plasmafish
offline
plasmafish
252 posts
Nomad

AS2? This might give you a clue as to what you need to do.

Enemy total
enemynumber = x;
//Where x is the total number of enemies in the level

Code for subtracting enemies from the total
if (enemydead){
enemynumber--;
}
//Subtract from the total number of enemies, should be coupled with the death sequence so it registers at the right time and not prematurely

Check if enemies are all dead
if (enemynumber==0){
gotoAndStop("frame&quot
}
//Can be placed inside a timer function or can be placed at the end of the death sequence for the enemy

jimmy155
offline
jimmy155
39 posts
Nomad

I mean, where do i put the codes?

plasmafish
offline
plasmafish
252 posts
Nomad

I mean, where do i put the codes?


If I told you that, I would be doing work for you and not just helping you out.
Showing 1-5 of 5