Up to this point we have been laying the foundation for developing a game. So far we’ve setup a basic structure to handle common routines, we’ve setup a special class to handle events, and we’ve also setup a class to handle a few surface functions. In this tutorial we’ll take all those things, combine them, and create a tic-tac-toe game. Don’t worry, things should be pretty simple. Use the last tutorial to build off of.
The first thing we are going to need to do is plan our game. From experience, we know that tic-tac-toe has a 3×3 grid, where you place X’s and O’s. So, we know that we will need 3 graphics, one for the grid, one for the X, and one for the O. We don’t need multiples of the X or O, because we can draw them in the program as many times as we like. Lets eliminate this first step. Our grid is going to be 600×600, and our X’s and O’s will be 200×200 (1/3 of the area).