losing a life and restarting

Posted By: aslan123

losing a life and restarting - 05/06/07 18:22

hi
say you have 3 lives, you get killed and you want to restart the level but with one less like and if you have no lives left, put up a splash screen saying game over and loading the menu

does anyone know how to code this
Posted By: TeutonicDarkness

Re: losing a life and restarting - 05/07/07 01:12

Quote:

hi
say you have 3 lives, you get killed and you want to restart the level but with one less like and if you have no lives left, put up a splash screen saying game over and loading the menu

does anyone know how to code this





I have the method to do this
minus the splash screens ( thats easy ) but it for
the now considered out of date A5 templates.


It involves heavily modifying the origianl A5 template scripts.

If you told which version you use A5/ A6, A5 templates, A6 templates,
etc.....

it would help....


*** Teutonic Darkness ***
Posted By: aslan123

Re: losing a life and restarting - 05/07/07 10:05

hi im using a6 and im using my own script.
Posted By: zazang

Re: losing a life and restarting - 05/07/07 11:20

define a life counter first

var life_counter = 3;

and then code a function like this :-

function life _counter_dec()
{
life_counter -= 1;
IF(life_counter == 0) { death_panel.visible = on;}
}

death_panel is the panel shown after death(I hope you know what panels are,else
you can refer the manual)
On this panel add a button which can be clicked to load the mainmenu.

Hope it helps.
cheers!

zazang
Posted By: aslan123

Re: losing a life and restarting - 05/07/07 16:25

thanks for your reply

what happens if i have 2 lives left and i want to restart the level but with one less life
Posted By: zazang

Re: losing a life and restarting - 05/08/07 02:21

If(life_counter == 2) { restart_level();}

but you have to read the tutorial and manual to know what all needs to be written in that function.
© 2024 lite-C Forums