A modular game engine and ECS for Haskell. An ECS is a modern approach to organizing your application state as a database, providing patterns for data-oriented design and parallel processing.
- Type-safe: Queries and systems use fully type-checked access with compile-time gurantees
- High-performance: Components are stored by their unique sets in archetypes
- Reactive: Component lifecycle hooks enable change-detection and event-based state management
- Modular design: Aztecs can be extended for a variety of use cases
newtype Position = Position Int deriving (Show)
instance (Monad m) => Component m Position
newtype Velocity = Velocity Int deriving (Show)
instance (Monad m) => Component m Velocity
move :: (Monad m) => Query m Position
move = queryMapWith go query
where
go (Velocity v) (Position p) = Position $ p + v
app :: Access IO ()
app = do
spawn_ $ bundle (Position 0) <> bundle (Velocity 1)
positions <- system $ runQuery move
liftIO $ print positions
main :: IO ()
main = runAccess_ app-
The core ECS
-
OpenGL rendering support
-
OpenGL text rendering support
-
GLFW window support
-
Transform components
Aztecs' approach to archetypical ECS is inspired by Bevy and Flecs.
A fantastic lower-level (but higher-performance) Haskell ECS Apecs