34 lines
785 B
C++
34 lines
785 B
C++
#pragma once
|
|
|
|
#include "Component.hpp"
|
|
|
|
/**
|
|
* Spawns and despawns gameplay objects to keep the run effectively infinite.
|
|
*/
|
|
struct SpawnComponent : public Component {
|
|
/**
|
|
* Next world-space X coordinate where a spawn roll will happen.
|
|
*/
|
|
float cursorWX = 0.0f;
|
|
/**
|
|
* How far ahead of current scroll we keep content generated.
|
|
*/
|
|
float spawnAheadDistance = 1200.0f;
|
|
/**
|
|
* How far behind the camera entities are culled.
|
|
*/
|
|
float despawnBehindDistance = 180.0f;
|
|
/**
|
|
* Minimum spacing between spawn rolls.
|
|
*/
|
|
float minGap = 160.0f;
|
|
/**
|
|
* Maximum spacing between spawn rolls.
|
|
*/
|
|
float maxGap = 320.0f;
|
|
|
|
void Setup() override;
|
|
void Update(float dt) override;
|
|
void Cleanup() override;
|
|
};
|