Skip to content

Commit

Permalink
Issue #14 add fight exit capability
Browse files Browse the repository at this point in the history
Press button B around 2 seconds to hard exit a fight (cheat mode)
  • Loading branch information
mougino committed Oct 8, 2015
1 parent ff0fb0e commit 9c13c80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DF01/DFadvsheet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void showFight() {
if (gb.update()) {

if((!esta || !staC) && !endanim) { before=true; endanim=21; } // ending animation (2s)
if(endanim) { endanim--; if(endanim==1) break; }
if(endanim) { if(--endanim==1) break; }

// display menu title
gb.display.println(PGMT(DF_fight));
Expand Down Expand Up @@ -261,6 +261,7 @@ void showFight() {
if(flee || (yas!=eas)) { printCaret(tyl); gb.display.print(PGMT(DF_tyl)); }
}
// handle user input
if (gb.buttons.held(BTN_B, 20)) break; // hold B during 20 frames (2s): hard exit
if(before) {
if (gb.buttons.pressed(BTN_DOWN) || gb.buttons.pressed(BTN_UP)) flee=!flee;
if (gb.buttons.pressed(BTN_A)) {
Expand Down
3 changes: 2 additions & 1 deletion FF01/FFadvsheet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void showFight() {
if (gb.update()) {

if((!esta || !staC) && !endanim) { before=true; endanim=21; } // ending animation (2s)
if(endanim) { endanim--; if(endanim==1) break; }
if(endanim) { if(--endanim==1) break; }

// display menu title
gb.display.println(PGMT(DF_fight));
Expand Down Expand Up @@ -261,6 +261,7 @@ void showFight() {
if(flee || (yas!=eas)) { printCaret(tyl); gb.display.print(PGMT(DF_tyl)); }
}
// handle user input
if (gb.buttons.held(BTN_B, 20)) break; // hold B during 20 frames (2s): hard exit
if(before) {
if (gb.buttons.pressed(BTN_DOWN) || gb.buttons.pressed(BTN_UP)) flee=!flee;
if (gb.buttons.pressed(BTN_A)) {
Expand Down

0 comments on commit 9c13c80

Please sign in to comment.