Skip to content

darilrt/amuse_ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amuse ECS

Amuse ECS is a simple Entity Component System (ECS) library for c++. It is designed to be simple to use and easy to understand. It is also designed to be fast and efficient.

Example

#include <ecs.hpp>

struct Game
{
    struct Position
    {
        float x, y;
    };

    struct Velocity
    {
        float x, y;
    };

    Game(ecs::App &app)
    {
        app.register_component<Position>();
        app.register_component<Velocity>();

        app.system<Position, Velocity>()
            .on<ecs::Update>(
                [](ecs::App &app, Position &position, Velocity &velocity)
                {
                    position.x += velocity.x;
                    position.y += velocity.y;
                });
    }
};

int main()
{
    ecs::App()
        .use<Game>()
        .run();
    return 0;
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors