Skip to content

Dyspersja/WebSocket-Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

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

Screenshots

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

image

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

image