GitXplorerGitXplorer
y

NodeRunner

public
1 stars
2 forks
0 issues

Commits

List of commits on branch master.
Verified
943d252bba844da6c8ae57efa87cab7a6c721a61

In-Browser Documentation

aatharva-sarage committed 6 years ago
Unverified
e8028999598ad4a3056c2cdec4bdb33a26fbe432

forgot to save readme and commited

yyashkhasbage25 committed 6 years ago
Unverified
239e7f840be8733859177a97034f5ec78458a67c

Merge branch 'master' of github.com:IITH-SBJoshi/concurrency-3

yyashkhasbage25 committed 6 years ago
Unverified
7b3a00d454448a597720f36d331c50dd2259b1cb

readme done. wiki done. need sprite update

yyashkhasbage25 committed 6 years ago
Verified
9a27d6d6ca370fdb81bd75e17526d6fb2745b5f7

Updated README.md

aatharva-sarage committed 6 years ago
Unverified
9807c3db70cb6bf382e9735008c716fa98b65aad

game exits on completion

yyashkhasbage25 committed 6 years ago

README

The README file for this repository.

CircleCI

PoPL-2 Project

NodeRunner

Group: concurrency-3

NodeRunnerScreenShot

Dependencies

Tools Used

  • godoc
  • golint
  • go vet
  • go test

Concurrency involved

  • Health of both players decays with time. This is done by two go routines that run concurrently. When a player acquires a gem, the upadte has to be made safely. Mutex locks assure this safety.
  • The events sent to server, have to be processed to update the game status. However, the message acceptance from the players have to be fair. This is ensured by the select-case block to extract from channels.
  • Bots do not move randomly. They use Dijkstra's algorithm to find the path to nearest player. This involves execution of 6 Dijkstras in parallel. 6 channels are used in 6 go routines to accomplish the task.
  • The server object is shared by both clients and all kinds of changes to it have to be done safely.
  • Reading and writing from websockets can also happen concurrently. This also requires locks.

CI

  • travis-ci(never worked)
  • circle-ci

Controls

  • Up : Move up
  • Down : Move down
  • Right : Move right
  • Left : Move left
  • Space : Teleport

Run Game

  • Set IP and Port of server at web/js/game.js and web/js/wait.js in the statement
ws = WebSocket("ws://<Server-IP>:<Server-Port>/<somehting>");
  • create a server using
go run main.go
  • Connect to server through your browser.(Internet Explorer is not allowed)

  • PLay the game. Start the server again to play more!!!!!!!.

Game Rules

Survive as long as you can to be the winner. 3 ghosts will always be on your tail so beware of them. But you have 10 teleports to jump to random locations. Green colored gems will increase your health and the red one will decrease opponent's health. So, choose your gems wisely. Once a gem is acquired, new gem will appear at some other location. Gems have a special property: green gems either multiply or add a value to your health, whereas red ones either subtract or divide opponents health.

In-Browser Documentation

run

godoc -http=:6060

Connect to localhost:6060 in your browser and traverse to github.com/IITH-SBJoshi/concurrency-3/