j-toscani / king-pong

Braekout/Pong game made with React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KingPong

Play a classic against your friends. Online! On mobile and Desktop!

Usage

In order to install all dependencies use the following commands:

npm install
cd client
npm install

In order for the game to work, you have to make the following adjustments:

  1. open the file "socket-server.js" and choose a port you want the socket to run on.
  2. Go to the folder "pages" and open the "Main.js" file and look for the following line of code:
...
React.useEffect(() => {
const socket = io();
socket.emit("setname", getItem("nickname"));
...
  1. Add "http://127.0.0.1:" as an argument to the ìo() function. has to be the same port your server listens to.

For developement you can start the server and client at the same time by using the following command:

npm run dev

The game can be viewed here: https://king-pong-nf.herokuapp.com/;

About

Braekout/Pong game made with React


Languages

Language:JavaScript 96.5%Language:HTML 3.5%