Physics Plugin (Simple, 2D and 2kb)

Simple physics for casual games, it’s 2D. It only supports sphere + sphere and sphere + AABB box collisions.

What you can do?

  • Simple games including mobile
  • 2kb super simple engine, loads instantly
  • 2D movement, or simple topdown perspective, isometric movement type of games

Demo project : PlayCanvas 3D HTML5 Game Engine
Test here : Simple Physics (Box + Sphere) - PLAYCANVAS

Tutorial and Github
Repo : GitHub - devcem/playcanvas-physics: Simple physics for casual games
Video :


Thank you for sharing!

A couple of suggestions that would help improving it:

  • Consider using line-circle intersection to allow multiple contacts per move step. You could then find the average direction normal to reverse the movement to. This will prevent clipping into walls when touching corners. I had an example that shows it:
    PlayCanvas 3D HTML5 Game Engine
  • Try not to use vector math in the transform chains, like .getPosition().sub(...). This will modify the internal vector of the entity, that stores the transform. It will often introduce visual bugs like erratic movement. A better way would be to copy it to some temp vector and modify that instead.

Thanks for sharing your tools with the community, Cem! It’s a really cool thing to do.