Rick's Tech Talk

All Tech Talk, Most of the Time

Finishing Tetris

I finished my version of Tetris, and it's now available for you to try on your PC. I set a goal of finishing the game before Super Bowl XLV, and there turned out to be a lot to.

Icons - I created icons using GIMP. Creating icons can be an involved process, but the key for me was creating a "duplicate" layer. The "ICO" format is a specific format, and GIMP knows what to do with the additional layer. Referencing the icon in the program involved creating an "RC" file (containing the line IDR_ICO_MAIN ICON "rtet.ico"), and compiling it with windres.

rteticon.png

Installer - I used Jordan Russell's Inno Setup. This is a superb tool/utility. One tricky thing for me was learning how to add a menu choice to bring up the README.txt.

shortcut.png

The key was specifying an entry in the "[Icons]" section. The name of the section is misleading, but the documentation helps out here.

inno.png

Final Build - During development, my compiler always passed in the "-g" switch, which enables debugging. For the "release" build, I passed the "-O" for an optimized executable file. I also had pass in the -mwindows switch to prevent the CMD window from appearing whenever the program ran. Finally, I ran my executable through strip, to reduce the final executable size.

Have fun playing it! I sure had fun writing it!

Tags: