Kaolin Fire with GUD Issues 0 through 5

kaolin fire presents :: software :: Groovy Tetris



see other "falling tetronimoes" games...

It actually works again! - 2011-04-22

Windows 32bit: GroovyTetris.exe - no install, no sounds, no dlls, no nuttin. Source...you want source? Okay... (and I'm sorry! GroovyTetris.zip)





Notes to self: important to compile gtrisrc.o into it, which can be made from the gtris.rc; QtCreator default settings wanted wide characters for everything, Bloodshed (wxDev-C++) wanted otherwise. And then to get Qt/MingW to make it all static, I changed the release LFLAGS to just be "-static -enable-stdcall-fixup" instead of a ton of other stuff it had. Now it's 4 megs instead of 300k (including in that 300k all the files which I changed to linking in statically...what!?) Okay, stripping it takes it down to 500k, that's acceptable at this point. :)

Old rambly notes about where and how this atrocity was atrocitized

This was the first project I used to learn to do graphics outside of Java. Java makes graphics easy, and there's a lot of simple tutorials, etc. The WINAPI is a bit more kludgy (why did I start with that? I had immediate access to a windows box and it seemed that would make stuff easiest, and I'd just gotten a book)

Tetris not seeming to be a complicated game, I thought that would make things easy as well. And I knew I needed something very easy as my first project. I'd peeked at windows code before, and it had never made sense. Unfortunately, it didn't make sense to start with this time around, either.

I got a copy of DJGPP and RSXNTDJ, and went to work.

The book wasn't VERY helpful, but it did get me off my ass, so in that it was worth the money I spent on it, I suppose. I wouldn't recommend the book, though that's not entirely its own fault. It really wasn't directed towards what I wanted to do -- it focused around widgets, and how to use them. And a tetris game is not a set of windows widgets. (the book, BTW: _Windows 98 Programming from the GROUND UP_)

I copied a program out of the book that was basically just a window that knew how to close when you clicked on the kill button: A Windows '98 Skeleton

This was a great start and had me very enthused. I spent a little time thinking about what I wanted, and added the simplest menu. Trapping the keystrokes was easy, and adding a timer wasn't too much either. Figuring out a bitmap setup that worked that I could print to the screen wasn't bad, but I was using expensive calls. I just couldn't figure out how to do anything more direct. I played with algorithms until I got a semi-trippy background, and I had a game... that worked... really slowly, with a pretty lame animated background. I didn't touch it for a few months.

In the meantime, I had a Partition Magic accident, and wound up having to reformat my drive. [I eventually realized it was a drive problem, really, and not just a software fucked up thing, and bought a new drive... :sigh:] I was never able to get DJGPP and RSXNTDJ set up quite right again. So I cast around, and finally a friend gave me an old copy of Visual C++. Version 4. But it was something, and my program needed help.

Unfortunately, it wasn't the simple matter of cut and paste that I'd hoped it would be. If I remember right... (things are fuzzy) my program didn't come close to compiling with Visual C++. I learned the IDE a little, enough not to completely hate it, and a few days later I had the program running again, albeit with some added comments and constant by Microsoft, that I didn't understand well enough to take out. I made the background a lot more interesting, made some blits work better, and sent it out again. This time, some people actually looked at it. ;)

A few months later, a friend gave me an old version of Code Warrior. I deleted Visual C++ (I really couldn't stand it) and checked out what the hype was with Code Warrior. I was amazed. It seemed... intelligent. Well made. Again, my code didn't compile straight, but it just took a little figuring out the ide to get that going. I added a smiley-face to the intro screen and made it blink mega-man style. That added a LOT of personality to the game. I also added two things people asked for: a bar showing the extent of where the pieces could be moved to, and a "next piece" indicator.

Next... It really needs to be rewritten from scratch, for a couple of reasons. It needs to be easily portable to gtk+ (linux) -- which means moving graphics routines and logic routines apart from eachother, and contemplating the threading a little more fully. And it needs to be made more modular so that it can be extended better, and I can figure out where things are going wrong. As well, I've got a strange "crashing" problem that I haven't managed to track down, but I'm sure stems from my not understanding windoze.

Oh yeah. I need to figure out how to include versioning. And add copyright notices and copyleft notices and all that business.