• Stars8.8k+16 tuần này
  • Forks628
  • Watchers78
  • Issues26
  • Ngày tạo26/08/2018
  • Cập nhật gần nhất30/10/2026
  • Ngôn ngữC
  • Giấy phép—
README.md26.4 KBRaw

flecs

Version MIT Documentation actions Discord Chat

Flecs is a fast and lightweight Entity Component System that lets you build games and simulations with millions of entities (join the Discord!). Here are some of the framework's highlights:

Flecs Explorer

To support the project, give it a star 🌟 !

What is an Entity Component System?

ECS is a way of organizing code and data that lets you build games that are larger, more complex and are easier to extend. Something is called an ECS when it:

  • Has entities that uniquely identify objects in a game
  • Has components which are datatypes that can be added to entities
  • Has systems which are functions that run for all entities matching a component query

For more information, check the ECS FAQ!

Show me the code!

C99 example:

typedef struct {
  float x, y;
} Position, Velocity;

void Move(ecs_iter_t *it) {
  Position *p = ecs_field(it, Position, 0);
  Velocity *v = ecs_field(it, Velocity, 1);

  for (int i = 0; i < it->count; i++) {
    p[i].x += v[i].x;
    p[i].y += v[i].y;
  }
}

int main(int argc, char *argv

Nội dung README thuộc về SanderMertens và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/SanderMertens/flecs