Real-time multiplayer Tic Tac Toe game created using WebSockets. It offers a variety of features to enhance gaming experience:
- Username Selection: Users can choose a username that will distinguish them from other players.
- Play vs AI: Users can play against an AI opponent.
- AI Difficulty Levels: Users can choose from four different AI difficulty levels to match their skill level.
- Play vs Players: Users can play against other real players.
- Random Opponent Queue: Users can join a queue to find and play against a random opponent.
- Create a Room: Users can create a private room for playing with friends.
- Join a Room by ID: Users can join a specific room by entering its unique ID.
- Spectate Games: Users can spectate all currently ongoing games.
Below is step by step instruction on how to run this project on a local machine:
- Clone the Repository: Start by cloning this repository to your local machine using the following command:
git clone https://github.com/Dyspersja/WebSocket-Tic-Tac-Toe.git
Alternatively, if you don't have Git CLI installed on your computer, you can download the repository by navigating to the <> Code tab and selecting Download ZIP.
- Install Dependencies: Navigate to the project directory and install necessary dependencies using npm install:
cd WebSocket-Tic-Tac-Toe
npm install
NOTE! Please ensure that Node.js is installed on your computer. The project will not be able to run without it.
- Start the Server: Launch the application by running the following command:
npm start
Now that the application is up and running, you can navigate to http://localhost:8000 to view the application and start playing!
To test real-time communication between players, you can open multiple browser tabs and simulate multiple players.
The application was tested on mobile devices and it works great.
Of course, application also works in standard computer web browsers.