Giter VIP home page Giter VIP logo

tap-trap's Introduction

Tap Trap

Clone of Gnome's "Same Game" written in Javascript.

See: http://2tap.com/projects/tap-trap/
Play: http://2tap.com/taptrap/

The game is written using Javascript (on top of XHTML) on the client side, with a server component written in PHP which handles the high scores etc.

Every player is initially assigned a UUID which is then sent with each subsequent request to the server. The UUID and other game options (such as player name) are stored in a local ‘data store’ (which packs multiple key/value pairs into a single cookie).

At the end of a game, the player’s score is sent to the server and is logged in the high score table. To avoid a player cheating during this phase (by manually constructing an end-of-game request), each game is initiated by retrieving a unique game key from the server which acts as a seed to construct the board layout. During the score logging phase, the game sends the unique game key as well as a list of moves the player performed. As the board can be reconstructed from the game key, it is then possible for the server to validate the game, based on the board and the moves submitted, and to independently calculate the player’s score.

The only way of cheating that I can come up with would be to write a program to solve a given board based on a game key. Of course, anyone with this much time on their hands is welcome to their top spot in the high score table!

The client uses AJAX (I must say I despise this term and the hype surrounding it but if you can’t beat them…) to communicate with the server so only one XHTML page is ever loaded.

UTF-8 is used in all communication between the client and server, as well as for all data storage areas. Effectively, this means the high-score table can be litered with filth in a language I cannot hope to understand.

tap-trap's People

Contributors

russx2 avatar

Stargazers

 avatar

Watchers

 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.