home *** CD-ROM | disk | FTP | other *** search
/ Amiga Computing 66 / ac066b.adf / AMOS.DMS / AMOS.adf / amos_3d_demos / Car_Race.AMOS / Car_Race.amosSourceCode
AMOS Source Code  |  1991-07-30  |  5KB  |  193 lines

  1. '
  2. '                           Car Race demo
  3. '
  4. '                           By Nick Harper 
  5. '
  6. '        (c) Copyright Europress / VooDoo Software 1991  
  7. '
  8. Screen Open 0,320,200,16,Lowres
  9.  Extension_4_04D6 ":AMOS_3d_demos/objects"
  10.  Extension_4_0024 : Hide On : Curs Off : Cls 0
  11.  Extension_4_0054 195
  12.  Extension_4_0024 
  13.  Extension_4_0016 "car1"
  14.  Extension_4_0016 "car2"
  15.  Extension_4_0016 "grid"
  16.  Extension_4_0016 "racelights"
  17.  Extension_4_0016 "streetlight"
  18. Curs Off : Flash Off 
  19. Palette 0,$FFF
  20. Curs Off : Flash Off : Cls 0 : Pen 1 : Paper 0
  21. Locate 1,5 : Centre "DO YOU WANT LIGHTS ON?" : Locate 1,6 : Centre "PRESS Y OR N"
  22. Locate 1,8 : Centre "NOTE - ALTHOUGH LIGHTS LOOK NICE" : Locate 1,9 : Centre "THEY WILL SLOW THE FRAME RATE!"
  23. LGHT:
  24. A$=Inkey$
  25. If A$="" Then Goto LGHT
  26. Clear Key 
  27. If Upper$(A$)="N" Then LGT=0 : Goto LHT
  28. If Upper$(A$)="Y" Then LGT=1 : Goto LHT
  29. Goto LGHT
  30. LHT:
  31. Double Buffer : Autoback 0
  32.  Extension_4_0036 3,"grid",0,-220,32500,-16380,0,0
  33.  Extension_4_0036 4,"racelights",0,600,31500,32760,0,0
  34. Fade 2 : Wait 50
  35. Restore LIGHT
  36. If LGT=0 Then Goto LIGHT
  37. For Z=5 To 10 : Read A,C : Extension_4_0036 Z,"streetlight",A,200,C,0,0,0
  38. Next Z
  39. LIGHT:
  40. Data -1500,0,-1500,-75000,-1500,-150000
  41. Data 1500,32500,1500,-32500,1500,-107500
  42. STRT:
  43.  Extension_4_00EC 0,-2000,500,1000
  44.  Extension_4_0036 1,"car1",-500,0,35000,0,16380,0
  45.  Extension_4_0036 2,"car2",500,0,35000,0,16380,0
  46.  Extension_4_053C : Extension_4_0318 : Screen Swap : Wait 100
  47. Fade 1,0,$FFF,,,,,,,$FFF,$C0,$AAA,$70
  48. PAN1
  49. Wait 50
  50. PAN2
  51. Wait 25
  52. PAN4
  53. Wait 25
  54. PAN3
  55. Wait 25
  56. PAN5
  57. Wait 25
  58. Goto NICKS
  59. End 
  60. Procedure PAN1
  61.    For Z=1 To 33
  62.        Extension_4_00D4 0,2,0,900
  63.        Extension_4_053C 
  64.        Extension_4_0318 
  65.       Screen Swap 
  66.       Wait Vbl 
  67.        Extension_4_01F8 0,3
  68.    Next Z
  69.    SPD=900
  70.    For Z=1 To 30
  71.        Extension_4_00D4 0,10,45,SPD
  72.        Extension_4_01F8 0,3
  73.        Extension_4_053C 
  74.        Extension_4_0318 
  75.       Screen Swap 
  76.       Wait Vbl 
  77.       SPD=SPD-30
  78.    Next Z
  79.    For Z=1 To 80
  80.        Extension_4_00D4 0,120,20,-220
  81.        Extension_4_01F8 0,3
  82.        Extension_4_053C 
  83.        Extension_4_0318 
  84.       Screen Swap 
  85.       Wait Vbl 
  86.    Next Z
  87. End Proc
  88. Procedure PAN2
  89.     Extension_4_00EC 0,-1500,5000,31000
  90.     Extension_4_01A6 0,0,0,0
  91.     Extension_4_01F8 0,3
  92.    For Z=1 To 50
  93.        Extension_4_053C 
  94.        Extension_4_0318 
  95.       Screen Swap 
  96.       Wait Vbl 
  97.        Extension_4_00D4 0,0,-100,0
  98.        Extension_4_01F8 0,3
  99.    Next Z
  100. End Proc
  101. Procedure PAN3
  102.     Extension_4_00EC 0,0,2000,50000
  103.     Extension_4_01A6 0,0,32760,0
  104.    For Z=1 To 20
  105.        Extension_4_00D4 0,0,-100,-750
  106.        Extension_4_01F8 0,4
  107.        Extension_4_053C 
  108.        Extension_4_0318 
  109.       Screen Swap 
  110.       Wait Vbl 
  111.    Next Z
  112. End Proc
  113. Procedure PAN4
  114.     Extension_4_00EC 0,2500,1500,34500
  115.     Extension_4_01A6 0,0,0,0
  116.     Extension_4_01F8 0,3
  117.     Extension_4_00C2 1,"(1,-80,25)"
  118.     Extension_4_00C2 2,"(1,-40,50)"
  119.    For Z=1 To 55
  120.        Extension_4_053C 
  121.        Extension_4_0318 
  122.       Screen Swap 
  123.       Wait Vbl 
  124.    Next Z
  125. End Proc
  126. Procedure PAN5
  127.    For Z=1 To 25
  128.        Extension_4_00D4 0,0,0,200
  129.        Extension_4_018C 0,-70,27,0
  130.        Extension_4_053C : Extension_4_0318 : Screen Swap : Wait Vbl 
  131.    Next Z
  132.    For Z=1 To 25
  133.        Extension_4_00D4 0,0,0,-200
  134.        Extension_4_01F8 0,1 : Extension_4_053C : Extension_4_0318 : Screen Swap : Wait Vbl 
  135.    Next Z
  136. End Proc
  137. NICKS:
  138. SPD1=0 : SPD2=0
  139. FRM=0
  140. SPD0=0
  141. PAN6:
  142.  Extension_4_053C 
  143.  Extension_4_0318 
  144. Screen Swap 
  145. Wait Vbl 
  146.  Extension_4_01F8 0,1
  147.  Extension_4_00D4 1,0,0,-SPD1
  148.  Extension_4_00D4 2,0,0,-SPD2
  149. Add SPD1,20
  150. Add SPD2,30
  151. If SPD1>605 Then SPD1=605
  152. If SPD2>590 Then SPD2=590
  153. If FRM>60 Then Gosub POON
  154. Inc FRM
  155. If Extension_4_013C(1)<-120000 Then SPD0=0 : BRK=0 : Goto PAN7
  156. Goto PAN6
  157. POON:
  158.  Extension_4_00D4 0,0,5,-SPD0
  159. If Extension_4_013C(0)<-95000 Then Goto POONS
  160. Add SPD0,50
  161. If SPD0>1500 Then SPD0=1500
  162. Return 
  163. POONS:
  164. If SPD0>0 Then SPD0=SPD0-100
  165. If Extension_4_0114(0)<-1500 Then Return 
  166.  Extension_4_00D4 0,-100,100,0
  167. Return 
  168. PAN7:
  169.  Extension_4_053C 
  170.  Extension_4_0318 
  171. Screen Swap 
  172. Wait Vbl 
  173.  Extension_4_01F8 0,1
  174.  Extension_4_00D4 0,0,-10,-SPD0
  175.  Extension_4_00D4 2,0,0,-SPD2
  176.  Extension_4_00D4 1,0,0,-SPD1
  177. If BRK=0 Then Add SPD0,58
  178. If SPD0=0 Then Add SPD2,-5 : Add SPD1,-50 : Gosub TURN1
  179. If Extension_4_013C(0)<-130000 Then Add SPD0,-30 : Inc BRK
  180. If SPD0<0 Then SPD0=0
  181. If SPD2<0 Then SPD2=0
  182. If SPD1<0 Then SPD1=0
  183. If BRK=120 Then Goto FIN
  184. Goto PAN7
  185. TURN1:
  186.  Extension_4_018C 2,4000,2000,3000
  187. If SPD1>0 Then Extension_4_018C 1,0,-3600,0
  188. Return 
  189. FIN:
  190. Wait 50
  191. Fade 2 : Wait 50
  192.  Extension_4_0090 1 : Extension_4_0090 2
  193. Goto STRT