Coder Social home page Coder Social logo

clash-of-cats-game's Introduction

Goblin Base Server

Clash of Cats game

It's an html5 game developed with Phaser engine and Goblin Base Server demonstrating capabilities of Backend profiles, leaderboards, matchmaking, and real-time PvP.

Check out the demo here: http://rmg-clocats-dev.goblinserver.com. It's PvP only so try to play with your friend or in different browsers.

Find out more about Goblin Base Server here: https://github.com/red-machine-games/goblin-base-server

Running

It runs with Webpack:

  • Configure config.js;
  • Install dependencies with npm i command;
  • Run as development version: $ cd ./clash-of-cats-game && webpack;
  • Modify index.html;
  • Build a production version: $ cd ./clash-of-cats-game && webpack --config "webpack.production.js". Get build from dist.

Net code

Pvp-related cloud function stored at cloudFunctions folder. Real-time networking is powered by a deterministic ping-pong model.

Here are some theses about net code to help you understand it better:

  • Deterministic model powered by Mersenne twister random to be synced for both players - common seed provided by backend;
  • The model implements time traveling: it means that you can place opponent input in past time what will change the present;
  • The model fully syncs with opponent every 2.5 secs;
  • The client sends ~10 direct messages per second to the opponent. Turns are used only for a game over announcement;
  • Check out deterministic model's code here: https://github.com/red-machine-games/clash-of-cats-game/blob/master/src/model/deterministicPong.js

All networking is done with js SDK (https://github.com/red-machine-games/goblin-javascript-asset)

Check out SDK exposure here: https://github.com/red-machine-games/clash-of-cats-game/blob/master/src/controllers/ControllerHowardResponsibleForNetworking.js

License

All code and code-related files are under MIT license.

All images, sounds, and music under CC BY-NC-ND

clash-of-cats-game's People

Contributors

andrew-medvedev avatar

Watchers

 avatar  avatar

clash-of-cats-game's Issues

Can't resolve './itsNotForPublicGit.json'

This game doesn't run locally and thorws the error Can't resolve './itsNotForPublicGit.json'. Would be good to explain what is the itsNotForPublicGit.json and what it does in the config.js file.

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.