Git Product home page Git Product logo

blockarena__kha_multiplayer_game's Introduction

BlockArena

Networking / Multiplayer example for Kha. It demonstrates the general network setup, replicated variables which are automatically sychronized between the clients (with the server being in charge in case of conflicts), manual RPCs (server only or on all clients), object ownership via session.me.id as well as the ping measurement.

Note that the same code is run both on the server and on all clients while Kha handles the synchronization, so there is no client- or server-specific code in BlockArena itself.

Running the example

Currently, networking is only supported in the html5 backend (for the clients) and requires a dedicated node.js server.

First time setup

Build the server with node Kha/make node, then navigate to "build/node" and run npm install.

Testing

Build the server with node Kha/make node, then navigate to "build/node" and start the server with node kha.js.

Build the client with node Kha/make html5, then open the index.html in "build/html5" twice (the example requires two clients).

Debugging

To debug the client, just run the project from KodeStudio like you would with any other Kha project.

To debug the server, open the folder "build/node" in KodeStudio.

Naturally, you need to run the other client / server in addition to that. If you are on windows you can just run my testscript (_test.bat). It compiles both backends, starts the server and opens one client with your default browser. Then you can start debugging the client in KodeStudio right away.

blockarena__kha_multiplayer_game's People

Contributors

aoe-maniac avatar robdangerous avatar

Watchers

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