19
\$\begingroup\$

I have been thinking about creating a top down 2D car game for HTML5. For my first game I wrote the physics and collisions my self but for this one I would like to use some ready made library.

I found out Box2D and its JS port.

http://box2d-js.sourceforge.net

It seems to be quite old port, made in 2008. Is it lacking many features of current Box2D or does it have major issues with it? And are there any alternatives for it?

\$\endgroup\$
  • 3
    \$\begingroup\$ -1 because there are known issues with all software. Specific questions, please. \$\endgroup\$ – user744 Jan 27 '11 at 22:40
  • \$\begingroup\$ I don't know if your comment was before or after the edit, but I think it's pretty clear that the OP is asking for major issues that could be serious problems (e.g. using more than X joints will crash the program) not any known issue \$\endgroup\$ – The Communist Duck Feb 1 '11 at 16:29
  • \$\begingroup\$ It was before the edit, but I still think it's a bad question. For example, using more than 10,000,000 joints will crash the program for sure. Without specific concerns, this question is effectively "Please review <software>" - that's not a very good question. The SE format is good for focused questions; Google is better for general overviews. (You'll notice that neither answer gives actual issues with Box2D JS, just a point towards an alternative, which might as well re-ask the question.) \$\endgroup\$ – user744 Feb 2 '11 at 20:06
  • \$\begingroup\$ Now the question has been edited beyond recognition - and when asked this way becomes trivially Googleable - and since it's asking for a list of things, it's probably best as CW. \$\endgroup\$ – user744 Feb 2 '11 at 21:35
  • 1
    \$\begingroup\$ Similar question: stackoverflow.com/questions/7628078/… \$\endgroup\$ – a paid nerd Nov 1 '11 at 15:41
10
\$\begingroup\$

Box2D has a kind of maintained version on github:

https://github.com/thinkpixellab/pl/tree/master/src/box2d

Microsoft is using it for at least on of their IE9 test drive demos.

\$\endgroup\$
  • 5
    \$\begingroup\$ 'Microsoft is using it for at least on of their IE9 test drive demos.' is that really something to be proud of? \$\endgroup\$ – rightfold Feb 3 '11 at 15:24
  • 17
    \$\begingroup\$ @WTP Have you even tried some of the JS and Canvas demos in IE9? The entire browser is hardware accelerated, and has some of the fastest HTML5 performance across the board. Just because a version of browser sucked 10 years ago, doesn't mean it still does. \$\endgroup\$ – AttackingHobo Jun 20 '11 at 17:59
  • 1
    \$\begingroup\$ @AttackingHobo, +1, IE6, 7 really suck. 8 More or less. 9 or 10 are decent browsers. Stop hating the entire family because of a few outdated family members. \$\endgroup\$ – lukas.pukenis Jul 4 '13 at 11:19
16
\$\begingroup\$

There's box2dweb, which is a much newer port and has a lot fewer issues than box2djs. I highly recommend it.

http://code.google.com/p/box2dweb/

\$\endgroup\$
3
\$\begingroup\$

A popular alternative (though not a port) is cannon.js, a "lightweight 3D physics engine" for the web.

\$\endgroup\$
2
\$\begingroup\$

Also:

I also remember a port for the original C++ code to JavaScript using Emscripten ie. LLVM but I can't seem to find it back. Only found https://github.com/kripken/emscripten/issues/22
Too bad, I find interesting to adapt the original code rather than a port of a port...

\$\endgroup\$
  • \$\begingroup\$ Good ol' familiar JBox2D also supports GWT right out of the box, too! \$\endgroup\$ – Groomblecom Nov 7 '16 at 23:29
  • 1
    \$\begingroup\$ @Groomblecom Maybe not at the time I wrote that, because GWT didn't support all of Java (and still doesn't, I guess). Java and GWT evolved since then. Good to know. Thanks. \$\endgroup\$ – PhiLho Nov 8 '16 at 10:11
1
\$\begingroup\$

While this isn't Box2D, there is a port of JigLib (3D Physics) to JS: https://github.com/supereggbert/JigLibJS. I haven't used it, but it was ported to be used in the GLGE WebGL library.

\$\endgroup\$
0
\$\begingroup\$

There is very good alternative for Box2D-JS, just see box2dweb. See this game which is built using box2dweb. You can make your project easily using this physics engine.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.