Hello! I am working on a bgt choose story game. The game runs just fine, but when i press a key it will do nothing, and the voice keeps speaking. Here is the code:
#include"dynamic_menu.bgt"
void main()
{
alert("hello you","This game is a chooseyour story game.");
show_game_window("Chooseyourstory v1.0");
dynamic_menu menu;
tts_voice voice;
menu.add_item_tts("Start the adventure, you can\'t currently load/save");
menu.add_item_tts("exit");
int result=menu.run("Choose an option with the arrow keys, press enter to activate.",true);
if(result==1)
{
start();
}
}
void start()
{
while(true)
{
tts_voice voice;
voice.speak_wait("Press a, b, or c, to choose an option while this is required.");
voice.speak_wait("You are currently in a house. You live with your dad. You are bored of your life, because you have never visited in an exciting adventure. What should you do? A: ask your fother. B: Go to the adventure! C: Stay at home with your dad.");
if(key_pressed(KEY_RETURN))
{
voice.stop();
}
wait(4000);
if(key_pressed(KEY_A))
{
ask();
}
}
}
void ask()
{
tts_voice voice;
voice.speak_wait("So you decided to ask your fother. You: Can i go to an adventure. Fother: Yep, with me. You: no no, i want to go alone! Fother: No! That just doesn\'t work. You go with me, or you stay at home. You: I don\'t want to stay in this fucking stupid house with you! Fother: Ok, it is my choice then, since you are using strong language, you will not go an adventure with me! You: Fuck you fother. The dad is a little crazy, and he pulls out his handgun. Then, boom! You are death!");
alert("Game over","You ended up dying at the very beginning. Very smart of you! Please try again with another option, i think that would be a good idea.");
}