Add built-in answer tones and automatic multiple-choice progression

This commit is contained in:
Brian Holman committed 2026-11-09 20:30:45 -07:00
1 parent 9f7d6f4786
commit 0bfee790a8
18 files changed
+1658 -21

No files matched your search

+14 -2
View File
@@ -49,7 +49,7 @@ static U8 title(void)
text(8,149,"Choice: 1-4. Type: letters, spaces, Enter.",7);
text(8,160,"Backspace edits. Near spelling: retry/reveal.",2);
text(8,171,"50 questions. Release keys between presses.",2);
text(8,182,"Gold marks the state. SPACE after feedback.",6);
text(8,182,"Choice: auto next. Typed: SPACE to continue.",6);
present();c=choose("12CQ");if(c=='C')credits();
}while(c=='C');
return c;
@@ -121,12 +121,24 @@ static U8 typed_answer(void)
}
}
}
static void answer_sound(U8 right)
{
/* Color BASIC SOUND uses built-in audio and normal-speed timing.
Keep the graphics page visible while playing a rising or falling pair. */
setHighSpeed(FALSE);
if(right) {sound(170,2);sound(210,3);}
else {sound(100,3);sound(60,4);}
setHighSpeed(TRUE);
}
static void feedback(U8 right)
{
question_screen();phase=3;
text(8,158,right?"CORRECT!":"NOT THIS TIME.",right?6:5);
sprintf(line,"The capital is %s.",states[current_state].capital);text(8,170,line,7);
text(8,183,"Release your key, then SPACE to continue.",2);present();choose(" ");
text(8,183,mode==1?"Next question follows automatically.":"Release your key, then SPACE to continue.",2);
present();answer_sound(right);
if(mode==1) delay(90); /* 1.5 seconds to read the answer after the tone. */
else choose(" ");
}
static U8 results(void)
{