Code Super Mario in JS (Ep 3) - Timing Accuracy

In this third episode of writing a Super Mario game in JavaScript, I show how to get the timing mechanism right. It’s a little boring but oh so important. We will look at * Basic simulation. * Using requestAnimationFrame with timestamp. * Faking requestAnimationFrame with setTimeout. * Attaching functions to classes to create methods. Since we are writing modern JS this code might not run on all browsers yet. I was running Chrome 61 when I wrote this and if you wish to follow I recommend you do too. Twitter: Source code with step-by-step commits: Music: Demoscene Time Machine
Back to Top