-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i use physics (Box2d) with Pixi #2262
Comments
Sorry for late answer. I had my own box2d + debug renderer for pixi somewhere. I'll find it and post a demo in the examples. |
I hope that you already bought https://www.codeandweb.com/physicseditor , its difficult to make box2d in pixi without it |
Basic idea is to spawn bodies for sprites and keep the two scenes in sync with eachother. |
I'm using box2d(web) and pixi.js on a project... there's nothing to it. your render function checks the position and rotation of the box2d bodies, and applies it to the sprites array. let me know if you need a code example |
closing as seems answered 👍 |
@ivanpopelyshev I just want to add collision and bouncing around to a few shapes (rectangle, triangle, circle) - which can be dragged and dropped onto a correct answer sprite. Is box2d the best solution for that? Does anybody have an actual code sample? I can download the physics editor app if necessary too. |
For just the basic shapes, you shouldn't need the PhysicsEditor app. I've used p2 successfully on mobile in EaselJS for about 10 or so of those same 3 shapes, and it worked out okay. |
thanks p2 has some really nice looking samples - I'll try integrating one of them with my sprites - seems this shouldn't take much to accomplish - shame I can't find an updated physics plugin/bridge for PIxi though. |
@mspanish You can try this library: https://github.com/shakiba/planck.js. It is ported from Box2D. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Can you give me the link to the totorials
thank you
The text was updated successfully, but these errors were encountered: