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: mbed
Diff: EnemySpawner/EnemySpawner.h
- Revision:
- 6:f06ce4cf068a
- Parent:
- 3:97cd7b3d89d0
--- a/EnemySpawner/EnemySpawner.h Wed May 08 19:41:10 2019 +0000 +++ b/EnemySpawner/EnemySpawner.h Wed May 08 23:21:32 2019 +0000 @@ -6,6 +6,43 @@ #include "Enemy.h" +/** EnemySpawner Class +@author Adam Jones, University of Leeds +@brief Creates and controls the levels of the game +@date April 2019 +@brief Revision 1.0 + +@code +#include "Enemy.h" +#include "mbed.h" +#include "Gamepad.h" + + +int main() +{ + //setup pointer to enemy array + Enemy *_enemies; + //setup level enemy spawner object + EnemySpawner _level; + + + //create level and return array of enemies + int _levelNumber = 1 //integer level number + _enemies = _level.init(_levelNumber); + + //returns number of enemies in level + int numOfEnemies = _level.get_number_of_enemies() + + //updates level + _level.update(_fps); +} + +@endcode + + +*/ + + class EnemySpawner { @@ -13,10 +50,23 @@ EnemySpawner(); ~EnemySpawner(); + /** + * @brief Initialises the game level + * @param level @details the number of the level of the game + * @returns Enemy* @details a pointer to an array of enemy objects + */ Enemy* init(int level); + + /** + * @brief Updates to keep track of the time and tell indicidual enemies when to begin moving + * @param fps @details the fps of the game + */ void update(int fps); - void set_number_of_enemies(int enemies); + /** + * @brief Gets the number of enemies in level + * @returns number of enemies @details an integer value of the number of enemies in the level + */ int get_number_of_enemies(); private: