Skip to content

A game written using Elerea and Haskell to learn about larger-scale (relative to my other projects) game development using FRP.

License

Notifications You must be signed in to change notification settings

crockeo/whatisthisgame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whatisthisgame

This is a game (titled whatisthisgame) written in Haskell! The graphics are rendered using OpenGL, and the game logic is modeled using Elerea.

Links follow:

WARNING: The code in its current state is a little dirty. I'm working on a 'do it first, then make it beautiful' basis. I'll come back and polish everything up after the project is reasonably complete.

Installation

For building this you have two options: static or dynamic linking (in the scope of the Haskell libraries). The default state of cabal file is to prefer dynamic linking (because once everything is set up, it's quicker to compile and recompile), but it may be easier for someone to compile it statically.

Before we do anything specific to each kind of build, we need to grab the source from this repo:

$ git clone https://github.com/crockeo/whatisthisgame.git
$ cd whatisthisgame/
$ cabal sandbox init # Optional

Dynamically

The main difference between static and dynamic compiling is making sure the packages you're using are compiled to shared libraries.

$ cabal install --only-dependencies --enable-shared

If you're building from already having some static libraries (such as OpenGL and OpenGLRaw) you may need to reinstall those as --enabled-shared as well.

For instance, when using Haskell Platform version 2014.2.0.0, I needed to reinstall OpenGL, OpenGLRaw.

$ cabal install OpenGL-2.9.2.0 OpenGLRaw-1.5.0.0 --reinstall --enable-shared

Statically

To switch this project back to static compiling, you just need to edit the whatisthisgame.cabal file to remove the -dynamic flag from the ghc-options line near the bottom.

-- Before edit
ghc-options: -O2 -Wall -fno-warn-unused-do-bind -dynamic

-- After edit
ghc-options: -O2 -Wall -fno-warn-unused-do-bind

Building

After you've set up the project for either kind of building, the actual process is generic.

# To build
$ cabal build

# To run
$ cabal run

# To install
$ cabal install

About

A game written using Elerea and Haskell to learn about larger-scale (relative to my other projects) game development using FRP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published