Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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 | chip programmers | 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