问题
I'm attempting to build a tile-based game in javascript, using HTML5 canvas. There are -many- engines to choose from, such as;
- JawsJS
- GameJS
- Cocos2D
- MelonJS
- CraftyJS
- ImpactJS (commercial)
... 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.
To phrase this into a real question; 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 / pacman games).
回答1:
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 (second most popular JS 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!)
回答2:
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 licences/costs, release date and user rating.
(p.s.: I'm not related to this site in any way)
回答3:
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 :
http://learningthreejs.com/ https://github.com/mrdoob/three.js/
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.
回答4:
Backbone Game Engine is a 2d framework that was written on top of already popular and large community driven Backbone. Objects, inheritance, events, persistence and so forth come defacto 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. May be worth your time checking.
回答5:
"Essentially I am looking for the 'jQuery' of javascript game engines."
http://gamequeryjs.com/
来源:https://stackoverflow.com/questions/10172191/2d-engines-for-javascript