The 4Blocks package

[Tags:bsd3, program]

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]


Versions 0.1, 0.2
Dependencies base (>=2 && <=4), cairo (>=0.9.13), containers (>=, gtk (>=0.9.13), haskell98, mtl (>= [details]
License BSD3
Author Andrew Calleja
Category Game
Home page
Uploaded Fri May 7 18:55:25 UTC 2010 by AndrewCalleja
Distributions NixOS:0.2
Downloads 1127 total (6 in the last 30 days)
0 []
Status Docs not available [build log]
All reported builds failed as of 2016-10-24 [all 14 reports]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for 4Blocks

Readme for 4Blocks-0.2

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 :) 
- Enjoy!