Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/21/26 19:15
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 7,008 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Next Level After Enemies Are Dead #6874
09/02/01 15:42
09/02/01 15:42

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Does anyone have a script that will take you to the next level , after you kill all the enemies on the level.

Re: Next Level After Enemies Are Dead #6875
09/02/01 17:39
09/02/01 17:39

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Greetings again!

Declare a variable like

var number_of_enemies = 0;

Now, in each "enemy"-action before doing a loop or anything just raise the variable by one.

number_of_enemies += 1;

This way, the enemies in the map are "counted" while their actions are initialized.

Again, you have to insert something in the "Death"-function:

number_of_enemies -= 1;

So, each time a bad guy dies, the number decreases by one.

All you need now is a global loop.

while (1)
{
if (number_of_enemies == 0) { next_level(); }
}

I hope this helps.

Gnometech

P.S.: I am not too sure about it, but those questions seemed to me more like some for the Beginner's Forum... no offense meant...



Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1