home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd463 / amos1.34_progs / rolling_horizon.amos / rolling_horizon.amosSourceCode
AMOS Source Code  |  1993-01-17  |  974b  |  65 lines

  1. Rem *** ROLLING HORIZON ***
  2. '
  3. ' Use a joystick!
  4. ' q quits program
  5. '
  6. Flash Off : Curs Off : Hide : Cls 6
  7. X1=0 : X2=319 : Y1=150 : Y2=150
  8. Degree 
  9. Ink 5
  10. '
  11. Reserve As Chip Data 5,50000
  12. Set Tempras Start(5),50000
  13. Double Buffer : Autoback 0
  14. '
  15. Do 
  16.    '
  17.    If Inkey$="q" Then Proc FINISH
  18.    Screen 0
  19.    Cls 6
  20.    Ink 5 : Polygon X1,Y1 To X2,Y2 To X2,199 To X1,199
  21.    Proc GRATICLE
  22.    Proc JY
  23.    Screen Swap 
  24.    Wait Vbl 
  25.    '
  26. Loop 
  27. '
  28. Procedure JY
  29.    Shared Y1,Y2
  30.    '
  31.    If Fire(1)
  32.       For N=1 To 5
  33.          Shoot 
  34.       Next 
  35.    End If 
  36.    '
  37.    If Jdown(1)
  38.       Add Y1,10 : Add Y2,10
  39.    End If 
  40.    If Jup(1)
  41.       Add Y1,-10 : Add Y2,-10
  42.    End If 
  43.    If Jleft(1)
  44.       Add Y1,-10 : Add Y2,10
  45.    End If 
  46.    If Jright(1)
  47.       Add Y1,10 : Add Y2,-10
  48.    End If 
  49.    '
  50. End Proc
  51. '
  52. Procedure GRATICLE
  53.    '
  54.    Ink 0 : Draw 140,100 To 180,100 : Draw 160,80 To 160,120 : Circle 160,100,15
  55.    '
  56. End Proc
  57. '
  58. Procedure FINISH
  59.    '
  60.    Erase 5
  61.    Set Tempras 
  62.    Default 
  63.    Edit 
  64.    '
  65. End Proc