Coder Social home page Coder Social logo

pmt005 / rock-paper-scissors-online Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rohitmirchandani/rock-paper-scissors-online

0.0 0.0 0.0 1.14 MB

Play rock paper scissors with your friends and strangers from anywhere online.

Home Page: https://paper-scissor-rocks-online.herokuapp.com/

JavaScript 50.52% CSS 2.19% HTML 1.05% SCSS 46.20% Procfile 0.03%

rock-paper-scissors-online's Introduction

Paper Scissor Rocks Online

Enjoy the game of rock paper scissors from anywhere online with your friends and strangers. View the project live here.

Features

  • Completely responsive-Works on any device.
  • Interactive and fun- with animations and more.
  • Cross browser support.

Tech Stack

Client: React, Sass

Server: Node, Express, WebSocket, Socket.io

How it Works

  • After getting connected to the socket server, user is asked to enter a username. If the username is unique than the user will be taken to the game else will be asked again for a different username.

App Screenshot

  • Here user can send request to any player from the active players section or can accept/reject the request itself.

App Screenshot

  • when the other user accepts the request, the game get started between them.

App Screenshot

  • User select his choice b/w rock, paper and scissors and that choice cannot be seen by other player until both player make choices.

App Screenshot

  • Both player will play 5 rounds of the game and the winner will be declared accordingly.
  • If in any case the user quits the game or gets disconnected from the server, the game automatically ends on both sides telling the user of what happened.

Branches

There are two branches two this project, one is implemented over WebSocket library of node.js and other uses Socket.io for web socket server client communication.

  • web-socket This branch is implemented over the WebSocket library which is completely reliable on socket connections which is why it is difficult for me to deploy it over production as it is not allowed either to connect to ws protocol over https protocol or to create https server myself and run it over internet.
  • main This branch is implemented over the Socket.io connection which uses communicates through sockets primarily but if it fails to, then it fallbacks to http polling. currently this project is using ws connection only locally and globally it uses http polling.

Run Locally

Clone the project

  git clone https://github.com/rohitmirchandani/rock-paper-scissors-online

Go to the project directory

  cd rock-paper-scissors-online

Install dependencies

  npm install

Start the server

  node server.js

Start the client

  cd client
  npm run start

Future Scope

  • The app should work on web socket protocol in production also and use http polling as a fallback option.
  • Although the app is mobile is mobile responsive, It cannot connect to server on cellular networks. This is due to the Socket.io library and might be fixed through updates in future.

Authors

Feedback

For feedback, email [email protected].

rock-paper-scissors-online's People

Contributors

rohitmirchandani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.