Antriel Posted October 9, 2014 Share Posted October 9, 2014 At fast glance it looks good to me. @chgThe point isn't really to increase FPS. Point is, you design your game based on 30FPS updates, because you suspect older devices will work around that fast + you don't need more FPS. But you can't really control fps with requestAnimationFrame, so what you do is interpolate, to make it look smooth.All this is based on assumption that rendering takes a lot more time than logic updates, which usually is the case. There shouldn't really be any unevenness because if logic update takes too much, you won't be able to render more frames anyway and it will stay locked at 30FPS, even lower if needed. d13 1 Quote Link to comment Share on other sites More sharing options...
rhanb Posted July 17, 2015 Share Posted July 17, 2015 Hi everybody, I saw your topic and i didn't read all replies, i'm not event a game dev but im actually a it engineer and im using canvas to code a new software to make video specialised in app advertisement. I'm actually using canvas as calque in Photoshop, i have about 7 and effectivelly canvas and its context make it slow as hell ! Why? Because the context of the canvas doesnt have any memory manager (garbage collector) ! How to fix it? Make all your canvas and context null when you don't need it into you js file but remove all your canvas from your DOM too. I know you are coding games so you may never delete your canvas because you always need it. I hope i was still useful, sorry for my bad english cheers from France Quote Link to comment Share on other sites More sharing options...
Firenibbler Posted August 8, 2015 Share Posted August 8, 2015 I know that save() and restore() are very expensive. Can anyone comment on the optimization strategies for calling save and restore efficiently if you have to transform or rotate many sprites each frame? Instead of using save and restore, you can save the values and reverse them. so if you rotate the canvas 45 degrees just rotate it -45 degrees when you are done with the animation frame. 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.