While asking some questions on IRC, someone asked me if I had put the project up on Hackage. It hadn't really occurred to me before - I thought of Hackage mainly for libraries. But I decided that there could be more examples of using SDL and the Haskell bindings for it.
The code can be found as a darcs repo at:
http://patch-tag.com/publicrepos/fallingblocks
And can be found on Hackage here:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/fallingblocks
Play is simple:
- Use the left/right arrow keys to move the block horizontally
- Use the up arrow to rotate the block
- Use the down arrow to move the block down more quickly
- Press p to pause/unpause (0.1.4 +)
- Press q to quit.
A few screenshots:
Finally, a video Don Stewart put up on YouTube. Ignore the errors - those should be fixed now.
Nice to see some haskell game code, i took some inspiration - hope you dont mind :)
ReplyDeleteI'm making a tetris clone to get used to haskell a bit, your code is really nice learning material! I was stuck on handling the SDL-events and your solution was really nice.