Learn how to setup and use the JS port of Box2D for physics. CreateJS integration will be covered in part 2.
Original source
Learn how to setup and use the JS port of Box2D for physics. CreateJS integration will be covered in part 2.
Original source
11 responses to “JavaScript Physics with Box2D – Part 1”
Thank you so much for this amazing tutorial. We're really grateful for this quality content. However, just as a suggestion for improving your content even further, I think you may try running the code more frequently to demonstrate what certain functions are doing. Most people aren't here to copy the code but to understand what every line is doing.
Do people still use Flash?
That's really great thanks. Out of interest what IDE are you using that give such good intellisense, I am only using notepad++ while I'm learning and it's fine but I'm on the look out for better, netbeans is also not bad.
For the new version of easeljs (easeljs-0.7.1 at the time of writing this), use these 2 fixes:
1.) createjs.Ticker.addEventListener("tick", tick);
2.) stage.on("stagemousedown", function(evt) { /rest of his code here/ });
can you help me with the createjs.Ticker object. I am following this tutorial and in console getting this error "Uncaught TypeError: Object function (){throw"Ticker cannot be instantiated."} has no method 'addListener' "
Please help…Thanks!
How do you destroy bodies without leaking memory with Box2D web? see my question here (contains code and screenshots):
http://stackoverflow.com/questions/20817760/how-to-properly-delete-a-box2d-body-in-version-box2dweb-2-1-a-3-box2d-v2-3-1r3
Thanks a lot for this nice tutorials! 🙂
Just a minor addition:
With easeljs version 0.7.0 the function "addListener" is not supported anymore. Instead you must call "addEventListener("tick", tick)" on the Ticker object.
Anyways, AWESOME (and sadly the only one…) Box2dWeb tut on youtube! THANKS A LOT!! =D
How do you apply forces to bodies? It just keeps telling me the apply force method doesn't exist.
brilliant tutorial thanks
Super Helpful!
Awesome! Thanks.