Project 1 Tic Tac Toe Assigned Mon Sep

  • Slides: 12
Download presentation
Project 1 Tic Tac Toe Assigned Mon, Sep 8, 2003 Due Mon, Sep 15,

Project 1 Tic Tac Toe Assigned Mon, Sep 8, 2003 Due Mon, Sep 15, 2003

Tic Tac Toe Read the handout. Download the files. n n n Tic. Tac.

Tic Tac Toe Read the handout. Download the files. n n n Tic. Tac. Toe. cpp player. h player. cpp set. h point 2. h Download the demo. n Tic. Tac. Toe. exe

Tic Tac Toe Your job is to provide the graphics for n n The

Tic Tac Toe Your job is to provide the graphics for n n The The game grid. X’s. O’s. winning line. You may also set the background color if you like.

Drawing the Game Grid The game grid is the traditional 3 x 3 board.

Drawing the Game Grid The game grid is the traditional 3 x 3 board. It consists of two horizontal bands and two vertical bands.

Drawing the Game Grid The 9 empty squares formed by the grid should have

Drawing the Game Grid The 9 empty squares formed by the grid should have length and width equal to cell. Width. The thickness of the grid lines should be equal to grid. Width.

Drawing the Game Grid The world coordinates are set up so that the origin

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. y grid. Width (0, 0) cell. Width x

Drawing an X The X should be drawn as a polygon. It should have

Drawing an X The X should be drawn as a polygon. It should have squared-off corners.

Drawing an X The diagonals should be drawn at 45 angles. Each side of

Drawing an X The diagonals should be drawn at 45 angles. Each side of a corner should be equal to ½ of grid. Width

Drawing an X The space between the X and the cell edges should be

Drawing an X The space between the X and the cell edges should be equal to cell. Pad

Drawing an O The thickness of the O should be grid. Width and the

Drawing an O The thickness of the O should be grid. Width and the padding should be cell. Pad. The O should be round like a circle. You must use polygons to draw the O.

Drawing the Winning Lines Horizontal and vertical winning lines are rectangles with length equal

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 grid. Width. 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.

Drawing Polygons Keep in mind that Open. GL assumes that all polygons are convex.

Drawing Polygons Keep in mind that Open. GL assumes that all polygons are convex. If you try to draw non-convex polygons, the results are unpredictable.