Public Repository

Last pushed: 2 years ago
Short Description
Sample Html Mulitplayer Game using Nuggeta GameServer
Full Description

#HowTo :

First of all you need to run a gameserver.
see nuggeta/gameserver docker container

create a file named config.js to set public ip/port of the gameserver
so add this two variables :

  • gsIp=127.0.0.1 / put your gameserver host public ip or hostname /
  • gsPort=5010 / put your gameserver port (default 5010) /

on centos host you may need to run this to allow access to config.js within the container.

  • chcon -Rt svirt_sandbox_file_t $(pwd)

run the nginx webserver hosting the game

  • docker run -d --name sample-game -p 80:80 -v $(pwd)/config.js:/usr/share/nginx/html/js/config.js:ro nuggeta/sample-game-html
  • open you browser to http://gsIp
    you should see Wainting Player...

  • open a second tab to http://gsIp and the game start between the two players
    you can click or use keyboard to move the player

Docker Pull Command
Owner
nuggeta