byke is an Entity Component System (ECS) library for Go, inspired by the Bevy API.
Although still under development, it already includes a wide range of features. Documentation and examples will improve in the near feature.
-
Schedules and SystemSets: Organize systems and define execution order.
-
Resources: Inject shared data into systems.
-
Queries: Supports filters like
With,Without,Added, andChanged. Also supportsOption[T]andOptionMut[T]. -
Events: Use
EventWriter[E]andEventReader[E]to send and receive events. -
States: Manage application state with
State[S]andNextState[S].- Supports
OnEnter(state)andOnExit(state)schedules. - Emits
StateTransitionEvent[S]during transitions. - Allows state-scoped entities via
DespawnOnExitState(TitleScreen).
- Supports
-
Commands: Spawn/despawn entities and add/remove components.
-
Type Safety: Avoids the need for type assertions like
value.(MyType). -
Entity Hierarchies: Support for parent-child relationships between entities.
The bykebiten package provides basic integration with Ebitengine:
- Starts and manages a game loop
- Provides resources for window config, screen size, mouse input, and more
- Handles sprite rendering with support for z-ordering, anchor points, and custom sizes
- Propagates transforms through the entity hierarchy
Check out the examples for a look at how everything comes together.
Note: This README and some documentation was refined using generative AI, but all code in this project is handwritten.