39

I'm attempting to build a tile-based game in JavaScript, using HTML5 canvas. There are many engines to choose from, such as

... and the list goes on and on.

However, there does not seem to be one de facto standard among all these different implementations. Essentially I am looking for the jQuery of JavaScript game engines. One that is backed by a (larger) community, has excellent documentation and is actively maintained. Most of these just seem like one-man projects to me.

What is the de facto standard for 2D game engines in JavaScript?

Additionally, I would be very interested in experiences with actual implementations (other than demo Pong and Pac-Man games).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Daniel Sloof
  • 12,568
  • 14
  • 72
  • 106
  • I suppose, HTML5 games is a too "young" field, to have some "leader" like `jQuery` for simple clientside. – kirilloid Apr 16 '12 at 10:12
  • I don't think there is any defacto standard for a simple reason: there is not that much javascript games. If you are not prepared to face the hell of browser compatibility/performance you better stay away from javascript only games. – Schmurfy Apr 16 '12 at 10:18
  • 1
    @Schmurfy: well, for example MelonJS seems to support the major browsers. Even with just IE9 (or 10) support, that would be a reasonable option for me. I'm not shy of profiling or debugging either... so that shouldn't be a limitation to the answer. – Daniel Sloof Apr 16 '12 at 10:26
  • 3
    A very well established option is Phaser: https://github.com/photonstorm/phaser. It's in wide commercial use, has a very active community, is built from the best 3rd party components (Howler for audio, Pixi for display, p2 for physics), it's integrated with the Tiled map editor, and its API is a good compromise between granularity and readability. Like everyone else I don't think there will ever be a standard for Game Engines in HTML5, the field is just too diverse. Just pick one you like. – d13 Mar 22 '14 at 14:50

5 Answers5

14

There isn't one right now and I would go on to say that there may never be one in the same way that there is jQuery, for the simple fact that most (commercial) games are going to want to be mercilessly performant, which means using as little extra cruft as possible, and many of these libraries add unnecessary things or performance hits where it may not be desired.

That is not to say they won't be used at all. All of the above libraries are probably good for a great deal of small(er) games.

But I imagine on large projects many studios will find themselves starting with a library until they hit a performance wall, and then writing all the components they used in the library themselves in order to keep only the thin bits that they need.

If there is one that becomes popular it will almost certainly be be modular like MooTools (the second most popular JavaScript library), where it tries to be compact and lets you select only the components you want to use. I imagine you'll find a lot of games in the future that have a very small engine just for handling sound or just for handling images or a 2D isomorphic board, instead of games that have a (large) library that attempts to handle every possible kind of 2D game.

Anyway, if you simply want to find the most popular JavaScript engine then your best bet over the coming months is to use Google (page rank) to determine most popular. Searching for "2D game engines JavaScript/Canvas" will give you a pretty good idea of which is the most linked-to (popular) library at any given time.

(After all, try searching Google for "JavaScript library". You can guess the first result I bet!)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Simon Sarris
  • 62,212
  • 13
  • 141
  • 171
6

I found this question while searching for an engine of my own. I just want to add this site here because it offers a good overview over a lot of HTML5 game engines:

http://html5gameengine.com/

There are also some nice filters like licenses/costs, release date and user rating.

(PS: I'm not related to this site in any way)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
pensan
  • 420
  • 8
  • 11
1

I agree with the others. There just isn't a standard, and there might not be for a while. Yet, I'm just starting out myself - and really digging the ThreeJS framework:

Sure, it's a WebGL 3D framework - but I suspect you can strip out the 3D elements to make it 2D. At least that's my hope as I dig into this world of WebGL - which could end up being the standard moving forward?*

What helps is relying on Chrome Canary for development! :) https://tools.google.com/dlpage/chromesxs

If you're going this route - don't forget to set about:flags in Chrome, to enable "Override software rendering list" flag.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
gamengineers
  • 537
  • 1
  • 8
  • 22
0

Backbone Game Engine is a 2D framework that was written on top of the already popular and large community driven Backbone.

Objects, inheritance, events, persistence and so forth come de facto with Backbone. The engine borrows from MelonJS with sprites (Backbone Models) that implement update and draw methods. Super Mario Bros. Level 1-1 was written as an example. It may be worth your time checking.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Martin Drapeau
  • 1,484
  • 15
  • 16
0

Use gameQuery, a JavaScript game engine for jQuery.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
John Escobedo
  • 128
  • 1
  • 6