GithubHelp home page GithubHelp logo

rafaelcascalho / gametogether Goto Github PK

View Code? Open in Web Editor NEW

This project forked from u1st-games/gametogether

0.0 1.0 0.0 19.17 MB

Let's play games together

License: GNU General Public License v3.0

HTML 0.69% TypeScript 0.80% CSS 0.26% PHP 0.06% JavaScript 98.20%

gametogether's Introduction

Game Together

GameTogether's mission is to bring people closer together with computer games. It allows people to play web based computer games together in group video calls.

Click here for a short video introduction.

This project was bootstrapped with Create React App.

Getting started

Join our trello board.

Join our Discord server.

npm i npm start, then navigate to http://localhost:3000.

I am not sure how much documentation people need or want, so please don't hesitate to ask me (leeondamiky on slack) any questions or request additions or clarificaiton to the documentation. I'm happy to help :).

Development process

  • Create a new branch named based on the feature you are working on e.g. video-chat.
  • Once you've made your changes, submit a PR from your branch to master
  • After making any requested changes, your PR will be approved and merged!

Technical overview

The React applicaiton starts in src/index.js. From here App.js is loaded. You can follow the routing from here. Components are in src/Pages.

All of the logic for sharing the canvas stream and sharing mouse clicks and key presses is handled in useWebRTCCanvas.

If you would like to get involved with the webRTC code, I strongly recommend having a good read through this. It covers the history of webRTC, has some nice diagrams and code samples, and is an all round great in depth introduction.

In GameTogether webRTC is only used for sharing the game's screen and the mouse click and key presses. Everything related to the video call, that is the camera feed, the audio feed and screen sharing, is handled by the Vonage video API;

We interact with this API mainly through react-use-opentok. You can probably get by with just reading the react-use-opentok README.

If the source code is not already heavily commented, then it is in progress and will be shortly.

The basic flow for the game sharing is as follows:

  • When 'create game room' is clicked, a uid is generated and added to the url. This uniquely identifies this room. The name of the game is also added to the url, so that GameView knows which game to load
  • The userWebRTCCanvasShare hook will then call out to the signaling server over websockets. This will create a room with the same id on the socket.io server, which prevents clashes with signalling from other rooms.
  • If the user is the first one into the room, they will become the host, and their canvas will be streamed to everyone else who joins later. If the user is not the fisrt, they will become a guest. They will receive the canvas stream and send back their mouse positions and key presses, which the host will then apply to the game.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

Boring Stuff

GameTogether © Copyright, Nang Development Limited 2020. All Rights Reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

gametogether's People

Contributors

bradystroud avatar leonmanrolls avatar

Watchers

 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.