This is the implementation of 2D tile-based game engine in Haskell done as a part of my Bachelor Thesis "Implementing 2D Game Engine in Haskell". Game events and engine loop are implemented using the concept of monads and mutable IORef references.
Note: Many fatures are missing and project should be treated as a proof-of-concept instead of fully operating library.
The created library delivers ready-to-use components such as:
-
Rendering module with simpe
RenderCommandpipeline (greatly inspired by HGE2D) -
Simple, naïve maps and assets loading
-
Simple keyboard handling
-
Window and Content Manager
-
Collision detection
The project was developed using stack tool and GHC 7.10.3 compiler. [TODO: Check against other versions].
Rendering pipeline and graphics components are programmed using
SDL2
Haskell bindings.
Before jumping straight for stack install (if you have
one already), make sure you have libsdl2 on board:
$ sudo apt-get install libsdl2
Or you may want to compile it yourself.
There are some issues with stack configuration on Windows but if you want,
you can
give it a try.
Additionally, you may need
this.
- Get the sources
git clone https://github.com/drobnik/valhalla-engine
cd valhalla-engine
- Install the depedencies
stack install --dependencies-only
- Build the project
stack build
- Enjoy
If you want to see sample game* graphics and movement, type:
stack exec valhalla-engine-exe
* - the game logic and collisions are turned off for now, sorry about that.
[TODO]
