Computer Science Canada

Tic Tac Toe Help

Author:  king202 [ Tue May 18, 2004 9:58 am ]
Post subject:  Tic Tac Toe Help

Hi all I am in Grade 10 and i am learning computer science and i need some help with a game i am making. I would like to make a Tic tac toe Game. Now i got the board down But now I would like to no how you would get the X and O to show up when you click on the screen. if someone can help me that would be great

Author:  Dan [ Tue May 18, 2004 12:01 pm ]
Post subject: 

well you are going to need to use the mouse comands to check where the mouse is and if the buttion is down.

then you are going to need to uses some closion dection like code to check if the mouse is in one of the boxs.

now if the mouse is in the box and the buttion is down and it is player Xs turn draw and X there if it is player Os turn draw a O.

http://www.compsci.ca/v2/viewtopic.php?t=6 - on how to use the mouse comands

http://www.compsci.ca/v2/viewtopic.php?t=75 - on collision dection


To draw the X and O you should probly uses draw font to keep things easy and since u will know witch box was cliked from above info on mouse and collision dection you could just put the code to draw the x or o in that if stament and since u know where the box is you could just set the cordents for font draw to the center of the box.


: