29 void setEnable(
bool enable)
override { (void)enable; }
65 float y =
static_cast<float>(
91 float y =
static_cast<float>(
98 .with<
ecs::Rect>(
"asteroid_rect", 0.0f, 0.0f,
117 int waveSize = 5 + (std::rand() % 4);
119 for (
int i = 0; i < waveSize; ++i)
122 float y =
static_cast<float>(
129 .with<
ecs::Rect>(
"enemy_wave_rect", 0.0f, 0.0f,
135 .with<ecs::Animation>(
"enemy_wave_animation", 0,
This file contains the component definitions.
Configuration constants for the game.
This file contains the IRenderer class declaration.
This file contains the Registry class declaration.
SpawnSystem(SpawnSystem &&)=delete
SpawnSystem & operator=(const SpawnSystem &)=delete
~SpawnSystem() override=default
void update(ecs::Registry ®istry, float dt) override
void spawnWave(ecs::Registry ®istry)
void spawnAsteroid(ecs::Registry ®istry, ecs::Asteroid::Size size)
SpawnSystem(const SpawnSystem &)=delete
SpawnSystem(eng::IRenderer &renderer)
SpawnSystem & operator=(SpawnSystem &&)=delete
void spawnEnemy(ecs::Registry ®istry)
void setEnable(bool enable) override
float m_asteroidSpawnTimer
eng::IRenderer & m_renderer
EntityBuilder & with(Args &&...args)
Class for managing entities and their components.
EntityBuilder createEntity()
Interface for the renderer.
constexpr float SPRITE_WIDTH
constexpr int ANIMATION_FRAMES
constexpr float SPAWN_RATE
constexpr float ROTATION_SPEED
constexpr float ANIMATION_DURATION
constexpr int FRAMES_PER_ROW
constexpr float SPRITE_HEIGHT
constexpr int FRAMES_PER_ROW
constexpr int ANIMATION_FRAMES
constexpr float SPRITE_WIDTH
constexpr float SHOOT_COOLDOWN
constexpr float SPRITE_HEIGHT
constexpr float SPAWN_RATE
constexpr float ANIMATION_DURATION
constexpr float ASTEROID_SMALL_RADIUS
constexpr float ENEMY_RADIUS
constexpr auto TEXTURE_ASTEROID
constexpr auto TEXTURE_ENEMY_EASY