home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 551-575 / apd553 / zest_v0.01a.amos / zest_v0.01a.amosSourceCode < prev   
AMOS Source Code  |  1992-02-09  |  5KB  |  219 lines

  1. ' ______ 
  2. '      / ______  ____ _______
  3. '     /  \       \       \                     Written by
  4. '    /    \___    \___    \     v0.01a                    Andrew Welsh 
  5. '   /      \          \    \ 
  6. '   \______ \_____ ____\    \
  7. '
  8. '  This is a primitive questions and answers game that i started the beginning 
  9. ' of 1991, it was going to be HUGE with different modules, flashy graphics etc 
  10. ' but the guy doing the graphics decided he was TOO GOOD for a crappy game 
  11. ' or anything, so i lost interest, gained interest, then lost it again ..
  12. ' so here is the unfinished version, bad code, no remarks (sorry !?!)
  13. '
  14. ' I may finish this at a later date, but I hope someone develops it further
  15. '
  16. SEUP
  17. Procedure CLD
  18. Move Off 
  19. Set Rainbow 0,1,100,"","",""
  20.   Fade 5
  21. Wait 100
  22. Screen Hide 4
  23.   Screen Close 4
  24. SEUP
  25. '  Restore 
  26. End 
  27. End Proc
  28. Procedure SEUP
  29. Change Mouse 4
  30. Cls 0
  31. Screen Open 1,640,256,4,Hires
  32. Curs Off : Cls 0 : Flash Off 
  33. Screen Open 0,640,256,4,Hires
  34. Curs Off : Cls 0 : Flash Off 
  35. Dual Playfield 0,1
  36. Screen 1
  37. Music 1
  38. Get Sprite Palette 
  39. Curs Off : Cls 0 : Flash Off 
  40. Paper 0 : Pen 1
  41. Print : Print : Centre " ZEST - A Game of Questions and Answers "
  42. GFX
  43. Under On 
  44. Locate 1,4 : Print "Question:"
  45. Locate 1,14 : Print "Answer:"
  46. Locate 64,8 : Print "Right:"
  47. Locate 64,13 : Print "Wrong:"
  48. Under Off 
  49. 'Screen Show 1 
  50. Screen 0
  51. Paper 0
  52. SET_MENU
  53. On Menu Proc CHOI,HEP
  54. Menu On 
  55. MAIN
  56. End Proc
  57. Procedure GFX
  58. Draw 0,13 To 0,25
  59. Draw 639,13 To 639,25
  60. Draw 0,13 To 639,13
  61. Draw 0,25 To 639,25
  62. Draw 0,30 To 639,30
  63. Draw 0,30 To 0,200
  64. Draw 639,30 To 639,200
  65. Draw 0,200 To 639,200
  66. Draw 500,30 To 500,200
  67. Bar 20,45 To 485,100 : 
  68. Bar 20,125 To 485,180 : 
  69. Bar 515,75 To 625,92 : 
  70. Bar 515,115 To 625,132 : 
  71. End Proc
  72. Procedure MAIN
  73. On Menu On 
  74.    Do 
  75.       X$=Inkey$
  76.          If X$="q"
  77.             Edit 
  78.          End If 
  79.    Loop 
  80. End Proc
  81. Procedure CHOI
  82. If Choice(2)=1 Then MAIN_LOOP
  83. If Choice(2)=2 Then MAIN
  84. If Choice(2)=7 Then Edit 
  85. If Choice(2)=6 Then Goto AB
  86. AB:
  87.    Curs Off : Screen 0 : Pen 2
  88.    Bar 215,20 To 415,100
  89.    Home : Pen 1 : Paper 2
  90.       Cdown : Cdown : Cdown 
  91.       Centre " ZEST v0.1a" : Cdown 
  92.       Centre "------------" : Cdown 
  93.       Centre "Written By" : Cdown : Cdown 
  94.       Centre "Andrew Welsh" : Cdown : Cdown 
  95.       Centre "(C)1991, 1992" : Cdown 
  96.       Centre "Def  Pixel" : Cdown 
  97.       Centre "Software" : Cdown 
  98.       Do 
  99.          If Mouse Key=1
  100.          Exit 
  101.          End If 
  102.       Loop 
  103.       Cls 0
  104.    MAIN
  105. End Proc
  106. Procedure HEP
  107. If Choice(2)=1 Then Music Off 
  108. If Choice(2)=2 Then Music 1
  109. MAIN
  110. End Proc
  111. Procedure SET_MENU
  112. Rem Menu 1 
  113.    Menu$(1)="  File  "
  114.    Menu$(1,1)="(Ink 1,1)(SStyle 4)       Start       (SStyle 0)"
  115.    Menu$(1,6)="(Ink 1,1)       About       "
  116.    Menu$(1,7)="       Quit        "
  117. Rem Menu 2 
  118.    Menu$(2)="  Music  "
  119.    Menu$(2,1)=" Music Off "
  120.    Menu$(2,2)=" Music On  "
  121. Rem Menu 3 
  122.    Menu$(3)="  Credits  "
  123.    Menu$(3,1)=" Written by "
  124.       Menu$(3,1,1)="              " : Menu Inactive(3,1,1)
  125.       Menu$(3,1,2)=" Andrew Welsh " : Menu Inactive(3,1,2)
  126.       Menu$(3,1,3)="              " : Menu Inactive(3,1,3)
  127. End Proc
  128. Procedure MAIN_LOOP
  129. Home : Cls 0 : Menu Off : Paper 0 : Pen 2 : Locate 5,24 : Boom 
  130. Print "  Are You Ready ? (Y/N) "
  131.    Do 
  132.       X$=Inkey$
  133.          If(X$="y") or(X$="Y")
  134.             Goto YEP
  135.          End If 
  136.          If(X$="n") or(X$="N")
  137.             Goto NOP
  138.          End If 
  139.    Loop 
  140. YEP:
  141. Global AN$,ANS$
  142. Open Random 1,"empty:theone"
  143. Field 1,100 As QUEST$,50 As ANS$
  144. Randomize Timer
  145. Cls 0
  146. Do 
  147. J:
  148.    N=Rnd(50)+Rnd(50)
  149.    N=N/2
  150.    If N=0 Then Goto J
  151.    Get 1,N
  152.    Locate 3,6
  153.    Print QUEST$
  154.    Locate 3,16
  155.    AN$=""
  156.    Input "Your Answer : ";AN$
  157.     AN$=Lower$(AN$)
  158.       Repeat 
  159.          I=Len(AN$)
  160.          If I=50
  161.             Exit 
  162.          End If 
  163.          If I<50
  164.             AN$=AN$+" "
  165.          End If 
  166.       Until I=51
  167. If AN$="q                                                 "
  168.   Goto NOP1
  169. End If 
  170. If AN$=ANS$
  171.   Gosub RGT
  172. End If 
  173. If AN$<>ANS$
  174.   Gosub WRG
  175. End If 
  176. Loop 
  177. WRG:
  178.   WS=WS+1
  179.       If WS=5
  180.         Locate 3,18 : Print " Sorry 5 Questions Wrong ! " : Wait 100 : Goto NOP1
  181.       End If 
  182.   Locate 65,15
  183.   Print WS
  184.   Cls 0
  185.   Locate 65,15 : Print WS
  186.   Locate 65,10 : Print SC
  187. Return 
  188. '
  189. ' Sub-Rout. for if the answer is right 
  190. '
  191. RGT:
  192. Curs Off 
  193. Locate 3,18
  194. Print " Good Work ... "
  195. SC=SC+1
  196. Locate 65,10
  197. Print SC
  198. Wait 50
  199. Cls 0
  200. Locate 65,10
  201. Print SC
  202. Locate 65,15 : Print WS
  203. Return 
  204. ' reads the first question.... and goes into a 
  205. ' loop until they get 5 questions wrong......
  206. ' questions randomly selected
  207. '
  208. ' Jumps here if n pressed before quest. begin
  209. '
  210. NOP1:
  211. Close 1
  212. Cls 0
  213. Menu On 
  214. MAIN
  215. NOP:
  216. Cls 0
  217. Menu On 
  218. MAIN
  219. End Proc