repak shawahb
the triumph of the grill

^

   

rsw@jfet.org


blogroll

       
Mon, 14 Sep 2009

the (not) long awaited...

...is here! You'll need Graphics.UI.Gtk (a.k.a. Gtk2Hs), Graphics.Rendering.Cairo (also part of Gtk2Hs, but sometimes distributed separately), and Control.Concurrent (I use an MVar for game state in case I want to do something crazy later).

For now, this is just a normal tetris game. Ctrl-R restarts, Ctrl-Q (or Alt-Q, or the Quit button) quits.

Enjoy.


[ permalink | 5 comments ]

I don't wanna sound like an Egyptian or nothin'

...but I really like libcairo. Over the weekend I wrote a Tetris-like game using cairo via Haskell's Gtk2Hs bindings.

I have one more obvious bug to fix before I release the source, so I'll probably post tonight once it's fixed. After that, I'm going to implement a bastard function, then scale it out to two players and allow each player to choose the other's next piece if they want.

Obviously we'll need a computer opponent mode as well...

(If you're wondering, I'm hovering around 300 lines of code, but that's a bit on the high side because I went for readability over smallest LoC, and I basically wrote a library of game state transforms and collision predicates and didn't use all of them.)


[ permalink | 0 comments (add one you lazy bastard!) ]