  % Title "Console Demo"
  % Animated
 '% ScaleUp
 '% PlaceCentral
 '% AnchorCentral
  % filename "t.exe"
  'uses RTL64
  uses ConsoleG

  ! Craft


  sub main
  ========
  string s
  cls .0,0,0
  scale 2.,1.25
  printl "Hello World"
  scale .5,.80
  sys i
  for i=1 to 10
    PushState
      color .99,.00,.00
      print i
    PopState
    PushState
    move 4 'tab
    print chr(i+64)
    PopState
    PushState
    move 8 'tab
    print hex(i+64,2)+"h"
    PopState
    move 0,-1 'linefeed
  next
  printl 
  printl
  PushState
  color .20,.80,.00,.88
  Scale 2
  print "Enter: "
  color .80,.80,.00,.88
  input inputs
  PopState
  printl
  color .00,.80,.80,1.
  thickness 3
  line 10
  PointSize 11
  point 10,0,.0001
  move 0,-1
  if LastInput
    typeface=1
    printl "Last input: " LastInput
    typeface=0
  end if
  printl
  lastkey=0
  lastchar=0
  '
  shading 'opposite of 'flat'
  Material Gold
  move 2.,-2.,-1.0
  Material Gold
  go sphere
  move 0.,-2.0
  Material Red
  go cube
  pushState
  move 2.00
  rotateX -70
  scale 5
  'color .70,.70,.20,.99
  Material Silver
  print3d "Solids",1
  popstate
  move 0.,-5.,-4.0
  pushstate
  static float ang
  rotateY ang
  craft
  popstate
  ang+=.5 : if ang>=360 then ang-=360
  end sub 'main

  sub Craft
  =========
  int i
  '
  'CRAFT MAIN BODY
  '
  PickLabel 1
  '
  glPushMatrix
  'glTranslatef t.p.x+dx,t.p.y+dy,t.p.z+dz
  'glRotatef    t.a.x,1,0,0
  'glRotatef    t.a.y,0,1,0
  'glRotatef    t.a.z,0,0,1
  glScalef      3.,.5,3.
  Material Silver
  glCallList sphere
  '
  'FINS
  '
  for i=0 to 5
  glpushMatrix
  glRotatef i*60.0,0,1,0
  glTranslatef -.5,.20,.0
  glScalef      .4,.89,.15
  glCallList sphere
  glPopMatrix
  next
  '
  'THRUSTERS
  '
  for i=0 to 5
  glpushMatrix
  glRotatef i*60.0,0,1,0
  glTranslatef -.75,-.60,.00
  glScalef      .10, .30,.10
  glCallList sphere
  glPopMatrix
  next
  '
  'CABIN
  '
  glTranslatef .00,.99,.00
  glScalef     .50,1.99,.50
  Material Alloy
  glCallList sphere
  '
  'PORTS
  '
  for i=0 to 5
  glpushMatrix
  glRotatef 30.0+i*60.0,0,1,0
  glTranslatef .90,.10,.00 
  Material BlackShiny
  glscalef .10,.40,.20
  glCallList sphere
  glPopMatrix
  next
  '
  glPopMatrix 'end of craft main body

  end sub 'craft

  EndScript
