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]

Properties

Versions0.1, 0.2
Change logNone available
Dependenciesbase (>=2 && <=4), cairo (>=0.9.13), containers (>=0.1.0.2), gtk (>=0.9.13), haskell98, mtl (>=1.1.0.1) [details]
LicenseBSD3
AuthorAndrew Calleja
Maintainerdrewcalleja@gmail.com
CategoryGame
Home pagehttp://lambdacolyte.wordpress.com/2009/08/06/tetris-in-haskell/
Executables4Blocks
UploadedFri May 7 18:55:25 UTC 2010 by AndrewCalleja
DistributionsNixOS:0.2
Downloads890 total (46 in last 30 days)
Votes
0 []
StatusDocs pending
Build status unknown [no reports yet]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

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!

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