Bandidos
|
Public Member Functions | |
WaveSystem (Playfield playfield, IWaveDesigns waveDesigns) | |
int | getCurrentWave () |
int | getCurrentWaveType () |
void | updateWaveSystem (float deltaTime) |
Enemy | waveCreateEnemy (Wave wave, EnemyFactory.EnemyType enemyType) |
void | clean () |
Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher | |
void | addEventListener (String type, IEventReceiver listeningClass) |
void | dispatchEvent (Event event) |
void | removeEventListener (String type, IEventReceiver listener) |
boolean | hasEventListener (String type) |
ArrayList< ListenerItem > | getAllListeners () |
void | destroyAllListeners () |
void | clean () |
Static Public Attributes | |
static final String | EVENT_WAVE_STARTED = "WaveStartedEvent" |
The wave system is a system which tracks the current wave and switches to the next wave. It also spawns enemies on request and gives those enemies the components to work as 'wave slaves'.
com.mygdx.game.waves.WaveSystem.WaveSystem | ( | Playfield | playfield, |
IWaveDesigns | waveDesigns | ||
) |
This gives the tools needed for the WaveSystem to work
playfield | to give to the enemies as reference and to spawn the enemies on |
waveDesigns | to get waves from which are perfectly designed with the information given to them |
void com.mygdx.game.waves.WaveSystem.clean | ( | ) |
Prepares the system for Garbage Collection.
int com.mygdx.game.waves.WaveSystem.getCurrentWave | ( | ) |
Returns the wave number which is active
int com.mygdx.game.waves.WaveSystem.getCurrentWaveType | ( | ) |
Gets the type of wave currently active
void com.mygdx.game.waves.WaveSystem.updateWaveSystem | ( | float | deltaTime | ) |
Updates the system and makes it so all functionalities work perfectly together. NOTE: This method should be called every frame in order for the system to work!
deltaTime | represents the time which has passed between the last frame and the current |
Enemy com.mygdx.game.waves.WaveSystem.waveCreateEnemy | ( | Wave | wave, |
EnemyFactory.EnemyType | enemyType | ||
) |
Creates an enemy for the current wave if the current wave instance is given. Else it does nothing.
wave | which is the caller and the current active wave |
enemyType | to spawn |
|
static |