Git Product home page Git Product logo

javascript-snakes's Introduction

Javascript Snakes

Codeship Status for ahmed-bacha/javascript-snakes

An HTML5 Snakes Game

SUPPORTED BROWSERS

  • Chrome 13/14
  • Firefox 5/6
  • IE 9
  • Safari 5
  • Opera 11

KNOWN ISSUES

  • No sound FX in Safari because of delay when playing elements
  • Opera ignores volume and plays music/sounds very loud (and slightly delayed - uck!)

DEVELOPMENT

for all of the gory details checkout the blog article (coming soon)

The game is split into multiple source files (.js, .css and .png) that must be unified (and minified) for the final run-time game:

snakes.js      # the unified javascript file
snakes.min.js  # the unified and minified javascript file
snakes.css     # the unified css stylesheet
snakes.min.css # the unified and minified css stylesheet
fruit.png      # multiple fruit image spritesheet
head.png       # multiple snake head image spritesheet

If you have the Ruby language available, Rake tasks can be used to auto generate these unified files:

rake assets:create   # re-create unified javascript/css asset files
rake assets:resprite # re-create css sprite image files

These must be run every time you change one of the source files.

To make development easier, an auto-asset-generating Rack server can be used that will automatically recreate the unified asset files when they detect a change in the underlying source files:

rake assets:server   # run a simple Rack server that autogenerates unified assets files automatically on change

TODO

  • gameplay: specials - speedup, slowdown, shrink, temporary immunity
  • presentation: fixed width font for high score table ?
  • presentation: better styles when current score >= high score, new high score flash the moment score >= high score
  • presentation: game over message
  • usability: back button support (hashtag support for credits vs highscores vs game ?)
  • performance: use invalid rectangles to only update changed segments (will help when length > 100)
  • techdebt: use event driven pub/sub patterns instead of allowing snake/score/court to call back into game object
  • techdebt: move score rendering out of score class and into render class
  • techdebt: abstract credits list into re-usable Game.Credits class
  • techdebt: abstract highscore list into re-usable Game.Leaderboard class
  • future: player vs player
  • future: player vs AI
  • future: touch support

License

MIT license.

NOTE: the graphics and sounds included in this project are royalty free resources paid for and licensed from iStockPhoto, Lucky Lion Studios and Premium Beat. They are licensed ONLY for use in this project and should not be reproduced.

Thanks for your honesty!

javascript-snakes's People

Contributors

ahmed-bacha avatar jakesgordon avatar nbhrr avatar

Watchers

 avatar  avatar  avatar  avatar  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.