A retro gaming programme, designed for use on a portable embedded system. Incorporates power saving techniques.

Dependencies:   ConfigFile N5110 PowerControl beep mbed

Files at this revision

API Documentation at this revision

Comitter:
el13drt
Date:
Sat Apr 18 01:27:03 2015 +0000
Parent:
17:242ccf6a8442
Child:
19:e0fd493816ae
Commit message:
Post Bugs; bugs left: flicker on option selection; sound FX defect;

Changed in this revision

tower.h Show annotated file Show diff for this revision Revisions of this file
--- a/tower.h	Sat Apr 18 00:42:44 2015 +0000
+++ b/tower.h	Sat Apr 18 01:27:03 2015 +0000
@@ -703,7 +703,8 @@
             lcd.drawCircle(72,19,2,1);
             refreshCursor2();
             refreshCursor3();
-            if(buttonA ==1) { //select easy
+            if(buttonFlagA) { //select easy
+                buttonFlagA = 0;
                 fall = 1;
             }
         }
@@ -713,7 +714,8 @@
             refreshCursor1();
             refreshCursor3();
 
-            if(buttonA == 1) { //select normal
+            if(buttonFlagA) { //select normal
+                buttonFlagA = 0;
                 fall = 2;
             }
         }
@@ -723,7 +725,8 @@
             refreshCursor1();
             refreshCursor2();
 
-            if(buttonA == 1) { //select difficult
+            if(buttonFlagA) { //select difficult
+                buttonFlagA = 0;
                 fall = 3;
             }
         }
@@ -900,7 +903,8 @@
 
 
 /// Exit Menu (Back button pressed)///
-            if(buttonB == 1) {
+            if(buttonFlagB) {
+                buttonFlagB = 0;
                 actionButtons();
                 drawExitMenu();//draws the exit menu
 
@@ -908,7 +912,8 @@
                     exitMenu(exitOption);//presents exit options
 
                     // 'exit' option YES
-                    if((buttonA == 1)&&(exitOption == 0)) { //returns to menu
+                    if((buttonFlagA)&&(exitOption == 0)) { //returns to menu
+                        buttonFlagA = 0;
                         actionButtons();
                         lcd.clear();//clears screen
                         resetGame();//resets scores/objects
@@ -916,9 +921,11 @@
                         break;
                     }
                     // 'exit' option NO - returns to game
-                    if((buttonA == 1)&&(exitOption == 1)) {
+                    if((buttonFlagA)&&(exitOption == 1)) {
+                        buttonFlagA = 0;
                         break;
                     }
+                    sleep();//put while to sleep
                 }
                 // if 'exit' option YES, resets
                 // game values returns to main menu
@@ -960,10 +967,12 @@
         actionButtons();//select
 
         // back to menu
-        if(buttonB == 1) {
+        if(buttonFlagB) {
+            buttonFlagB = 0;//reset flag
             lcd.clear();
             break;
         }
+        sleep();//put while to sleep
     }
 }