Spawns a Bydos enemy at a random position right of the screen every 1.5 seconds.
More...
#include <systems/EnemySpawnerSystem.hpp>
|
| | EnemySpawnerSystem (rtk::factory::EntityFactory &factory, busEvent &eventBus, std::function< bool()> canSpawn=nullptr) |
| | Creates the spawner.
|
| |
|
void | onStart (rtk::ecs::Registry &) override |
| | Logs that the system is loaded.
|
| |
| void | update (rtk::ecs::Registry ®, float dt) override |
| | Advances the spawn timer and spawns an enemy when it expires.
|
| |
|
void | onStop (rtk::ecs::Registry &) override |
| | Does nothing.
|
| |
Spawns a Bydos enemy at a random position right of the screen every 1.5 seconds.
◆ EnemySpawnerSystem()
Creates the spawner.
- Parameters
-
| factory | Factory used to build the enemyBidos blueprint. |
| eventBus | Bus on which EnemySpawnedEvent is published. |
| canSpawn | Optional predicate, spawning pauses while it returns false. |
◆ update()
| void rtk::systems::EnemySpawnerSystem::update |
( |
rtk::ecs::Registry & | reg, |
|
|
float | dt ) |
|
inlineoverride |
Advances the spawn timer and spawns an enemy when it expires.
- Parameters
-
| reg | Registry receiving the new enemy. |
| dt | Elapsed time since the last frame, in seconds. |