Download presentation
Presentation is loading. Please wait.
Published byOswald Doyle Modified over 9 years ago
1
Project 1 Tic Tac Toe Assigned Mon, Sep 8, 2003 Due Mon, Sep 15, 2003
2
Tic Tac Toe Read the handout.handout Download the files. TicTacToe.cpp player.h player.cpp set.h point2.h Download the demo. TicTacToe.exe
3
Tic Tac Toe Your job is to provide the graphics for The game grid. The X’s. The O’s. The winning line. You may also set the background color if you like.
4
Drawing the Game Grid The game grid is the traditional 3 x 3 board. It consists of two horizontal bands and two vertical bands.
5
Drawing the Game Grid The 9 empty squares formed by the grid should have length and width equal to cellWidth. The thickness of the grid lines should be equal to gridWidth.
6
Drawing the Game Grid The world coordinates are set up so that the origin (0, 0) is at the lower left corner of the game grid. x y (0, 0) cellWidth gridWidth
7
Drawing an X The X should be drawn as a polygon. It should have squared-off corners.
8
Drawing an X The diagonals should be drawn at 45 angles. Each side of a corner should be equal to ½ of gridWidth. ½ of gridWidth
9
Drawing an X The space between the X and the cell edges should be equal to cellPad. cellPad
10
Drawing an O The thickness of the O should be gridWidth and the padding should be cellPad. The O should be round like a circle. You must use polygons to draw the O.
11
Drawing the Winning Lines Horizontal and vertical winning lines are rectangles with length equal to the size of the game grid and width equal to gridWidth. The diagonal winning lines are similar to the diagonals of the X, but they extend from one corner of the game grid to the other.
12
Drawing Polygons Keep in mind that OpenGL assumes that all polygons are convex. If you try to draw non-convex polygons, the results are unpredictable.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.