Re: error things

Oh no. Declaring a function and calling it are two different things. A function call naturally needs to be done from within an outer function, even if it would be just the main one, but a function declaration just can't be done inside a function, and what you did with the keyboard_practice function is just that. Below is a fixed version of your code.
There may be some typos left, I haven't checked everything character by character, but the basic principle should work like this.
Lukas

#include "dynamic_menu.bgt"
sound music;
sound error;
sound[] tone(4);
int menu_choice;
tts_voice voice;
void main()
{
tone[0].load("1.wav");
tone[1].load("2.wav");
tone[2].load("3.wav");
tone[3].load("4.wav");
error.load("error.wav");
music.load("music.wav");
music.volume=-10;
show_game_window("swamp Memmory");
voice. speak_wait("wellcome to swamp memmory, made from the test game example in the bgt help system.");
music.play_looped();
dynamic_menu menu;
menu.add_item_tts("start getting bashed");
menu.add_item_tts("practice being bashed");
menu.add_item_tts("chicken out");
menu.allow_escape=true;
menu.wrap=true;
do
{
menu_choice=menu.run("here to get hit all over the place? well, this is a very good place to start!", true);
if(menu_choice==1)
{
music.stop();
game_round();
music.play_looped();
}
else if(menu_choice==2)
{
music.stop();
keyboard_practice();
music.play_looped();
}
}
while(menu_choice!=0 and menu_choice!=3);voice.speak_wait("ur, where do you think you're going? the zombies haven't had their dayly brain needs met oh well if you really want to go then, good bye.");
}

void game_round()
{
}

void keyboard_practice()
{
voice.speak_wait("press any of the 4 arrow keys to find out which swamp zombie normal, tyrant, giant or amorphis is attacking you.");
voice.speak_wait("press escape if you are done hitting arrow keys.");
while(!key_pressed(KEY_ESCAPE))
{
if(key_pressed(KEY_LEFT))
{
play_tone(0);
}
else if(key_pressed(KEY_DOWN))
{
play_tone(1);
}
else if(key_pressed(KEY_RIGHT))
{
play_tone(2);
}
else if(key_pressed(KEY_UP))
{
play_tone(3);
}
wait(5);
}
}

void play_tone (int t)
{
tone[t].stop();
tone[t].play();
}

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : connor142 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : connor142 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : lukas via Audiogames-reflector

Reply via email to