luandev / slither-spline

A slither.io inspired game using splines
0 stars 0 forks source link

Implement physics based on Matter.js #2

Open luandev opened 2 years ago

luandev commented 2 years ago

Refactor current logic implemented in phaser3.drawing to a physics rendering engine like Matter.js see here

Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. The separation that stops two objects penetrating may create a new penetration against a different object. If you require a high level of stability please consider using an alternative physics system, such as Matter.js.

Support Materials

https://brm.io/matter-js/ https://github.com/Lightnet/project-phaser3-matterjs

luandev commented 2 years ago

While you should use the arcade physics engine whenever possible, due to its speed and efficiency, sometimes working with box and circle physics bodies isn’t enough.

https://www.thepolyglotdeveloper.com/2020/08/use-matterjs-physics-sprite-collisions-phaser-game/