https://github.com/ruilopesm/block-knight-li1
A recreation of the "Block Dude" old game made in Haskell using Gloss
https://github.com/ruilopesm/block-knight-li1
functional-programming game-development gloss haskell
Last synced: 3 months ago
JSON representation
A recreation of the "Block Dude" old game made in Haskell using Gloss
- Host: GitHub
- URL: https://github.com/ruilopesm/block-knight-li1
- Owner: ruilopesm
- Created: 2022-01-20T23:56:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-08-08T19:37:47.000Z (3 months ago)
- Last Synced: 2025-08-08T21:28:10.928Z (3 months ago)
- Topics: functional-programming, game-development, gloss, haskell
- Language: Haskell
- Homepage:
- Size: 12.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Block Knight
> 18/20 :star:
This game was developed during the first semester of the Software Engineering degree @ University of Minho.
The project consisted of recreating the old game BlockDude, with the freedom to add features and completely change the graphical appearance, which was, in this case, heavily inspired by Hollow Knight.
It was fully developed in Haskell and consisted of 6 tasks:
1. Verify if a given map is valid;
2. Construct and destruct maps (from type `[(Peca, Coordenadas)]` to type `Mapa` and vice-versa);
3. Instantiate `Show` class in order to display an output of the type `Jogo` as a String;
4. Update the current game state according to the player movements;
5. Create and implement game graphics, using Gloss.
6. Create a game bot to solve, in the minimum necessary player movements, a map.
## Game gallery

## Installing and running the game
**If you use any arch-based distro, head to the next section.**
Firstly, install Haskell Platform (GHC and Cabal).
To do so, follow the instructions for your specific system at: [haskell.org/downloads](https://www.haskell.org/downloads/)
Finally, since the graphical interface of the game was developed using the [Gloss](https://hackage.haskell.org/package/gloss) library, you'll need to install it:
```bash
$ cabal update
$ cabal install --lib gloss
$ cabal install --lib gloss-juicy
```
Since I used some more external libraries, you'll need to install them too:
```bash
$ cabal install --lib strict-io
```
#### Cloning the repository
```bash
$ git clone git@github.com:ruilopesm/Block-Knight-LI1.git
```
#### Compiling
```bash
$ cd Block-Knight-LI1/src
$ ghc -package strict-io Tarefa5_2021li1g033.hs
```
#### Running
```bash
$ cd ..
$ ./src/Tarefa5_2021li1g033
```
## Arch-based distros
Since arch is not that good working with cabal, I recommend you to use stack (you can install it with pacman).
Finally, since the graphical interface of the game was developed using the Gloss library, you'll need to install it:
```bash
$ stack upgrade
$ stack install gloss
$ stack install gloss-juicy
```
Since I used some more external libraries, you'll need to install them too:
```bash
$ stack install strict-io
```
#### Cloning the repository
```bash
$ git clone git@github.com/ruilopesm/Block-Knight-LI1.git
```
#### Compiling
```bash
$ cd Block-Knight-LI1/src
$ stack ghc --package gloss --package gloss-juicy --package strict-io Tarefa5_2021li1g033.hs
```
#### Running
```bash
$ cd ..
$ ./src/Tarefa5_2021li1g033
```
## Possible problems
In case you get an mpv error, you'll need to install it (as it was used to play audio inside the game).
Follow the instructions here: [mpv.io/installation](https://mpv.io/installation/)
# Developed by:
- [Rui Lopes](https://github.com/ruilopesm)
- Diogo Abreu