Skip to content
/ KUGE Public

Ketepincho's Unbelievable(Useless) Game Engine.

License

Notifications You must be signed in to change notification settings

lyquid/KUGE

Repository files navigation

K.U.G.E

Ketepincho's Unbelievable(Useless) Game Engine.

Entity Component System

Heavily based in Austin Morlan's ECS.

Usage instructions:

  1. Create a Manager object. It will automatically create the other sub-managers: ComponentManager, EntityManager and SystemManager.
kuge::ECS::Manager manager {};
  1. Register your Systems:
manager.registerSystem<PhysicsSystem>();
manager.registerSystem<RenderSystem>();
  1. Register your Components:
manager.registerComponent<Transform>();
manager.registerComponent<RigidBody>();
  1. Generate a signature for each of your Systems. The signature is a std::bitfield that informs which Components needs a System to perform it's task. For example:
kuge::ECS::Signature signature {};
signature.set(manager.componentID<Gravity>(), true);
signature.set(manager.componentID<Transform>(), true);
signature.set(manager.componentID<RigidBody>(), true);
manager.setSystemSignature<PhysicsSystem>(signature);

Pro tip: use Manager's systemSignature<T>() to retrieve a System's signature.

  1. Create some entities:
auto entity {manager.createEntity()};
  1. Add the desired Components to your Entities :
manager.addComponent(entity, Transform{});
  1. On your update loop update() the Systems:
manager.system<PhysicsSystem>()->update();
  1. Hopefully enjoy!

Releases

No releases published

Packages

No packages published