Head to: github.com/junkdog/artemis-odb and click the green “Code” button → “Download ZIP.”
void processEntity(artemis::Entity &e) override { Position &pos = posMapper.get(e); Velocity &vel = velMapper.get(e); pos.x += vel.vx; pos.y += vel.vy; } }; artemis engine download
struct Velocity : artemis::Component { float vx, vy; }; Head to: github
#include <artemis/Artemis.hpp> // 1. Define components (plain data) struct Position : artemis::Component { float x, y; }; Velocity &vel = velMapper.get(e)
// 3. In your main(): create world, entities, and run int main() { artemis::World world; world.setSystem(new MovementSystem()); world.initialize();
public: MovementSystem() { setComponentMapper(posMapper); setComponentMapper(velMapper); }