nuvorm Posted July 30, 2014 Share Posted July 30, 2014 Hello, I am trying to seperate the logic update from the visual rendering of sprites and came up with this solution. this.counter++; this.skipFrame=parseInt((60-FPS.fps)/10); if(this.skipFrame==0) { this.skipFrame=1; } if(this.counter % this.skipFrame==0) { // reset render functions this.game.renderer.render=this.f_render; this.game.renderer.renderDisplayObject=this.f_renderDisplayObject; }else{ // clear render functions this.game.renderer.render=function(){}; this.game.renderer.renderDisplayObject=function(){}; } Anyone aware of a better solution?see attachment for the class FPS.txt Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.