Download Projet Robus Armus - PascalNet.Net Blog

Transcript
AUDIO_PlayMP3FileAndWait("question6.mp3");
answer = false;
break;
case 6:
AUDIO_PlayMP3FileAndWait("question7.mp3");
answer = false;
break;
case 7:
AUDIO_PlayMP3FileAndWait("question8.mp3");
answer = false;
break;
case 8:
AUDIO_PlayMP3FileAndWait("question9.mp3");
answer = true;
break;
}
AUDIO_PlayMP3FileAndWait("vraioufaux.mp3"); // Le robot dit "vrai ou faux"
AUDIO_PlayMP3File("quiz.mp3"); //Une musique joue pour attendre que l'enfant
appui sur le bouton
kiwi.blinkmode = 1; //Mode clignotement des lumières vrai faux
int randomvar = SYSTEM_Random(3); //Nombre aléatoire servant à exprimer
différentes réactions au robot
int timewait = 0;
while(kiwi.askquestion){
if(kiwi.getButtonState(BGREEN)){ //Vérification du bouton vrai
AUDIO_StopPlayback(); //On arrête la musique d'attente
kiwi.blinkmode = 0;
if(answer == true){
kiwi.setPin(FLY, 1); //Le robot bat des ailes pour féliciter
l'enfant
kiwi.setPin(LRED, 0);
kiwi.setPin(LGREEN, 1);
goodanswer = true; //L'enfant a choisi la bonne réponse
AUDIO_PlayMP3FileAndWait("bonnereponse.mp3");;
switch (randomvar){ //Le robot félicite l'enfant selon
plusieurs possiblités
case 0:
AUDIO_PlayMP3FileAndWait("bravo.mp3");
AUDIO_PlayMP3FileAndWait("rire1.mp3");
break;
case 1:
AUDIO_PlayMP3FileAndWait("felicitation.mp3");
AUDIO_PlayMP3FileAndWait("rire3.mp3");
break;
case 2:
AUDIO_PlayMP3FileAndWait("excellent.mp3");
AUDIO_PlayMP3FileAndWait("rire4.mp3");
kiwi.setPin(LGREEN, 0);
break;
}
kiwi.setPin(LGREEN, 0);
kiwi.setPin(FLY, 0);
break;
}else{ //La mauvaise réponse
kiwi.setPin(LRED, 0);
kiwi.setPin(LGREEN, 1);
goodanswer = false; //L'enfant a choisi la mauvaise réponse
AUDIO_PlayMP3FileAndWait("mauvaisereponse.mp3"); //Le robot
dit "mauvaise réponse".
8