Hello! How can i create a thing like this in bgt: I launch the game. Then, the voice says Welcome and the game starts. Then i press the left arrow key and the voice speaks some text. Then, after i press the left arrow(this is the function startgame) then the new function will start. Then the voice speaks a message again. How do i do this so that the other function will also wait for my keypresses after the previous one has finished? If this sounds a little confusing, i will put the code below. Please tell me what i should do:
void main()
{
tts_voice voice;
show_game_window("test");
voice.speak_wait("Welcome");
startgame();
}
void startgame()
{
tts_voice voice;
voice.speak_wait("Ready? Go!");
while(!key_pressed(KEY_ESCAPE))
{
if(key_pressed(KEY_LEFT))
{
voice.speak_wait("Up, what next?");
difficult();
}
}
else if(key_pressed(KEY_RETURN))
{
voice.speak_wait("Ptich");
}
}
}
void difficult()
{
tts_voice voice;
voice.speak_wait("That was not so difficult, saw... But haha. I reversed the keys.");
while(key_pressed(KEY_ESCAPE))
{
if(key_pressed(KEY_UP))
{
voice.speak_wait("Here we go!");
}
}
}
Thanks
Best regards: Marco