Skip to content
Isaac Sukin edited this page Aug 4, 2013 · 8 revisions

Start here for documentation on using H5CGB.

Motivation

This project makes starting an interactive 2D Canvas application fast and easy, even for developers who have never used Canvas before.

Description

This project includes a modified version of HTML5 Boilerplate and adds some Canvas-specific boilerplate and a couple of useful JavaScript abstractions. In other words, it includes the code you were going to write for every canvas project anyway, plus a few tools for rapid prototyping of common features.

See also the complete explanation of everything the project provides.

Download

Download or clone:

git clone https://github.com/IceCreamYou/HTML5-Canvas-Game-Boilerplate.git myproject

Get Started

See the Getting Started section of the README. You should be able to open js/app/main.js and start developing immediately. Also check out the walkthrough, which introduces the H5CGB rapid prototyping tools by building a Mario-style platformer game.

Though this project was designed as a boilerplate, the code is modular, so you can optionally choose not to use certain parts or to drop in the JavaScript into another project.

API Documentation

You can read the full documentation generated from the code or an explanation of everything the project provides.

Good to Know

This project provides boilerplate code and rapid prototyping tools, but there are many other great libraries you may be interested in using to help provide advanced functionality.

In addition to the JavaScript logic in main.js, there are a couple of generic files included in this project (for example, the favicon image) that you may want to customize.

Also check out the performance tips. For those interested in the details of how some of the boilerplate works, most of the code should be pretty clear, and there is also a high-level explanation of some of the trickier and more interesting parts.

Examples

See the examples directory and guides.