js/engine.js
/* This function serves as the kickoff point for the game loop itself
     * and handles properly calling the update and render methods.
     */
This function serves as the kickoff point for the game loop itself
and handles properly calling the update and render methods.
This function serves as the kickoff point for the game loop itself and handles properly calling the update and render methods .
function main() {
        var now = Date.now(),
            dt = (now - lastTime) / 1000.0;
        update(dt);
        render();
        lastTime = now;
        window.requestAnimationFrame(main);
    }
function main ( ) { var now = Date . now ( ) , dt = ( now - lastTime ) / 1000.0 ; update ( dt ) ; render ( ) ; lastTime = now ; window . requestAnimationFrame ( main ) ; }
This function serves as the kickoff point for the game loop itself
 and handles properly calling the update and render methods.
This function serves as the kickoff point for the game loop itself and handles properly calling the update and render methods .
/* Get our time delta information which is required if your game
         * requires smooth animation. Because everyone's computer processes
         * instructions at different speeds we need a constant value that
         * would be the same for everyone (regardless of how fast their
         * computer is) - hurray time!
         */ /* Call our update/render functions, pass along the time delta to
         * our update function since it may be used for smooth animation.
         */ // The update function takes the time that has changed since the last update.  //Never update your scene with constant values per frame (like x += 5;).  //Your game will run wildly different on various computers and platforms,  //so you need to update your scene independently of framerate. /* Set our lastTime variable which is used to determine the time delta
         * for the next time this function is called.
         */ /* Use the browser's requestAnimationFrame function to call this
         * function again as soon as the browser is able to draw another frame.
         */ // You update and render the scene, and then use requestAnimationFrame to queue up the next loop.