I made a simple tic tac toe game out of a 3x3 grid of squares. The squares have a script that changes the texture on mouse down depending on whos turn it is. Each successful turn it changes to the other player.
I currently have two scripts one attached to an empty which basicly chooses a random player to start the game and manages some events. The other attached to the grid squares to change the texture.
What I’m having trouble with is a way to detrimine if a player has won or if its a tie. I was thinking of assigning a vaule to a naught of -1 or cross +1 and adding the values of each row, column and diagonally but im having a hard time putting it into code.
Im probably overthinking it but some input would be appreciated.