kaplayjs / kaplay

🦖 A JavaScript/TypeScript Game Library that feels like a game. Make games fast, fun and fanstastic.
https://kaplayjs.com
MIT License
428 stars 31 forks source link

feat: Create A Box2D Physics Plugin #252

Open quinton-ashley opened 2 months ago

quinton-ashley commented 2 months ago

p5play, Construct 3, GDevelop, and Unity all use the Box2D physics simulator.

Matter.js is not a good physics simulator and was probably only used in kaboom.js due to device limitations years ago.

niceEli commented 2 months ago

As of right now the physics is plugin based. It would be best to do this and make accurate physics part of engine itself at the same time.

mflerackers commented 2 months ago

No, physics needs to be plugin based, because we need to support multiple physics engines. Box2D (or PlanckJS or MatterJS) are not a good choice for classic platform games because these games don't use or require realistic physics. So the physics engine will be a choice, not something built-in. Depending on that choice, area and body will be behave differently, but their API will stay largely the same.