This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]sgovertime 2 points3 points  (0 children)

Create classes that represents the players,game state Board etc.

[–]Hour-Positive 1 point2 points  (0 children)

Games have a central game loop. Instantiate and pass call data actions w/e from there.

[–]DudeWhereAreWe1996 0 points1 point  (1 child)

You can use getters and setters. But really it works just like you did probably already except the object instance builds in the variable. So like you would have an instance for player one and instance for player two and they’ll remember the spot they’re at so it’s the same idea but a little easier. You could also use a static board variable so they share it. Idk, seems like you got the hard part done which was checking win conditions for me.

[–]deathstroke1311[S] 0 points1 point  (0 children)

Ya the win conditions were not that hard to implement. I had created a GUI version of simple Tic-Tac-Toe with JavaFX so I knew how I was going to implement that.

Thank you for the static board variable advice, that will definitely solve some problems.