text: "use strict";  // Operate in Strict mode such that variables must be declared before used!
  
  function MyGame() {
      // The camera to view the scene
      this.mCamera = null;
  
      // the hero and the support objects
      this.mHero = null;
      this.mSupport = null;
  }
  gEngine.Core.inheritPrototype(MyGame, Scene);
  
  MyGame.prototype.unloadScene = function () {
      // Step A: Game loop not running, unload all assets
      //          nothing for this level
  
      // Step B: starts the next level
      var nextLevel = new BlueLevel();  // next level to be loaded
      gEngine.Core.startScene(nextLevel);
  };
  
  MyGame.prototype.initialize = function () {
      // Step A: set up the cameras
      this.mCamera = new Camera(
          vec2.fromValues(20, 60),   // position of the camera
          20,                        // width of camera
          [20, 40, 600, 300]         // viewport (orgX, orgY, width, height)
      );
      this.mCamera.setBackgroundColor([0.8, 0.8, 0.8, 1]);
              // sets the background to gray
  
      // Step B: Create the support object in red
      this.mSupport = new Renderable(gEngine.DefaultResources.getConstColorShader());
      this.mSupport.setColor([0.8, 0.2, 0.2, 1]);
      this.mSupport.getXform().setPosition(20, 60);
      this.mSupport.getXform().setSize(5, 5);
  
      // Setp C: Create the hero object in blue
      this.mHero = new Renderable(gEngine.DefaultResources.getConstColorShader());
      this.mHero.setColor([0, 0, 1, 1]);
      this.mHero.getXform().setPosition(20, 60);
      this.mHero.getXform().setSize(2, 3);
  };
  
  // This is the draw function, make sure to setup proper drawing environment, and more
  // importantly, make sure to _NOT_ change any state.
  MyGame.prototype.draw = function () {
      // Step A: clear the canvas
      gEngine.Core.clearCanvas([0.9, 0.9, 0.9, 1.0]); // clear to light gray
  
      // Step  B: Activate the drawing Camera
      this.mCamera.setupViewProjection();
  
      // Step  C: draw everything
      this.mSupport.draw(this.mCamera.getVPMatrix());
      this.mHero.draw(this.mCamera.getVPMatrix());
  };
  
  // The Update function, updates the application state. Make sure to _NOT_ draw
  // anything from this function!
  MyGame.prototype.update = function () {
      // let's only allow the movement of hero, 
      // and if hero moves too far off, this level ends, we will
      // load the next level
      var deltaX = 0.05;
      var xform = this.mHero.getXform();
  
      // Support hero movements
      if (gEngine.Input.isKeyPressed(gEngine.Input.keys.Right)) {
          xform.incXPosBy(deltaX);
          if (xform.getXPos() > 30) { // this is the right-bound of the window
              xform.setPosition(12, 60);
          }
      }
  
      if (gEngine.Input.isKeyPressed(gEngine.Input.keys.Left)) {
          xform.incXPosBy(-deltaX);
          if (xform.getXPos() < 11) {  // this is the left-bound of the window
              gEngine.GameLoop.stop();
          }
      }
  
  };