Hi,
I am trying to make a stopwatch for my computer simulator, but it fales. It gives one of the errors that I hate. Can somebody look at this? Also, it gives this error in a few voids, so if there is not an error, I will post the other voids.
void stopwatch() {
timer stopwatchtimer;
stopwatchtimer.pause();
sound clock;
clock.load("vista/clock.wav");
v.speak_wait("Welcome to the stopwatch! Press space to pause/resume the timer, press t to learn how much time was elapsed in miliseconds, and press escape to quit.");
while(true) {
if(key_pressed(KEY_SPACE)) {
if(stopwatchtimer.running==true) {
stopwatchtimer.pause();
clock.pause();
v.speak_wait("Timer paused.");
}
else {
stopwatchtimer.resume();
clock.play_looped();
v.speak_wait("Timer resuming.");
}
}
if(key_pressed(KEY_T)) {
clock.pause();
stopwatchtimer.pause();
v.speak_wait(stopwatch.elapsed()+"miliseconds were elapsed.");
stopwatchtimer.resume();
clock.play_looped();
}
if(key_pressed(KEY_ESCAPE)) {
clock.stop();
stopwatchtimer.pause();
stopwatchtimer.restart();
v.speak_wait("Exiting...");
programs();
}
wait(5);
}
}
}
I usually post game recordings to anyaudio. Click here to visit my anyaudio page