What are good JS libraries for game dev? (HTML5)
Asked Answered
K

8

13

If i decide to write a simple game both text and graphical (2d) what libs may i use? Assuming we are using a HTML5 compatible browser.

The main things i can think of

  • Rendering text on screen
  • Animating sprites (using images/css)
  • Input (capturing the arrow keys and getting relative mouse positions)
  • Perhaps some preloading resource or dynamically loading resources and choosing order
  • Sound (but i am unsure how important this will be to me at first). Perhaps with mixing and chaining sounds or looping forever until stop.
  • Networking (low priority) to connect a user to another or to continuously GET data without multiple request (i know this exist but i dont know how easy it is to setup or use. But this isnt important to me. Its for the question).
Kabyle answered 1/10, 2010 at 18:1 Comment(1)
I'm surprised nobody has yet suggested jQuery ;)Mahatma
P
2

Well.... there's Rocket Engine. I haven't used it, but it appears (on the surface) to do much of what you want.

I'd also recommend HTML5 Gamer, a blog on the issues for building games in HTML5/JS

Perplexed answered 1/10, 2010 at 18:14 Comment(0)
T
2

GameJs does this:

  • Sprites, SpriteGroups
  • Text rendering
  • input handling (key/mouse)
  • collision detection
  • sound
  • resource preloading

http://gamejs.org, Disclaimer: I'm dev of GameJs.

The stuff above works good and I did games with it. The API is similar to http://PyGame.org which some people like a lot.

Networking is planned.

Tortuga answered 12/10, 2010 at 11:26 Comment(2)
Hey you might want to look at effectgames.com/effect A company owns it now see html5gamer.com/2010/07/… and aves engine was shown at google. I dont know how impress i am with aves but i am impressed with effect and i suspect effect (and possible aves, maybe one is meant to be free while the other is the enterprise version?) will be THE lib to use.Kabyle
a) not open source b) not yet available. And it's a different beast as it works with imgs/css instead of drawing to the canvas. my lib is on github right now ;)Tortuga
E
2

If you're familiar with jQuery then gamequery is a good one to try. Here's a great demo of what you can do with it: brainsnackers.

Here are some of the features:

  • multi layer-sprite animations sprite
  • hierarchies (grouping) collision
  • detection swappable sound support
  • periodic callbacks keyboard state
  • polling free and open source license
Extremely answered 12/10, 2010 at 19:47 Comment(0)
V
1

Check out cake js. It's been around a long time and it's really nice to use - especially if you've used actionscript before.

Virescence answered 12/10, 2010 at 19:46 Comment(0)
U
1

The http://js1k.com contest just ended and the 2D platform game Legend Of The Bouncing Beholder (by marijnjh) was the winning entry. You might want to look over the source since it would provide a very easy to grasp overview of sidescrollers without needing to read lots of code.

Another good one is the two-player crazy pong which is a lot of fun.

Plus, 1kb games are just awesome.

Unmannered answered 12/10, 2010 at 19:48 Comment(0)
G
1

i would use RenderEngine i think it has all you need and solves one of the most important problems that would be collision detection, and it also has sprite support...

Tutorial <- this is a great tutorial i found

i hope this helps

Grosberg answered 12/10, 2010 at 19:57 Comment(0)
M
0

I can recommend Cometd for using ajax push networking (ie. comet)

Mahatma answered 12/10, 2010 at 19:41 Comment(0)
S
0

What about createJS (createjs.com) or melonJS (melonjs.github.io/tutorial)?

CreateJS has great support for those items you mentioned, not so sure about networking though.

MelonJS has native support for reading Tiled tilemap .tmx files.

Seriema answered 19/2, 2014 at 22:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.