It’s been a fantastic couple of years for HTML5 games, for both consumers and developers. In fact, HTML5 is turning into a great game development platform, rapidly catching up to the ubiquity of Flash-based browser gaming. Are you a game enthusiast who wants to turn game ideas into reality? This tutorial will provide a comprehensive view over how to build a browser game with LimeJS. However, a basic knowledge of HTML, CSS and JavaScript is strongly recommended.

Some of the things you’ll be learning here are:

  • Creating a game that works on iPhone, iPad, Android and Desktop
  • Using the touchscreen in your games.
  • Creating cool animations and transitions.
  • I will be using 100% free tools and frameworks.
  • Code snippets at the end of each lesson that you can use as starters for your own games.

Solitair game structure before compilation. These are the code snippets you can use later for your game.

LimeJS is an open-source platform for creating 2-D games. With LimeJS, you can choose whether you want HTML or Canvas rendering; this means that the game can be built as elements in the DOM, or using the canvas instead.  It’s very simple to introduce changes, which can be done at the director or even layer level. The good news is LimeJS has added WebGL support, but there is more information about it on their site.

An interesting approach is that LimeJS uses Google Closure, which provides an ability to define an inheritance structure. Google Closure provides a class structure where we obtain the ability to define custom objects based on existing ones.

I’m a big fan of web standards and the open source movement. I am a freelance web developer, write all code markup, and styles by hand, and I am obsessing over best practices. If you have any questions related to JavaScript, feel free to contact me through the contact site.

Sign up for free to receive notifications on updates for this tutorial via email through a widget in your blog’s sidebar on the left hand side.

The game we are about to develop can be played here:

The path to Solitair in browser game build with LimeJS

Other sources: 30 incredibly addictive HTML5 games