var Gesso = require('gesso');
var fillRotatedRect = require('./helpers').fillRotatedRect;

// Create the game object
var game = new Gesso();

// We'll use closures for game variables
var seconds = 0;

// This gets called every frame. Update your game state here.
game.update(function () {
  // Calculate the time passed, based on 60 frames per second
  seconds += 1 / 60;
});

// This gets called at least once per frame. You can call
// Gesso.renderTo(target) to render the game to another canvas.
game.render(function (ctx) {
  // Calculate one rotation per second
  var angle = seconds * (Math.PI / 2);

  // Clear the canvas
  ctx.clearRect(0, 0, game.width, game.height);

  // Draw a red box, rotating four times per second
  ctx.fillStyle = '#f34';
  fillRotatedRect(ctx, 50, 100, 200, 20, angle * 4);

  // Draw a green box, fully rotating every two seconds
  ctx.fillStyle = '#cf8';
  fillRotatedRect(ctx, 400, 50, 200, 150, -angle / 2);

  // Draw a blue box, fully rotating two times per second
  ctx.fillStyle = '#3cf';
  fillRotatedRect(ctx, 200, 250, 200, 200, angle * 2);
});

// Run the game
game.run();

@@ -180,23 +180,21 @@
 les%0Avar 
-seconds
+angle
  = 0;%0A%0A/
@@ -224,16 +224,19 @@
 y frame.
+%0A//
  Update 
@@ -279,16 +279,17 @@
 nction (
+t
 ) %7B%0A  //
@@ -303,74 +303,76 @@
 ate 
-the time passed, based on 60 frames per second%0A  seconds += 1 / 60
+one rotation per second, in radians%0A  angle = (2 * Math.PI / 60) * t
 ;%0A%7D)
@@ -529,87 +529,8 @@
 ) %7B%0A
-  // Calculate one rotation per second%0A  var angle = seconds * (Math.PI / 2);%0A%0A
   //
@@ -724,12 +724,8 @@
 ngle
- * 4
 );%0A%0A
@@ -857,17 +857,17 @@
 angle / 
-2
+8
 );%0A%0A  //
@@ -997,17 +997,19 @@
 angle * 
-2
+0.5
 );%0A%7D);%0A%0A

Use the update function's time argument in the spinning example and cleanup code.