Version of Robotron arcade game using LPC1768, a Gameduino shield, a serial EEPROM (for high scores), two microswitch joysticks and two buttons plus a box to put it in. 20 levels of mayhem.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
Diff: GameRobotRic.cpp
- Revision:
- 1:dfd5eaaf96a3
- Parent:
- 0:5fa232ee5fdf
- Child:
- 2:bb0f631a6068
--- a/GameRobotRic.cpp Tue Jun 04 20:16:33 2013 +0000 +++ b/GameRobotRic.cpp Wed Jun 05 22:05:41 2013 +0000 @@ -103,7 +103,6 @@ #endif // Repeat forever. while( true ) { -#if 0 // Get level specified by level number. level = levels.GetLevel( levelNumber ); // If failed to get level with that number go back to first normal level. @@ -113,30 +112,39 @@ // Refetch level. level = levels.GetLevel( levelNumber ); } - // Pass reference to high score table. - level->SetHighScores( &highScores ); +#if 0 + // Pass reference to high score table. + level->SetHighScores( &highScores ); // Set player that is playing the level. level->SetPlayer( &player ); +#endif + // Set Gameduino to use. + level->SetGameduino( &gd ); // Play the level. exitCode = level->Play(); // If player was killed then decrement lives otherwise // advance to next level. switch( exitCode ) { case Level::GameOver : +#if 0 // TODO : Do some sort of game over fuss. CheckForHighScore( &highScores, player.Score ); +#endif // Go back to attract level and reset player lives and score. levelNumber = LevelCollection::AttractLevel; +#if 0 player.Lives = START_LIVES; player.Score = 0; +#endif break; case Level::Completed : levelNumber++; break; } -#endif - // Finished with Gameduino. - gd.end(); + // Wait a bit. + wait( (float)2 ); } +// Finished with Gameduino. +gd.end(); }