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

^

   

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 ]

writebacks

jim wrote


no makefile?
how do you rotate left vs right?
no instant drop?
the long delay between pieces when you hold the down arrow is strange.
your rotation system is weird and you're missing wall kicks etc. see http://tetris.wikia.com/wiki/Tetris_Guideline

rsw wrote


Check again. Forgot to add it 'cause I'm dumb.

All the things you mentioned will be added.

Also, I'm not really a fan of wall kicks, but I'll have a look at the guideline. It's pretty simple to add them.

rsw wrote

actually...
Wall kicks aren't required as far as I can tell.

What specifically do you not like about my rotations? I try to keep the "center of gravity" fixed for the pieces, and I specifically adjusted the rotations work that way. What is it you don't like?

Instant drop and shadows are coming.

I didn't bind keys for both rotations, but it's trivial to add. I only made "up" CCW because Katherine said she preferred that (see? user feedback). Now I see that "up" should be instant drop, so I suppose I'll go to "," and "." for CCW and CW or something like that.

The delay comes because pieces only "lock in" during interrupts. This is laziness on my part, and I might decide to keep this one a "yes it's broken but I just don't care."

jim wrote


Wall kicks: sure but they're nice. If I push a button to rotate a piece, I clearly want it to rotate, so it shouldn't just do nothing just because the piece is near a wall.

Rotations: yours are unusual. especially the long piece, which doesn't go around the center at all. plus they're just different from any other tetris variant I've played, it feels weird.

"lock in" during interrupts: it's terrible, the delay between drop and lock isn't even constant because it depends on when you dropped the piece. "it's too hard to fix" is pretty lame...

rsw wrote


It's not hard to fix, actually. It just pollutes the relative purity of the division bewteen interrupt handler and keyboard handler. It's basically one line to fix it (and I mean _change_ one line, not add).

Anyway, instant drop kind of implies instant lock-in, so you'd figure I have to implement this eventually anyway.

Regarding the rotations: I looked at the SRS ("Super Rotation System," standard on new Tetris games), and the thing I don't like about it is that the rotations don't preserve the lower boundary of the piece. Rotations that allow you to move the piece vertically introduce twists, which I think are pretty much cheating.

Most implementations of wall kicks make twisting even easier.




post a comment:

Save name/email/&c
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Comments:
Key:
(Required)