This is the beginning of a roguelike programmed in Haskell. It is intended as a challeng/learning exercise, and will likely be perpetually incomplete.
- ansi-terminal:
cabal install ansi-terminal
Download an install The Haskell Platform. The game can be run either interactively from the GHCi prompt, or compiled.
From the command line, launch ghci
. At the prompt, type:
Prelude> :load RogueLike.hs
*Main> main
From the command line, execute:
ghc RogueLike.hs
Launch the resulting compiled file.
The current goal is to kill all of the enemies (%
) on the level (by walking over them). The exit (<
) is locked until all enemies are cleared. There is an enemy count at the bottom of the terminal.
Below are listed the characters which are displayed on the screen and what they represent:
@
: player character%
: enemy>
: level entrance<
: level exit.
: empty floor#
: wall
The controls are as follows:
W
: move upA
: move leftS
: move downD
: move rightP
: exit
Note: GHCi does not support buffer-free input in Windows; currently, you must press Enter
to have the game interpret your input. Entering a string of characters and then pressing Enter
will result in the character executing each action in the string in sequence!
- Movement of the player character
- Line-of-sight calculation and indication on the level map
- Automatic generation of random level maps
- Player statistics; e.g. health
- Non-player characters
- Battle
- Items