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.
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
Haskell
100.0%
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.
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
Haskell
100.0%