you could line the Xs & Os up in snap to grid (have 5 X actors & 5 Os) then when X1 position Y = X2 Position Y = X3 Position Y you have 3 in a row. Same with X. Does anyone have the math for diagonal?
The screen will be divided downward and sideways 3 pieces. 3x3. Does anyone have the math to see if one actor is exactly up 1/3 the scene & right 1/3 the scene? O wait would that just be it? If actor position X is X1.PositionX + (1/3*Screen Size Width). Would it be like that?
Maybe not the simplest way but couldn't you have nine integer attributes called space1, space2 ... space9. Set them to 1 when X positioned in the space or to 2 when 0 positioned.
Then after every move check with a set of rules
If space1=1 & space2=1 & space3=1 then X has a row (horizontal) If space1=1 & space4=1 & space7=1 then X has a row (vertical) If space1=1 & space5=1 & space9=1 then X has a row (diagonal)
and do every permutation and same rules for the noughts. If space1=2 & space2=2 & space3=2 then 0 has a row (horizontal)
NextGenEntertainment said: The screen will be divided downward and sideways 3 pieces. 3x3. Does anyone have the math to see if one actor is exactly up 1/3 the scene & right 1/3 the scene? O wait would that just be it? If actor position X is X1.PositionX + (1/3*Screen Size Width). Would it be like that?
Oh, you mean the actual positioning. Why not snap the pieces into the closest one of the nine positions? You could use invisible actors as the hotspots and use magnitude to work out how close when touch released
Comments
Then after every move check with a set of rules
If space1=1 & space2=1 & space3=1 then X has a row (horizontal)
If space1=1 & space4=1 & space7=1 then X has a row (vertical)
If space1=1 & space5=1 & space9=1 then X has a row (diagonal)
and do every permutation and same rules for the noughts.
If space1=2 & space2=2 & space3=2 then 0 has a row (horizontal)
Might be long way round but will work no?
Thank You
_________________________________________________________________________________
GameSalad Community Project
Quality Game Making Service
1 On 1 Project Help