Sat Jan 21, 2017 8:45 pm
Sat Jan 21, 2017 9:05 pm
Sat Jan 21, 2017 9:14 pm
Fri Feb 03, 2017 3:48 pm
Sat Feb 04, 2017 9:20 am
// GAME OVER
if (barredevie > 59) { // when i have no more life bar
gb.display.clear();
gb.display.print(F("GAME OVER")); // all my game over text
gb.display.print(F("\nScore: ")); // score
gb.display.print(score); //score
gb.display.print("\n"); // empty line
gb.display.print("\nPress \25"); // buton A char
while(1){ // while, while is TRUE loop
if (gb.buttons.repeat(BTN_A, 1)) { // if press A, this should break
break;
} //loop while
} // end if
setup();
Sat Feb 04, 2017 9:56 am
while(1) {
if (gb.update()) {
// your code goes here
}
}
Sat Feb 04, 2017 10:24 am
Awot wrote:i will focus on the Game over screen:
My problem is to stop the program while the game over screen.
Here is my last part of my program :
- Code:
// GAME OVER
if (barredevie > 59) { // when i have no more life bar
gb.display.clear();
gb.display.print(F("GAME OVER")); // all my game over text
gb.display.print(F("\nScore: ")); // score
gb.display.print(score); //score
gb.display.print("\n"); // empty line
gb.display.print("\nPress \25"); // buton A char
while(1){ // while, while is TRUE loop
if (gb.buttons.repeat(BTN_A, 1)) { // if press A, this should break
break;
} //loop while
} // end if
setup();
My problem here :
whith the while loop : the program freeze, no game over texte ect
whitout the while loop : the game over screen is ok but the program still runs and i can't go back to title screen
i don't understand why my while loop freeze the program, and why it doesn't work.
#define MODE_GAME 0
#define MODE_GAME_OVER 1
int mode = MODE_GAME
void loop() {
if(gb.update()){
switch( mode ){
case MODE_GAME:
stepGame();
break;
case MODE_GAME_OVER:
stepGameOver();
break;
}
}
}
Sun Feb 05, 2017 1:34 pm
Tue Jun 13, 2017 5:32 pm
Wed Jun 14, 2017 9:06 am