Also folgendes

Ich habe ein Code geschrieben das per Alpha Ein Text und ein Bild eingeblendet wird. Dazu kommt dann noch Musik. Das ganze dient als Intro. Nun möchte ich, das beim Druck auf die Taste ESC die komplette
function intro() abgestoppt wird und mit
function hauptmenue() weitergemacht wird. Da wird dann Musik gestoppt, Text und Intro Bilder ausgeblendet.
Ich habe das ganze soweit bisher.
Code:
... //intro_music() und anderes Zeug...
function hauptmenue()
{
media_stop(intromusic);
intro1.visible = off;
intro2.visible = off;
intro3.visible = off;
}
function intro()
{
on_esc = hauptmenue; //Wenn Escape gedrückt wird überspring das Intro
intro1.visible = on;
intro2.visible = on;
intro3.visible = on;
game_font.visible = on;
intro_music();
game_font.pos_x = 90;
str_cpy(eingabe,"Sieben Jahre sind vergangen, seid dem massiven Angriff der Flax."); //Text wird eingetragen
while (intro1.alpha < 100)
{
intro1.alpha += 2*time;
wait(1);
if (game_font.alpha < 100)
{
game_font.alpha += 1*time;
wait(1);
}
}
sleep(2);
... usw
Wie stoppe ich nun die intro Funktion. Er springt zwar ins Hauptmenü allerdings läuft funktion intro weiter. Das schlimme daran ist, dass er am Ende vom Intro das Hautpmenue nochmal aufrufen würde..
Hier der Code
Code:
...
while (intro3.alpha > 0)
{
intro3.alpha -= 4*time;
wait(1);
if (game_font.alpha > 0)
{
game_font.alpha -= 4*time;
wait(1);
}
}
intro3.visible = off;
sleep(1);
hauptmenue();
}
Was kann ich tun?
MFG Moerk
