terrain_AI():

application.setCurrentUserScene ( "terrain_scene" )
    local cam1=application.getCurrentUserSceneTaggedObject ( "cam_1st_tag" )
    application.setCurrentUserActiveCamera ( cam1 )


onkeyboardkeydown():

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

onEnterFrame():

 
local cam = application.getCurrentUserActiveCamera ( )
     if this.w ( ) then 
        object.translate ( cam, 0, 0, -0.05, object.kLocalSpace  )
     elseif 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  )
     elseif this.d ( ) then
        object.rotate ( cam, 0, -2, 0, object.kGlobalSpace  )
     end