A simple implementation of the old-school Tic-Tac-Toe game made in Python, and provided graphical user interface with PySimpleGUI. The game main features are that it's a multiplayer game, and it can be played with hand gestures.
This game is a standard Tic-Tac-Toe game where the main playground is a 3x3 board where 2 players play at the same time. One player comes after the other, and they are putting two different letters on the cells, 'O', and 'X'. When a player has 3 of its letters in a row, column, or diagonally, wins. A Match consist of 3 rounds, where a TIE game will be repeated until there is a winner.
- 3 type of gamemodes: PVE, PVP, and SamePC
- The PVP mode allows you to play with players across the internet
- Hand gesture recognition allows you to select cells on the board with your hands. With the closed palm you can move the 'cursor', while opening the palm marks your letter
- Personalizable gaming experience by changing background colors, selecting preferred camera, and showing the grid on camera for better navigation
- Python 3.10 or higher
- PC or Laptop running Linux/Windows OS
- Stable internet-connection
- Storage space: 450 MB at least
- Memory: 512 MB RAM at least
- Dedicated or Integrated Webcam with a minimum resolution of 480x640
- Dedicated or Integrated Graphics Card
- OS: Windows 10 Pro x64
- CPU: Intel i3-10110U
- GPU: Integrated Intel UHD Graphics
- Memory: 8 GB RAM
- Integrated Webcam with a resolution of 1280x720
- Internet download speed: 60 Mbps
-
Make a project folder, and navigate to it:
-
Clone the repository:
git clone https://github.com/DavidArthur2/Tic-Tac-Toe-demo
-
Navigate into the project folder:
cd Tic-Tac-Toe-demo/src -
To create a virtual environment, run these commands on a terminal(Command Prompt on Windows, and Terminal on Linux):
python -m venv <name_of_virtualenv>
-
To activate Virtual Environment on Windows, run the following command on CMD:
source <name_of_virtualenv>/bin/activate
To activate Virtual Environment on Linux, run the following command on Terminal:
<name_of_virtualenv>/Scripts/activate.bat
-
The python environment setup:
pip install -r requirements.txt
Note: On Linux, run sudo apt-get install python3-tk to install tkinter.
Optional if you want a more good-looking Font type, you can install it with the following steps(For Windows):
-
Navigate to the Fonts directory on Windows(Usually this is the location):
cd C:\Windows\Fonts -
Paste the following code, where <your_project_folder> should be replaced with the project folder location:
copy "<your_project_folder>/Tic-Tac-Toe-demo/src/UI/fonts/Algerian Regular.ttf"
Execute the following command in your terminal in your project folder/src:
python main.py
- Run the game using the instructions above.
- Register an account, or login if you already have one.
- Select the game-mode you want to play(PVE,SamePC,PVP)
- (PVP mode) Select your enemy
- Play by the following rules!
- Players: 2 (X and O)
- The game is played on a 3x3 grid.
- Players take turns placing their mark in an empty cell.
- The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins.
- If the grid is full and no player has achieved three in a row, the game ends in a draw, and the round restarts.
- There are total of 3 rounds, and best of 3 wins the match.
src: Main Python and resource filesREADME.md: This documentation file.docs: Documentations and diagrams.