Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Follows: #99 and #718
We have a new "frame_prediction" example which shows a naïve implementation of frame prediction built in user-code. This ticket will move the predictive positioning code into melonJS proper.
Some items to consider. All of these are in relation to the time delta of any skipped update:
me.Entity.drawshould extrapolate the entity positionme.AnimationSheet.drawshould handle the animation updates (in place ofupdate)me.TMXTileset.drawshould handle the animation updates (in place ofupdate)me.Tween.drawshould handle the tween updates (in place ofupdate) even though it will not draw anythingThis short spec will probably be pretty unstable until some edge cases are resolved. The edges are:
me.sys.updatesPerFrame === me.sys.fps:updateoverruns allocated compute timedrawoverruns allocated compute timeupdateanddrawoverrun allocated compute time together (but not alone)me.sys.updatesPerFrame < me.sys.fps:updateoverruns allocated compute timedrawoverruns allocated compute timeupdateanddrawoverrun allocated compute time together (but not alone)Where "allocated compute time" is equivalent to
1000 / me.sys.fps