vicksonzero / tank-beyond-repair

Repair your tanks or scrap them for a better tank, play against your friend to build the best tank!
https://vicksonzero.itch.io/tanks-beyond-repair
Other
1 stars 3 forks source link

Move to box2d #55

Closed vicksonzero closed 4 years ago

vicksonzero commented 4 years ago
vicksonzero commented 4 years ago

seems like running inside phaser is also a good idea, provided i can run 2 frames in PhysicsSystem if needed

vicksonzero commented 4 years ago

Why choose Box2D over MatterJS:

https://www.html5gamedevs.com/topic/37214-an-old-question-which-2d-physics-js-engine-is-with-better-performance-in-2018/

and box2d is more battle-proven (long history, with more games made) than matter js,

also more features

people say box2d is faster, but i dont care that much. it seems to me that box2d is just a bit more feature-complete to use. box2d has true circle shape, and matterjs has to approximate it in polygon shape

box2d uses meters while matterjs uses pixels which is a pain in the ass to do transformation from physics to game, and back into physics

another benefit is that we can find good amount of box2d materials from the web (although in c++) because people have used it in a long time

box 2d has a query by aabb function that can optimize lots of AOE attacks without creating a sensor collider first