1 / 12

Project 1

Project 1. Tic Tac Toe Assigned Mon, Sep 8, 2003 Due Mon, Sep 15, 2003. Tic Tac Toe. Read the handout . Download the files. TicTacToe.cpp player.h player.cpp set.h point2.h Download the demo. TicTacToe.exe. Tic Tac Toe. Your job is to provide the graphics for The game grid.

kata
Download Presentation

Project 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Tic Tac Toe • Read the 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. y gridWidth (0, 0) cellWidth x

  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.

More Related