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

Committer:
RichardE
Date:
Sun Jun 09 19:34:56 2013 +0000
Revision:
10:bfa1c307c99d
Child:
12:81926431fea7
Changed how levels are represented so that dynamic allocation of memory is used. Maple version couldn't do this. Still only 2 levels. Use EnemyFactory whenever creating or destroying enemies.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RichardE 10:bfa1c307c99d 1 /*
RichardE 10:bfa1c307c99d 2 * SOURCE FILE : LevelDescriptor.h
RichardE 10:bfa1c307c99d 3 *
RichardE 10:bfa1c307c99d 4 * Definition of class LevelDescriptor.
RichardE 10:bfa1c307c99d 5 * Describes a level.
RichardE 10:bfa1c307c99d 6 *
RichardE 10:bfa1c307c99d 7 */
RichardE 10:bfa1c307c99d 8
RichardE 10:bfa1c307c99d 9 #ifndef LevelDescriptorDefined
RichardE 10:bfa1c307c99d 10
RichardE 10:bfa1c307c99d 11 #define LevelDescriptorDefined
RichardE 10:bfa1c307c99d 12
RichardE 10:bfa1c307c99d 13 #include "Types.h"
RichardE 10:bfa1c307c99d 14 #include "EnemyType.h"
RichardE 10:bfa1c307c99d 15
RichardE 10:bfa1c307c99d 16 class LevelDescriptor {
RichardE 10:bfa1c307c99d 17
RichardE 10:bfa1c307c99d 18 public :
RichardE 10:bfa1c307c99d 19
RichardE 10:bfa1c307c99d 20 // Used to mark the end of the descriptor array.
RichardE 10:bfa1c307c99d 21 #define ENDDESCRIPTOR ((UInt8)0xFF)
RichardE 10:bfa1c307c99d 22
RichardE 10:bfa1c307c99d 23 /*****************************************/
RichardE 10:bfa1c307c99d 24 /* GET COUNT FOR A PARTICULAR ENEMY TYPE */
RichardE 10:bfa1c307c99d 25 /*****************************************/
RichardE 10:bfa1c307c99d 26 // Pass pointer to array containing data in data parameter.
RichardE 10:bfa1c307c99d 27 // The array alternates between enemy type and count and MUST
RichardE 10:bfa1c307c99d 28 // be terminated with a byte of value ENDDESCRIPTOR.
RichardE 10:bfa1c307c99d 29 // Pass type of enemy to fetch count for in et.
RichardE 10:bfa1c307c99d 30 // Returns number of enemies of the given type on this level.
RichardE 10:bfa1c307c99d 31 static UInt8 GetEnemyCount( const UInt8 *data, EnemyType et );
RichardE 10:bfa1c307c99d 32
RichardE 10:bfa1c307c99d 33 private :
RichardE 10:bfa1c307c99d 34
RichardE 10:bfa1c307c99d 35 };
RichardE 10:bfa1c307c99d 36
RichardE 10:bfa1c307c99d 37 #endif
RichardE 10:bfa1c307c99d 38
RichardE 10:bfa1c307c99d 39 /* END of LevelDescriptor.h */
RichardE 10:bfa1c307c99d 40
RichardE 10:bfa1c307c99d 41