Sign inSign up

nuggeta/sample-game-html

By nuggeta

Updated almost 11 years ago

Sample Html Mulitplayer Game using Nuggeta GameServer

Image
0

1.2K

nuggeta/sample-game-html repository overview

#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

Tag summary

Content type

Image

Digest

sha256:51f0513f5

Size

39.3 MB

Last updated

almost 11 years ago

docker pull nuggeta/sample-game-html