Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusikkala authored Jul 10, 2021
1 parent f290026 commit e957b53
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,33 @@ shorter](https://en.cppreference.com/w/cpp/language/namespace_alias) or put
## Building docs & examples

To build the Doxygen documentation and examples:
```
```sh
meson build
ninja -C build # for examples
ninja -C build docs # for docs
```sh
```

## Usage

1. Create your component types. Any type can be used as a component!
```
```cpp
struct health
{
int hit_points;
};
```cpp
```

2. Create some event types. Any type can be used as an event!
```
```cpp
struct hit_event
{
monkero::entity damaged_entity;
int damage;
};
```cpp
```

3. Create a system & list emitted and received events!
```
```cpp
class health_system:
public monkero::system,
public monkero::receiver<hit_event>
Expand All @@ -88,10 +88,10 @@ public:
});
}
};
```cpp
```

4. Add entities, components and systems to the ECS instance!
```
```cpp
monkero::ecs ecs;

ecs.add_system<health_system>();
Expand All @@ -108,7 +108,7 @@ while(main_loop)
gas.tick();
//...
}
```cpp
```
Advanced usage examples of components, systems and events can be found in the
`examples` folder along with a complete usage example of the system as a whole.

0 comments on commit e957b53

Please sign in to comment.