Entityx usage and fixed release types

This commit is contained in:
Julian Nießner
2018-05-28 20:20:29 +02:00
parent fc1d615f91
commit 247eda236d
14 changed files with 142 additions and 19 deletions

View File

@@ -0,0 +1,16 @@
#include "MovementSystem.h"
#include "components/Direction.h"
#include "components/Position.h"
void MovementSystem::update(entityx::EntityManager &es,
entityx::EventManager &events,
entityx::TimeDelta dt)
{
for (entityx::Entity entity : es.entities_with_components<Position, Direction>())
{
entityx::ComponentHandle<Position> position = entity.component<Position>();
entityx::ComponentHandle<Direction> direction = entity.component<Direction>();
position.get()->x += direction.get()->x * dt;
position.get()->y += direction.get()->y * dt;
}
}