@hackage cadence0.1.0.0

An ECS-based 2D game framework

Cadence

cadence is a video game framework built on-top Apecs and SDL, providing tools to allow people to get up and running easily with apecs and sdl2 for 2D game development in Haskell. More specifically, the package provides tools to minimise the boilerplate of SDL, and allow users to cleanly do rendering using a Type system. Additionally, since under the hood the package uses sdl2, users are able to freely control the window, renderer, etc. through utilising sdl2's API.

High-Level Overview

Below is a high-level overview of what cadence currently provides:

  • Built-in rendering - through using a Type system and apecs Component system, users are able to avoid manually doing rendering calls in SDL by calling a single function to do it for them, allowing for layered rendering, camera manipulation, and more. This rendering is also optimised, such as employing frustum culling.
  • Automated frame handling and running of game loop - cadence exposes a run function which handles frame deltas, exact time deltas, and more to accurately run your game loop to the desired frame rate, with frame-independent time deltas.
  • Automated animation handling - textures simply need to be specified as an Animation, and cadence will handle the progressing of animations through sprite sheets for you, as well as the displaying of them during the rendering pipeline.
  • Streamlined asset loading - textures and fonts can be loaded easily into corresponding maps, making use of the flyweight pattern for optimised memory usage, and reducing errors on your end.

Below are links to help people get familiar with the package and what it provides, as well as Apecs and SDL:

Examples

Two examples are currently bundled with Cadence. To run them, clone the repository and execute either of the following:

  • stack run noughts-and-crosses
  • stack run hungeon