I have a counter that is in the script where the menu is.
It starts when I start the game from the menu.
in the game the player can find a "secret" level and I wanted the counter to "follow" the player to the secret level. I did manage that , but when I tried to make a function that brings the player back again when there is only 3 seconds left. I dont get the reaction I want. The counter only counts down and goes back to the menu.
Here is the levels I have:
string level_str = <NyTestMenu.WMB>; // menu
string startspill_wmb = <bonustest.WMB>;//main level
string testSpill_wmb =<testSpill.WMB>; //secret level
Here is the function I wrote.I have it in the secret level(testSpill.wmb). I wanted that the player shall return to main game and continue with an extra 40 seconds since they found the secret level.But nothing happends. The counter counts down to 0 and go back to menu.... so what am I doing wrong?
Code:
function go_back_to_game_startup()
{
while(seconds > 3){
if(seconds == 3)
{
level_load(startspill_wmb);
seconds = 40;
wait(3);
}
}
}
the counter is in the menu script (NyTestMenu.WMB);
Code:
function count_down()
{
while(seconds > 0)
{
sleep (1);
seconds -= 1;
if (seconds == 0)
{
display_score.visible = on;
display_back_score.visible = on;
freeze_mode = 1;
sleep (4);
display_score.visible = off;
display_back_score.visible = off;
chart_highscores(hits_of_the_player,pl_name);
savescore();
savescore2();
show_the_highscores();
//
level_load(level_str);
wait(3);
//fps_max = 60;
freeze_mode = 0;
score_gesamt.visible = on;
titel_pan_menue.visible = on;
exit_pan.visible = on;
plname_pan.visible = off;
clear_pan.visible = on;
credits_button.visible =off;
newgame_pan_menue.visible = off;
time_panel.visible = off;
shoots_panel.visible = off;
display_reload.visible = off;
first_pan.visible = off;
display_pan.visible = off;
time_slow_panel.visible = off;
hits_of_the_player = 0;
shoots = 100000;
extra_slow =0;
extra_slow_time = 0;
time_factor = 1;
}
}
}
What am I doing wrong?
and where am I supposed to put the go_back_to_game_startup()?
If I put it in the menu script, it will only effect the main game dont it?
I am so confused rigfht now...that I dont see anything....
Maybee someone elses eyes can see what I am dong wrong....thanks in advance!