second commit

This commit is contained in:
2026-07-09 12:30:40 +01:00
parent 06bcac9bf7
commit 1bf565b543
22 changed files with 969 additions and 792 deletions
+14 -14
View File
@@ -1,14 +1,14 @@
// src\movement.cpp
#include <entt/entt.hpp>
#include <components.hpp>
void update_movement_system(entt::registry& registry, float dt) {
// We get Position and Velocity, but EXCLUDE entities that have the Player tag
auto view = registry.view<Position, Velocity>();
view.each([dt](Position &position, Velocity &velocity) {
// This will only run for pipes, enemies, or particles!
position.x += velocity.dx * dt;
position.y += velocity.dy * dt;
});
}
// src\movement.cpp
#include <entt/entt.hpp>
#include <components.hpp>
void update_movement_system(entt::registry& registry, float dt) {
// We get Position and Velocity, but EXCLUDE entities that have the Player tag
auto view = registry.view<Position, Velocity>();
view.each([dt](Position &position, Velocity &velocity) {
// This will only run for pipes, enemies, or particles!
position.x += velocity.dx * dt;
position.y += velocity.dy * dt;
});
}