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
Level1.cpp@0:5fa232ee5fdf, 2013-06-04 (annotated)
- Committer:
- RichardE
- Date:
- Tue Jun 04 20:16:33 2013 +0000
- Revision:
- 0:5fa232ee5fdf
- Child:
- 5:0b0651ac7832
Started conversion from Maple version of game. So far Gameduino seems to have been initialised OK and just displays a sign on message. Lots of commented out code.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RichardE | 0:5fa232ee5fdf | 1 | /* |
RichardE | 0:5fa232ee5fdf | 2 | * SOURCE FILE : Level1.cpp |
RichardE | 0:5fa232ee5fdf | 3 | * |
RichardE | 0:5fa232ee5fdf | 4 | * Definition of class Level1. |
RichardE | 0:5fa232ee5fdf | 5 | * Machine written by program MapleRobotRicLevelGenerator. |
RichardE | 0:5fa232ee5fdf | 6 | * DO NOT EDIT BY HAND! |
RichardE | 0:5fa232ee5fdf | 7 | * |
RichardE | 0:5fa232ee5fdf | 8 | */ |
RichardE | 0:5fa232ee5fdf | 9 | |
RichardE | 0:5fa232ee5fdf | 10 | #include "Level1.h" |
RichardE | 0:5fa232ee5fdf | 11 | |
RichardE | 0:5fa232ee5fdf | 12 | /**************/ |
RichardE | 0:5fa232ee5fdf | 13 | /* PLAY LEVEL */ |
RichardE | 0:5fa232ee5fdf | 14 | /**************/ |
RichardE | 0:5fa232ee5fdf | 15 | // Returns code indicating how level ended. |
RichardE | 0:5fa232ee5fdf | 16 | Level::LevelExitCode Level1::Play( void ) { |
RichardE | 0:5fa232ee5fdf | 17 | #if 0 |
RichardE | 0:5fa232ee5fdf | 18 | LevelData dataForThisLevel; |
RichardE | 0:5fa232ee5fdf | 19 | GameObject **ptr = dataForThisLevel.Enemies; |
RichardE | 0:5fa232ee5fdf | 20 | UInt8 i, humanCount, enemyCount = 0; |
RichardE | 0:5fa232ee5fdf | 21 | // Enemies of type GruntObject. |
RichardE | 0:5fa232ee5fdf | 22 | #define GRUNTOBJECTCOUNT 5 |
RichardE | 0:5fa232ee5fdf | 23 | GruntObject gruntobjects[ GRUNTOBJECTCOUNT ]; |
RichardE | 0:5fa232ee5fdf | 24 | for( i = 0; i < GRUNTOBJECTCOUNT; ++i ) { |
RichardE | 0:5fa232ee5fdf | 25 | if( enemyCount < LevelData::MaxEnemies ) { |
RichardE | 0:5fa232ee5fdf | 26 | *ptr++ = gruntobjects + i; |
RichardE | 0:5fa232ee5fdf | 27 | enemyCount++; |
RichardE | 0:5fa232ee5fdf | 28 | } |
RichardE | 0:5fa232ee5fdf | 29 | } |
RichardE | 0:5fa232ee5fdf | 30 | // Enemies of type CrusherObject. |
RichardE | 0:5fa232ee5fdf | 31 | #define CRUSHEROBJECTCOUNT 5 |
RichardE | 0:5fa232ee5fdf | 32 | CrusherObject crusherobjects[ CRUSHEROBJECTCOUNT ]; |
RichardE | 0:5fa232ee5fdf | 33 | for( i = 0; i < CRUSHEROBJECTCOUNT; ++i ) { |
RichardE | 0:5fa232ee5fdf | 34 | if( enemyCount < LevelData::MaxEnemies ) { |
RichardE | 0:5fa232ee5fdf | 35 | *ptr++ = crusherobjects + i; |
RichardE | 0:5fa232ee5fdf | 36 | enemyCount++; |
RichardE | 0:5fa232ee5fdf | 37 | } |
RichardE | 0:5fa232ee5fdf | 38 | } |
RichardE | 0:5fa232ee5fdf | 39 | // Humans. |
RichardE | 0:5fa232ee5fdf | 40 | #define HUMANCOUNT 5 |
RichardE | 0:5fa232ee5fdf | 41 | HumanObject humans[ HUMANCOUNT ]; |
RichardE | 0:5fa232ee5fdf | 42 | ptr = dataForThisLevel.Humans; |
RichardE | 0:5fa232ee5fdf | 43 | humanCount = ( HUMANCOUNT > LevelData::MaxHumans ) ? LevelData::MaxHumans : HUMANCOUNT; |
RichardE | 0:5fa232ee5fdf | 44 | for( i = 0; i < humanCount; ++i ) { |
RichardE | 0:5fa232ee5fdf | 45 | *ptr++ = humans + i; |
RichardE | 0:5fa232ee5fdf | 46 | } |
RichardE | 0:5fa232ee5fdf | 47 | DataForLevel = &dataForThisLevel; |
RichardE | 0:5fa232ee5fdf | 48 | return PlayLoop(); |
RichardE | 0:5fa232ee5fdf | 49 | #else |
RichardE | 0:5fa232ee5fdf | 50 | return Completed; |
RichardE | 0:5fa232ee5fdf | 51 | #endif |
RichardE | 0:5fa232ee5fdf | 52 | } |
RichardE | 0:5fa232ee5fdf | 53 |