A java project to make a tic tac toe game using joysticks
It is a simple tic tac toe game that has a nice GUI with it.
Here is the link to the source code and the entire project on github
Short Description
The whole project is implemented into one class. This class is separated into three main parts.
First part:
The GUI: It is the part where the 5 scenes and their texts, pictures, labels etc. are created. And based on the pressed key an Integer listener takes action depending on the current scene (move, change, play,……).
Second part:
The Joysticks: This part is made into an inner class, and it is where the joystick press is processed and converted into an integer
Third part:
The Logic: This is the part that is responsible for the Computer behavior during the game either (Easy – Medium- Hard) and also responsible for checking for the game winner.
Features:
- Play vs. PC or vs. Player (1 joystick or two)
- Game saving
- Turning the music and volume up/down or on/off
- Changing the game theme Red, Blue or Green
Note: the game won’t start unless there is a controller connected.
If this link helped you do something.