17 for (
auto&& [transform, parallax] : view) {
18 transform.position.x -= parallax.
speed * dt;
20 float scaledWidth = parallax.textureWidth * transform.scale.x;
21 if (transform.position.x <= -scaledWidth) {
22 transform.position.x += scaledWidth * 2.0f;
Interface for ECS systems.
void update(float dt) override
Update system logic for one frame.
ParallaxSystem(ecs::Registry &r)
Abstract base class for all ECS systems.
auto zipView(this Self &self)
Tag component indicating that an entity should loop its position when it exits the screen (infinite s...
float speed
Scrolling speed of the parallax layer.