Giter Site home page Giter Site logo

game_engine's Introduction

Game Server Engine

This is the game server that is implemented at a basic level. It has wrapper capabilities that will be used to cater to various other plugins. At this time, it is not a plugin framework. Rather, there is one game that is integrated in to the code base.

Language

The server is implemented in Go using HTTP and JSON. To build, checkout the code, navigate to the repo's root and go install. If your Go environment is configured properly, it will work by $GOPATH/bin/game_engine. The process listens on port 3000 by default, but this can be changed in the code.

Games

The only game written at this time is Hangman. A Python cli and web clients are provided. After the man is hanged, the word will be returned. The Cambridge Dictionary API is used to provide a hint. After you build, it will be available locally -- with configured hostname -- at:

http://hangman.example.com/hangman.html

In the example above, websocket is listening on port 8080 and is proxied by mod_proxy_ws in Apache.

Configuration

There are no configuration capabilities at this time.

Protocol

The protocol is RESTful or Websocket over HTTP and uses JSON structures to both send and receive data in a syncronous style.

The flow will look like the following:

Received for a new game {"Cmd":"NEW","Hint":"a hint to the word","Curr":[0,0,0,0,0,0,0,0,0,0,0],"Missed":[],"Game":36,"Cred":"xxxxxxxxxxxxxxxxxxxxxxx"}

A guess from the client {"Cmd":"P1T","Play":"r","Gid":36,"Auth":"xxxxxxxxxxxxxxxxxxxxxxx"}

Response from the server {"Cmd":"P1T","Curr":[0,0,0,0,114,0,0,0,0,0,0],"Missed":[],"Game":36}

game_engine's People

Contributors

jhcook avatar

Watchers

 avatar

game_engine's Issues

Game length

Right now games expire too soon -- after a minute with no play or five minutes in total. Perhaps this is too short.

Answer on loss

It would be good to know the word after you have failed.

Word appears in hint

Although functionality exists to remove the word from the hint by blanking it out, or '-----', this needs further enhancement to be case insensitive.

Further cache checking

Cache checking is only happening with initial lookup and not inflection. If the word does not exist then inflection is used. But, the word returned on inflection is not looked up in the cache.

Answers with multiple words

If there is a space in the answer, that should be provided in the rune slice sent to the clients in order for the client to display the space.

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.