Giter Club home page Giter Club logo

rps-multiplayer's Introduction

ROCK PAPER SCISSORS

Overview


In this assignment, create Rock Paper Scissors game,as multiplayer game, all with the help of Firebase.

Requirements


  • Create a game that suits this user story:

    • Only two users can play at the same time.

    • Both players pick either rock, paper or scissors. After the players make their selection, the game will tell them whether a tie occurred or if one player defeated the other.

    • The game will track each player's wins and losses.

    • Throw some chat functionality in there! No online multiplayer game is complete without having to endure endless taunts and insults from your jerk opponent.

Files


Technologies Used


  • HTML
  • CSS Bootstrap
  • JavaScript to make the page dynamic
  • jQuery for Dom Manipulation
  • Firebase Database for data storage

Code Explanation


  • CSS Bootstrap was used to arrange the page into columns, tables and form.
  • A form was implemented to add the login details.
  • Firebase is used to store the data remotely so that other player must be able to view the status of game.
    • Code and Syntax for push the data to firbase.
    var database = firebase.database();
    database.ref().push(data);
  • Event listener for login submit button is utilized:
    • To get the inputted data and store in a variable.
    • To push the data into firesbase.
    • To clear the input field.
  • Event listener for chat submit button is utilized:
    • To get the chat input and store in a variable.
    • To push the data into firesbase.
    • To clear the input field.
  • Functions to update data, display the data correctly on the output field & update the chat.
  • The data is retieved from the firebase is done in the function.
    • Code and Syntax for retrieving data.
    database.ref().on("child_added", function(snaphotChild){
    
    }
  • The reset function is called in regular intervals using setInterval().
    • Code and Syntax for setInterval().
    setInterval(reset,10*1000);

NOTE

rps-multiplayer's People

Contributors

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