Sat Oct 18, 2014 1:30 pm
Sun Oct 19, 2014 6:24 am
void showDeathScreen(){
gb.sound.playPattern(deathSound,0); //start the death sound before entering the loop
while(1){ //continuously loop to update the screen, sound an buttons
if(gb.update()){
drawWorld(); //continue to display the world using a function you created somewhere else
gb.display.print(F("GAME OVER!")); //overlay a game over message
//leave this function if button A or B is pressed
if(gb.buttons.pressed(BTN_A) || gb.buttons.pressed(BTN_B)){
gb.sound.playOK();
return;
}
}
}
}
if(playerLife <= 0){
showDeathScreen();
}