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
EnemySpawner Class Reference
EnemySpawner Class. More...
#include <EnemySpawner.h>
Public Member Functions | |
Enemy * | init (int level) |
Initialises the game level. | |
void | update (int fps) |
Updates to keep track of the time and tell indicidual enemies when to begin moving. | |
int | get_number_of_enemies () |
Gets the number of enemies in level. |
Detailed Description
EnemySpawner Class.
- Date:
- April 2019 Revision 1.0
#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); }
Definition at line 46 of file EnemySpawner.h.
Member Function Documentation
int get_number_of_enemies | ( | ) |
Gets the number of enemies in level.
- Returns:
- number of enemies
an integer value of the number of enemies in the level
Definition at line 71 of file EnemySpawner.cpp.
Enemy * init | ( | int | level ) |
Initialises the game level.
- Parameters:
-
level the number of the level of the game
- Returns:
- Enemy*
a pointer to an array of enemy objects
Definition at line 14 of file EnemySpawner.cpp.
void update | ( | int | fps ) |
Updates to keep track of the time and tell indicidual enemies when to begin moving.
- Parameters:
-
fps the fps of the game
Definition at line 53 of file EnemySpawner.cpp.
Generated on Mon Nov 11 2024 22:48:00 by
