Physics & Rendering "engines" decoupled


  • Refactor code for decoupling rendering & physics
  • FPS shown in UI
  • Limit FPS to 60 by default (could be set up manually using setFrameRate(number) in browser cli)

Why ?

        It makes a fixed time steps by triggering physic processing each 18ms while rendering could be at 10,20,30 or 60 fps
Not decoupling both make the physics tweaked by the computer rendering capabilites. In the previous version, if the computer was runnning at 60fps the physics was triggered 60 times per sec, that made physics feels different than if it was triggered 30 times per sec.

In this version  the physics is always triggered each 18ms while the fps can vary

Files

StickFighter_MapCreator.zip Play in browser
Sep 18, 2023

Leave a comment

Log in with itch.io to leave a comment.