When you first start coding in C/C++ your first programs are done in the console. The problem with the console nowadays is that the conio.h library no longer lets you do all the fun things it used to, like set the text color, set cursor position, clear the screen, etc. You can only print text out in a stream just like the olden days of the 70′s and teletype printers. Lame.
This is the problem that all beginning game coders run into and it really takes some of the fun out of learning when you can’t even sit down and try to write Pac-Man in text mode.
So I poked around and found a little snippet of code, added my own functions and now I have a nice little text console library you can use. Just add the console.h and console.cpp files into your empty Win32 console project and you can actually make text games. Without this kind of library you can’t really make any kind of fun text game other than an adventure.
I threw together a short sample program to demonstrate what you can do. It’s a simple maze that has a random exit (‘X’ in it; touch it and you win. The source is named main.cpp. The game? ULTRA-X OF THE FORBIDDEN REALM!
To add even cooler stuff to your console games you should download FMOD and link it into your project. Instructions on how to do this are on FMOD.ORG and are easy to follow. Imagine that – a text game with background music and sound effects.
Grab the code here (Windows only)