Quote:

I know there are lots of ways to trigger the end of a game but I am wondering how to end the game when all enemies are dead or you run out of bullets rather than walking into a trigger.

Here is the scenerio. A hunting game. Player does not move, he is like a turret. There are entities (ducks) using dumb ai that fly around the level. Player can shoot them. when all ducks are dead game ends with a splash sceen that says you win. If you run out of ammo before all ducks are dead game ends with a splash screen that says you lose.

Any idea how to script this?





This would be quite easy actually you just need to set some
varibles for the ducks, and for your ammo level.


If you know how may ducks your going to have total
something like this:

var ducks_alive = 50;
// in your action reduce duks alive by 1
// each time a duck is killed

/////////////////////////////////////////////////



IF (ducks_alive == 0)

{
wait(1);
congrad_pan_ON; // turn on Congardualtion panel
wait(10);
congrad_pan_OFF; // optionally turn off panel now?
// End game or go to menu
}


//////////////////////////////////////////////////////
For when your out of ammo

///////////////////////////////

var bullet_suppy = 100;
// once again reduce bullet suppy
// by -1 for each bullet fired

IF (bullet_suppy == 0)

{
wait(1);
you_loose_pan_ON; // turn on Congardualtion panel
wait(10);
you_loose_pan_ON; // optionally turn off panel now?
// End game or go to menu
}


This is not a fully working script just an example
of how you can acheive this...




Hope it helps...


*** Teutonic Darkness ***