Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
LevelData.h@5:0b0651ac7832, 2013-06-08 (annotated)
- Committer:
- RichardE
- Date:
- Sat Jun 08 14:40:47 2013 +0000
- Revision:
- 5:0b0651ac7832
- Child:
- 8:82d88f9381f3
Now got first real level starting and player can be controlled using joysticks. No bullets, enemies, humans or sound yet.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| RichardE | 5:0b0651ac7832 | 1 | /* |
| RichardE | 5:0b0651ac7832 | 2 | * SOURCE FILE : LevelData.h |
| RichardE | 5:0b0651ac7832 | 3 | * |
| RichardE | 5:0b0651ac7832 | 4 | * Definition of class LevelData. |
| RichardE | 5:0b0651ac7832 | 5 | * |
| RichardE | 5:0b0651ac7832 | 6 | */ |
| RichardE | 5:0b0651ac7832 | 7 | |
| RichardE | 5:0b0651ac7832 | 8 | #ifndef LevelDataDefined |
| RichardE | 5:0b0651ac7832 | 9 | |
| RichardE | 5:0b0651ac7832 | 10 | #define LevelDataDefined |
| RichardE | 5:0b0651ac7832 | 11 | |
| RichardE | 5:0b0651ac7832 | 12 | #include "GameObject.h" |
| RichardE | 5:0b0651ac7832 | 13 | // #include "EnemyObject.h" |
| RichardE | 5:0b0651ac7832 | 14 | // #include "HumanObject.h" |
| RichardE | 5:0b0651ac7832 | 15 | // #include "MutantObject.h" |
| RichardE | 5:0b0651ac7832 | 16 | |
| RichardE | 5:0b0651ac7832 | 17 | class LevelData { |
| RichardE | 5:0b0651ac7832 | 18 | |
| RichardE | 5:0b0651ac7832 | 19 | public : |
| RichardE | 5:0b0651ac7832 | 20 | |
| RichardE | 5:0b0651ac7832 | 21 | enum { |
| RichardE | 5:0b0651ac7832 | 22 | MaxEnemies = 64, // Maximum number of enemies you can have in a level |
| RichardE | 5:0b0651ac7832 | 23 | MaxHumans = 24, // maximum number of humans you can have in a level |
| RichardE | 5:0b0651ac7832 | 24 | MaxMutants = MaxHumans, // Maximum number of mutant humans you can have in a level |
| RichardE | 5:0b0651ac7832 | 25 | }; |
| RichardE | 5:0b0651ac7832 | 26 | |
| RichardE | 5:0b0651ac7832 | 27 | // Array containing pointers to all the enemies in a level. |
| RichardE | 5:0b0651ac7832 | 28 | // A null pointer indicates an unused or dead enemy. |
| RichardE | 5:0b0651ac7832 | 29 | GameObject *Enemies[ MaxEnemies ]; |
| RichardE | 5:0b0651ac7832 | 30 | |
| RichardE | 5:0b0651ac7832 | 31 | // Array containing pointers to all the humans in a level. |
| RichardE | 5:0b0651ac7832 | 32 | // A null pointer indicates an unused or rescued human. |
| RichardE | 5:0b0651ac7832 | 33 | GameObject *Humans[ MaxHumans ]; |
| RichardE | 5:0b0651ac7832 | 34 | |
| RichardE | 5:0b0651ac7832 | 35 | // Array containing mutant humans (NOT pointers to mutants). |
| RichardE | 5:0b0651ac7832 | 36 | // Pointer to the mutants in this array are written into the Enemies array |
| RichardE | 5:0b0651ac7832 | 37 | // whenever a human is mutated by a brain. |
| RichardE | 5:0b0651ac7832 | 38 | // MutantObject Mutants[ MaxMutants ]; |
| RichardE | 5:0b0651ac7832 | 39 | |
| RichardE | 5:0b0651ac7832 | 40 | /***************/ |
| RichardE | 5:0b0651ac7832 | 41 | /* CONSTRUCTOR */ |
| RichardE | 5:0b0651ac7832 | 42 | /***************/ |
| RichardE | 5:0b0651ac7832 | 43 | LevelData(); |
| RichardE | 5:0b0651ac7832 | 44 | |
| RichardE | 5:0b0651ac7832 | 45 | /**************/ |
| RichardE | 5:0b0651ac7832 | 46 | /* DESTRUCTOR */ |
| RichardE | 5:0b0651ac7832 | 47 | /**************/ |
| RichardE | 5:0b0651ac7832 | 48 | virtual ~LevelData(); |
| RichardE | 5:0b0651ac7832 | 49 | |
| RichardE | 5:0b0651ac7832 | 50 | }; |
| RichardE | 5:0b0651ac7832 | 51 | |
| RichardE | 5:0b0651ac7832 | 52 | #endif |
| RichardE | 5:0b0651ac7832 | 53 | |
| RichardE | 5:0b0651ac7832 | 54 | /* END of LevelData.h */ |
| RichardE | 5:0b0651ac7832 | 55 |