Git Product home page Git Product logo

haskellroguelike's Introduction

Haskell Roguelike

This is the beginning of a roguelike programmed in Haskell. It is intended as a challeng/learning exercise, and will likely be perpetually incomplete.

Haskell Roguelike

Requirements

Playing

Download an install The Haskell Platform. The game can be run either interactively from the GHCi prompt, or compiled.

GHCi

From the command line, launch ghci. At the prompt, type:

Prelude> :load RogueLike.hs
*Main> main

Compilation

From the command line, execute:

ghc RogueLike.hs

Launch the resulting compiled file.

Gameplay

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.

Game display

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

Controls

The controls are as follows:

  • W: move up
  • A: move left
  • S: move down
  • D: move right
  • P: 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!

TODO:

  • 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

haskellroguelike's People

Contributors

wlmiller avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.