repak shawahb
it's like killing and eating a real live angel

^

   

rsw@jfet.org


blogroll

       
Sat, 19 Sep 2009

now with squid bits!

Your brain cannot repel entertainment of this magnitude!

TriHs r465 adds a major feature: two player mode!

True to my word, I've added in the "asshole button" for each player: swap your opponent's next piece for a random one. I don't know yet whether it's a useful addition or not, but at the very least simple strategies like denying them the I or giving them a neverending stream of S and Z are probably annoying enough to get you punched in the face.

I've also added shadow mode, even though I think it's totally cheese. By default it's off, but you can activate it with <Ctrl>-s.

The other somewhat major change I made was breaking the drawing module out of Main. This is a logical partitioning of functionality, and probably makes it a bit easier to swap out Cairo for, e.g., OpenGL. Not that I have any plans to do this, but perhaps someone else will be adventurous. (Hippo, I'm looking in your direction.)

Update: r466 corrects the previous loss condition to bring it in line with the official rules.


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

Tue, 15 Sep 2009

damnit Jim

Because Jim is such a nitpicking bastard, and after reading the Wikipedia page, I have an update for you. (Seriously, thanks for the feedback, Jim.)

r460 has the following changes:

  • CW and CCW keybindings (that you might hate, depending on your keyboard; just fix it if you don't like mine)
  • Instant (hard) drop
  • Hard drop on the final "down" press (or just wait for the soft drop as before)
  • Updated scoring system so that it rewards multiples a bit more
  • Changed the color scheme to match The New Tetris.
  • a README file!

As I add minor updates, I'll just post them here. (Major ones will go in their own entry.) Here's a summary of every version I've posted so far:

  • r457 - first release
  • r458 - added Makefile
  • r460 - fix detailed above
  • r461 - fixed an erroneous return value from the keyboard handler that was really harmless
  • r462 - took focus off the Quit button so that space bar doesn't cause the program to exit
  • r465 - see 2009091901
  • r466 - fixed loss condition to bring it in line with the official rules


[ permalink | 2 comments ]

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!) ]