I am tying to create a tictactoe game for learning purpose. I created the variables and objects kept X and O and the grid as separate sprite object. Please have a look at the attached screenshot. When trying out the events, the first click is OK it either places X or O based on the random turn, but from the second click, it places both X and O at the same time.
I tried the example game that was readily available but its events were different and I could not find “compare the number value of a scene variable” this condition was nowhere to be found.
Hey, the problem is that both events are executed if Turn = 0. The first event changes Turn to 1, this meets the condition Turn = 1 in the second event so it also gets executed.
If you build your event like this, Turn is checked for its value at first to either create X or O, then it’s changed after that.
It’s not clear from your screenshot what’s the purpose of the Placed variable, but I assume it should be changed once a square is occupied. I used a boolean in my example, but you can keep the number variable if you want.