public void paint(Graphics g) {

    // check if started
    checkStarted();

    if (started) {
      // only ever one level
      Level l = levels.get(0);

      // draw the backBuffer to the window
      if (l.cameraShouldMove()) {
        g.drawImage(backBuffer, (w / 2) - (int)getAverageX(), (h / 2) - (int)getAverageY(), this);
      }
      else {
        g.drawImage(backBuffer, 0, 0, this);
      }

      // start all transforms at the identity
      try {
        g2d.setTransform(identity);
      }
      catch (NullPointerException e) { }

      // erase the background
      g2d.setColor(Color.GRAY);
      g2d.fillRect(-w, -h, (w * 4), (h * 4));

      // draw the level
      drawLevel();

      // draw the sprites
      drawSprites();

      // draw walls
      drawWalls();

      // draw checkpoints
      drawCheckpoints();

      // draw the scores
      drawScores();

      // draw winner
      if (victory) {
        drawWinner();
      }
    }
    else {
      // draw the backBuffer to the window (no offsets for pages)
      g.drawImage(backBuffer, 0, 0, this);

      drawPages();
    }
  }