Skip to content

rusi/canvas-demos

Repository files navigation

Canvas Demos

The purpose of this project is to create the same application using different HTML5 Canvas frameworks. The Maze demo is based on, and uses assets and code from Blockly's Maze: https://blockly-demo.appspot.com/static/apps/maze/index.html

You can see the demos for each of the frameworks here:

You can compare 'demo.js' and 'pegman.js' for each of the projects to see the differences for yourself.

(incomplete; not suitable or hard to use for this demo)

Other evaluations and comparisons:

The application uses the following features:

  • Images & Sprites
  • Animation & Transitions/Tweens

The application does not USE any of:

  • Drag-n-drop
  • Collision detection
  • Mouse & Keyboard events
  • Physics

PhaserJS - game engine

Phaser JS is a game engine build on top of Pixi JS.

Pros

  • Great documentation; lots of well organized examples.
  • Phaser.js IS a game development framework and as such, it makes it very easy to work with Sprites, Animations, Transitions.
  • Very simple to start with and allows you to create a full game within ~100 lines of code.
  • Easy to load and use tilesets.
  • Has several physics engines.

EaselJS - HTML5 canvas library

EaselJS - a Flash-Like Interface for the HTML5 Canvas. It is part of the CreateJS suite of JavaScript libraries; (from "Using CreateJS - EaselJS"):

Pros

  • Good documentation with examples; good set of tutorials and demos.
  • Handles SpriteSheets; easy to use/define animations and sprites.

Cons

Kinetic JS - for interactive web graphics

  • Tutorials - a handful of basic tutorials exist. However, I find Google & StackOverflow to be a lot more useful.
  • Documentation - documentation for the API exists. However, the documentation is missing basic examples.
  • User base & StackOverflow - it seems that there is a large user base and a lot of questions are covered and answered in StackOverflow.
  • It is NOT a game engine and as such not suitable for complex games. Can be used to implement simple board games or similar.

Pros

  • Easy and simple to use.
  • Has a number of basic shapes; supports
  • The "Tween" API is very nice and easy to use, and includes a number of Easings.

Cons

  • It would be useful to have a generic image/assets loader, even though it is easy to copy the image loader from the examples/tutorials.
  • The Sprite animation API is somewhat limited and does not have options not to loop animations; there are also no events when the animation ends, so you have to manually manage transitions, based on the current frameIndex.
  • Not able to flip sprite animations.

Fabric JS - simple Canvas library

  • Tutorials - 4-part tutorial exists which is helpful in learning how to use FabricJS (http://fabricjs.com/articles/).
  • Demos - good set of demos exist which show Fabric's functionality and strengths.
  • It is NOT a game engine.

Pros

  • Documentation is available, but doesn't have example usage.
  • FabricJS can be used to create a drawing tool, allowing users to draw and manipulate objects.

Cons

  • Does not provide image/asset loader.
  • Doesn't provide facilities to deal with tiles, animations, transitions, etc.

Panda JS - game engine

Panda JS is another game engine build on top of Pixi JS.

Pros

  • Encourages good object-oriented design and implementation

Cons

  • Documentation is not very detailed; doesn't have a lot of examples nor tutorials.
  • Hard to figure out; doesn't provide a minified js file, which makes it hard to 'install' and use.

Pixi JS - rendering engine

It seems that Pixi is designed as a fast and efficient rendering engine. It can be used for serious game development but it is NOT a game engine. Pixi is encouraging developers to extend existing basic classes, such as Sprite and TilingSprite, as a way to add new functionality. Other frameworks are designed to use their shapes and constructs to assemble and compose a scene.

It is not suitable to use Pixi JS for this demo, beucase Pixi is pretty low level for the purpose of the maze app. However, a number of game engines are built on top of Pixi which are used to implement this demo project.

Tutorials:

Pros

Cons

  • Unless using Spine, it does not provide an easy to use animations support. People usually extend Sprite or MovieClip to implement their own animation functionality.

Useful Comments / Links

Additional Resources

About

Evaluation (and example use) of HTML5 Canvas frameworks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published