4Blocks: A tetris-like game (works with GHC 6.8.3 and Gtk2hs 0.9.13)

[ bsd3, game, program ] [ Propose Tags ]

A tetris-like game implemented in Haskell and making use of Gtkh2s (works with GHC 6.8.3 and Gtk2hs 0.9.13)

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.1, 0.2
Dependencies base (>=2 && <=4), cairo (>=0.9.13), containers (>=, gtk (>=0.9.13), haskell98, mtl (>= [details]
License BSD-3-Clause
Author Andrew Calleja
Maintainer drewcalleja@gmail.com
Category Game
Home page http://lambdacolyte.wordpress.com/2009/08/06/tetris-in-haskell/
Uploaded by AndrewCalleja at 2010-05-07T18:55:25Z
Reverse Dependencies 1 direct, 0 indirect [details]
Executables 4Blocks
Downloads 3174 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-10-24 [all 14 reports]

Readme for 4Blocks-0.2

[back to package description]
4Blocks is a tetris-like game implemented in Haskell and Gtk2hs for an AI project.

Some notes:
- The game currently works only with GHC 6.8.3 due to its use of Gtk2hs 0.9.13.
- I haven't tested with anything later but it is likely to fail due the fact that 
  later versions of Gtk2hs have a different system of handling events.
- To make this project compatible with later versions of GHC and Gtk2hs two changes are required:
    - Remove the function "permutations" which was copied from a later GHC base library
    - Alter key-event handling to the version used by later Gtk2hs: some functions (in CommandKeys.hs)
      were simply introduced in order to disallow some of the keys used in the game (namely rotation) to trigger
      continuously when a key is held pressed. I believe this kind of behaviour can be managed automatically
      with Gtk2hs' new event handling mechanism, however I haven't had time to recode accordingly myself.
- I hope to write a patch for this in the near future.

To play:
- [1]          Starts a Game
- [P]          Pause/Resume Game
- [Esc]        Exit Game
- [A]/[Left]   Shift Left
- [D]/[Right]  Shift Right
- [W]/[Up]     Hard Drop
- [S]/[Down]   Soft Drop
- [Q]/[,]      Rotate Left
- [E]/[.]      Rotate Right

Some gameplay features to add in the future:
- T-spin points
- Wall-kick
- Sounds!

- Feel free to criticize (constructively) my code as this has been my first real forray into Haskell.
- Email me on drewcalleja@gmail.com :) 
- Enjoy!