if kKeyCode == input.kKeyA then
      this.a ( true)
    end
    if kKeyCode == input.kKeyW then
      this.w ( true)
    end
    if kKeyCode == input.kKeyS then
      this.s ( true)
    end
    if kKeyCode == input.kKeyD then
      this.d ( true)
    end

    onenterframe()    

    local cam = application.getCurrentUserActiveCamera ( )
    local hscene= application.getCurrentUserScene ( )
    if this.w ( )  then
      object.translate ( cam , 0, 0, -0.05, object.kLocalSpace )
    end
    if this.s ( )  then
      object.translate ( cam , 0, 0, 0.05, object.kLocalSpace )
    end
    if this.a ( )  then
      object.rotate ( cam , 0, 2, 0, object.kGlobalSpace )
    end
    if this.d ( )  then
      object.rotate ( cam , 0, -2, 0, object.kGlobalSpace )
    end
    local x,y,z=object.getTranslation ( cam, object.kGlobalSpace )
    object.setTranslation ( cam, x, scene.getTerrainHeight (hscene, x, z )+0.42 , z, object.kGlobalSpace )