A retro gaming programme, designed for use on a portable embedded system. Incorporates power saving techniques.
Dependencies: ConfigFile N5110 PowerControl beep mbed
Revision 72:ade25d595dc9, committed 2015-05-08
- Comitter:
- el13drt
- Date:
- Fri May 08 12:42:59 2015 +0000
- Parent:
- 71:8f66a957b79a
- Child:
- 73:1b03202c987a
- Commit message:
- post jake helped me again cause im a moron..(+1 pint to debt);
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebounceIn.lib Fri May 08 12:42:59 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/AjK/code/DebounceIn/#31ae5cfb44a4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Fri May 08 12:42:59 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/AjK/code/MODSERIAL/#ae0408ebdd68
--- a/main.cpp Fri May 08 09:02:06 2015 +0000 +++ b/main.cpp Fri May 08 12:42:59 2015 +0000 @@ -11,10 +11,9 @@ #include <ctime> #include <cstdlib> - ///writes to CFG file. void write() -{ +{ ///Sets a Key and Value. if (!cfg.setValue("Open1", player1initials)) {//key/value error("Failure to set a value.\n"); @@ -43,8 +42,8 @@ } ///Reads CFG file. -void read(){ - +void read() +{ //Checks if key matches. char *key1 = "Open1"; char *key2 = "Open2"; @@ -1058,7 +1057,7 @@ highScore3 = highScore2; n = score; highScore2 = n; - sprintf (player3initials, "3.%c%c%c.....%i",player2initials[2],player3initials[3],player3initials[4],highScore3); + sprintf (player3initials, "3.%c%c%c.....%i",player2initials[2],player2initials[3],player2initials[4],highScore3); sprintf (player2initials, "2.%c%c%c.....%i",x,y,z,highScore2); } //if player beats High Score 1, 2 and 3, replace highScore1 with new score @@ -1067,7 +1066,7 @@ highScore2 = highScore1; n = score; highScore1 = n; - sprintf (player3initials, "3.%c%c%c.....%i",player2initials[2],player3initials[3],player3initials[4],highScore3); + sprintf (player3initials, "3.%c%c%c.....%i",player2initials[2],player2initials[3],player2initials[4],highScore3); sprintf (player2initials, "2.%c%c%c.....%i",player1initials[2],player1initials[3],player1initials[4],highScore2); sprintf (player1initials, "1.%c%c%c.....%i",x,y,z,highScore1); }
--- a/tower.h Fri May 08 09:02:06 2015 +0000 +++ b/tower.h Fri May 08 12:42:59 2015 +0000 @@ -134,9 +134,9 @@ int score = 0;/*!< Integer to show and print Scores. */ //stored high score variables -int highScore1; -int highScore2; -int highScore3; +int highScore1;/*!< Integer to store Score 1. */ +int highScore2;/*!< Integer to store Score 2. */ +int highScore3;/*!< Integer to store Score 3. */ //global char arrays to store initials/score char player1initials[14] = {"1.AAA.....0"};/*!< Buffer for printing Initials and Top Score 1.*/ @@ -186,17 +186,54 @@ int state3 = 0;/*!< State number for output 3.*/ //prototypes + + +/** +*/ void calibrateJoystick(); + +/** +*/ void updateJoystick(); + +/** +*/ void timerExpiredA(); + +/** +*/ void timerExpiredB(); + +/** +*/ void actionButton(); + +/** +*/ void randomise(); + +/** +*/ void resetGame(); + +/** +*/ void startrek(); + +/** +*/ void refreshCursor1(); + +/** +*/ void refreshCursor2(); + +/** +*/ void refreshCursor3(); + +/** +*/ void ninjaBoundaries(); /**