Hi people. I've been doing a game for a year or so. Now i'm facing some troubles with the performance. I know i can use cocoonjs but before talking about that, i want to ask you if this are myths or realities , if you have faced it: Aclaration: Performance was not measured, it was what I saw with the lag of the game. This was tested with chrome 35. Using different canvas layers. I've been doing all in the same canvas element, i tried one time to add more canvas layers but I didn't not
Of course, instead of while(true) loop, you have requestAnimationFrame callbacks. Calculate time difference and you know exactly how much further to move your state. I'm coding with Haxe using Flambe so I can't give you js code, but essentially: 1. You calculate time diff since last RAF callback (from given timestamp) 2. Add that difference to accumulator 3. while(accumulator >= STEP_TIME) {accumulator-= STEP_TIME; updateLogic();}//step time being your target fps.. 1/60, 1/30... 4. setInterpo