An open API service indexing awesome lists of open source software.

https://github.com/dyspersja/websocket-tic-tac-toe

Multiplayer Tic Tac Toe game created using WebSockets.
https://github.com/dyspersja/websocket-tic-tac-toe

tic-tac-toe tic-tac-toe-game tic-tac-toe-javascript websocket-game websockets

Last synced: about 1 month ago
JSON representation

Multiplayer Tic Tac Toe game created using WebSockets.

Awesome Lists containing this project

README

          

# WebSocket-Tic-Tac-Toe
Real-time multiplayer Tic Tac Toe game created using WebSockets. It offers a variety of features to enhance gaming experience:

## Features

1. **Username Selection:** Users can choose a username that will distinguish them from other players.
2. **Play vs AI:** Users can play against an AI opponent.
3. **AI Difficulty Levels:** Users can choose from four different AI difficulty levels to match their skill level.
4. **Play vs Players:** Users can play against other real players.
5. **Random Opponent Queue:** Users can join a queue to find and play against a random opponent.
6. **Create a Room:** Users can create a private room for playing with friends.
7. **Join a Room by ID:** Users can join a specific room by entering its unique ID.
8. **Spectate Games:** Users can spectate all currently ongoing games.

## Setup Instructions

Below is step by step instruction on how to run this project on a local machine:

1. **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**.

2. **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.

3. **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](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.

## Screenshots

The application was tested on mobile devices and it works great.

![image](https://github.com/Dyspersja/WebSocket-Tic-Tac-Toe/assets/146620220/f985aebd-2357-4b83-9235-ba39680a6c6e)

Of course, application also works in standard computer web browsers.

![image](https://github.com/Dyspersja/WebSocket-Tic-Tac-Toe/assets/146620220/814db710-3f33-4bd6-ae85-3bbcc8332a92)