war of nations
War of Nations is a simple turn-based strategy game, where your only goal is to survive the onslaught of enemy players, and destroy them all. Make sure to take high ground so you can see your enemies coming before they can see you! But make sure you don't get stuck in the low ground, or else you won't be able to see much.
about the project
This is the freshman year game project for the first semester. I had about 2 months to design and program a game. However, there were many restrictions imposed on what I could do. Firstly, it had to be compiled with Cygwin. Secondly, it had to use only printf and scanf for input and output. And lastly, it had to be written in C.
There was also a choice to either make a game with DigiPen's own ProjectFun, or write the game in C. I chose to do write the game in C.
Looking at the screenshots of the game probably won't help you understand what's going on. The green numbers are your unit types. The different numbers represent different unit types. You usually have a few turns to get to where you want to be before the enemy arrives. Once they do, you can see them as red numbers. Moving your units is a complicated mess, but it gets the job done. It isn't pictured below, though. The game is brutally hard, and the high scores go up very high that you probably won't ever get the top score.
The colors were achieved using escape sequences unique to Cygwin. Most of the time I used this to change the current printing color:
printf("%c[%d;%d;%dm", 27, effect, fg, bg);
effect - Effect applied on the text. 0 - 8. Usually either 0 or 1 (bright colors).
fg - Foreground color. 30 - 37.
bg - Background color. 40 - 47.
After I used this, anything printed to the console would be in the color specified, until it was changed again.