3#include "Logger/Logger.hpp"
4#include "components/Bullet.hpp"
5#include "components/Dead.hpp"
6#include "components/Transform.hpp"
9namespace rtk::systems {
26 void onStart(rtk::ecs::Registry &)
override {
27 LOG_INFO(
"Load Bullet System");
34 void update(rtk::ecs::Registry ®,
float)
override {
38 for (
auto entity : view) {
39 auto *transform = transforms.get(entity);
43 if (transform->position.x > 1920.0f) {
52 void onStop(rtk::ecs::Registry &)
override {}
Marks bullets that went past the right edge of the world as dead.
Definition BulletSystem.hpp:18
void onStart(rtk::ecs::Registry &) override
Logs that the system is loaded.
Definition BulletSystem.hpp:26
void onStop(rtk::ecs::Registry &) override
Does nothing.
Definition BulletSystem.hpp:52
void update(rtk::ecs::Registry ®, float) override
Adds Dead to every bullet whose x is greater than 1920.
Definition BulletSystem.hpp:34
Marks an entity as a projectile.
Definition Bullet.hpp:17
Tag marking an entity for destruction at the end of the frame.
Definition Dead.hpp:17