home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 351-375 / apd360 / johnny_ball.amos / johnny_ball.amosSourceCode < prev   
AMOS Source Code  |  1988-11-13  |  13KB  |  359 lines

  1. Rem
  2. Rem
  3. Rem ------------------------------------------------------------------ 
  4. Rem
  5. Rem                   JOHNNY BALL and LEVEL DESIGNER 
  6. Rem
  7. Rem      designed and written by Steven Lawson 
  8. Rem
  9. Rem      this program is public domain 
  10. Rem
  11. Rem      if you have any questions, comments or improvements 
  12. Rem
  13. Rem      write to me at: 24 Ryegate Crescent, Birstall, Leicester, 
  14. Rem
  15. Rem      Leicestershire, LE4 3HL.   ENGLAND  
  16. Rem
  17. Rem      Also write to me if you are a fan of Jackie Chan or Cynthia 
  18. Rem
  19. Rem      Rothrock. I'm always looking for new pen pals who are into  
  20. Rem
  21. Rem      Chinese kung fu movies in a big way.
  22. Rem ------------------------------------------------------------------ 
  23. Rem
  24. Rem
  25. 5555 Load "song"
  26. 5556 Volume 63
  27. 0 Screen Open 0,320,200,16,Lowres
  28. 1 Colour 1,$0 : Cls : Curs Off : Volume 63 : Music 1
  29. 2 Change Mouse 2
  30. 3 Gosub 10000
  31. 5 Pen 2
  32. 6 S=1 : E=3
  33. 7 L=0 : H=0
  34. 8 Limit Mouse : Curs Off : Flash 3,"(008,10)(010,10)"
  35. 9 Colour 1,$0 : If S>0 Then Cls 
  36. 10 X=21 : If S=0 Then Load Iff L$ : E=3
  37. 11 Y=21
  38. 20 Curs Off 
  39. 21 B=3
  40. 22 Ink 15 : Box 20,20 To 300,190
  41. 23 Locate 0,0 : Print " LIVES";E;"       LEVEL";S
  42. 29 O=2000
  43. 30 If S=1 Then Gosub 300
  44. 31 If S=3 Then Gosub 400
  45. 32 If S=5 Then Gosub 450
  46. 33 If S=2 Then Gosub 500
  47. 34 If S=7 Then Gosub 550
  48. 3444 If S=4 Then Gosub 560
  49. 3445 If S=6 Then Gosub 580
  50. 3446 If S=8 Then Gosub 600
  51. 3447 If S=10 Then Gosub 620
  52. 3448 If S=9 Then Gosub 650
  53. 3449 If S=11 Then Gosub 700
  54. 35 Rem ++++++++++++++++++++++++++++++++++++++++++++++++ 
  55. 40 Locate 28,0 : Print "time";O
  56. 60 O=O-1 : If O<0 Then Goto 1000
  57. 61
  58. 62 Rem
  59. 64
  60. 65 Ink 1 : Bar X,Y To X+1,Y+1
  61. 66 A=Mouse Click : If A=0 or H>5 Then Goto 70
  62. 67 J=X Mouse : K=Y Mouse : J=J-135 : K=K-55
  63. 68 Ink 4 : Bar J,K To J+10,K+10 : H=H+1
  64. 69 Ink 5 : Bar J,K To J+1,K+10 : Bar J+9,K To J+10,K+10
  65. 70 If B=1 Then Goto 80
  66. 71 If B=2 Then Goto 90
  67. 72 If B=3 Then Goto 100
  68. 73 If B=4 Then Goto 110
  69. 80 Rem ball moving up left-----------------------------UP LEFT1 
  70. 81 X=X-1 : Y=Y-1
  71. 82 If X-2<20 Then B=4 : Gosub 200 : Goto 70
  72. 83 If Y-2<20 Then B=2 : Gosub 200 : Goto 70
  73. 84 F=Point(X-2,Y-2) : If F=5 Then B=4 : Gosub 200 : Goto 70
  74. 85 If F=4 Then B=2 : Gosub 200 : Goto 70
  75. 86 If F=10 Then Gosub 210 : S=S+1 : Goto 7
  76. 87 If F=3 Then Goto 1100
  77. 88
  78. 89 Goto 125
  79. 90 Rem ball moving down left--------------------------DOWN LEFT 2 
  80. 91 X=X-1 : Y=Y+1
  81. 92 If X-2<20 Then B=3 : Gosub 200 : Goto 70
  82. 93 If Y+2>190 Then B=1 : Gosub 200 : Goto 70
  83. 94 F=Point(X-2,Y+2) : If F=5 Then B=3 : Gosub 200 : Goto 70
  84. 95 If F=4 Then B=1 : Gosub 200 : Goto 70
  85. 96 If F=10 Then Gosub 210 : S=S+1 : Goto 7
  86. 97 If F=3 Then Goto 1100
  87. 98
  88. 99 Goto 125
  89. 100 Rem ball moving down right------------------------DOWN RIGHT 
  90. 101 X=X+1 : Y=Y+1
  91. 102 If X+2>300 Then B=2 : Gosub 200 : Goto 70
  92. 103 If Y+2>190 Then B=4 : Gosub 200 : Goto 70
  93. 105 F=Point(X+2,Y+2) : If F=5 Then B=2 : Gosub 200 : Goto 70
  94. 106 If F=4 Then B=4 : Gosub 200 : Goto 70
  95. 107 If F=10 Then Gosub 210 : S=S+1 : Goto 7
  96. 108 If F=3 Then Goto 1100
  97. 109 Goto 125
  98. 110 Rem moving ball up right-------------------------UP RIGHT  
  99. 111 X=X+1 : Y=Y-1
  100. 112 If X+2>300 Then B=1 : Gosub 200 : Goto 70
  101. 113 If Y-2<20 Then B=3 : Gosub 200 : Goto 70
  102. 114 F=Point(X+2,Y-2) : If F=5 Then B=1 : Gosub 200 : Goto 70
  103. 115 If F=4 Then B=3 : Gosub 200 : Goto 70
  104. 116 If F=10 Then Gosub 210 : S=S+1 : Goto 7
  105. 117 If F=3 Then Goto 1100
  106. 118
  107. 119 Goto 125
  108. 125 Ink 5 : Bar X,Y To X+1,Y+1
  109. 126 Goto 35
  110. 200 Bell 7 : Return 
  111. 210 Locate 10,10 : Centre " LEVEL DONE! "
  112. 220 For U=1 To 2 : Wait 10 : Bell 50 : Wait 10 : Bell 40 : Wait 10 : Bell 60 : Wait 10 : Bell 40
  113. 230 Wait 10 : Next U
  114. 240 Q=Mouse Click : If Q=0 Then Goto 240
  115. 250 Return 
  116. 300 Ink 10 : Bar 280,175 To 290,185
  117. 301 Ink 5 : Draw 270,190 To 270,50
  118. 302 Return 
  119. 1000 Locate 10,10 : Centre "OUT OF TIME!"
  120. 1001 Wait 100 : E=E-1 : If E<1 Then Goto 1
  121. 1002 Goto 7
  122. 1100 Boom : Locate 10,10 : Centre "ELECTROCUTED!" : Wait 100 : E=E-1 : If E<1 Then Goto 1
  123. 1101 Goto 7
  124. 400 Ink 10 : Bar 165,175 To 175,185
  125. 401 Ink 5 : Draw 150,190 To 150,100 : Draw 190,190 To 190,100
  126. 402 Ink 3 : Draw 30,180 To 140,180
  127. 403 Return 
  128. 450 Ink 10 : Bar 25,175 To 35,185
  129. 451 Ink 4 : Draw 21,170 To 260,170
  130. 452 Ink 3 : Draw 30,28 To 200,28
  131. 453 Return 
  132. 500 Ink 10 : Bar 25,175 To 35,185
  133. 510 Ink 4 : Draw 21,170 To 250,170
  134. 511 Draw 40,150 To 300,150
  135. 512 Draw 21,40 To 260,40
  136. 513 Ink 3 : Draw 28,50 To 28,100
  137. 514 Return 
  138. 550 Ink 10 : Bar 155,95 To 165,105
  139. 551 Ink 5 : Draw 150,90 To 150,110
  140. 552 Draw 170,90 To 170,110
  141. 555 Ink 4 : Draw 170,110 To 150,110
  142. 556 Return 
  143. 560 Ink 10 : Bar 23,37 To 33,47
  144. 561 Ink 4 : Draw 21,50 To 41,50
  145. 562 Draw 80,50 To 300,50
  146. 563 Ink 3 : Draw 270,26 To 290,26
  147. 564 Return 
  148. 580 Ink 10 : Bar 280,170 To 290,180
  149. 581 Ink 3 : Draw 297,160 To 297,187
  150. 582 Draw 297,187 To 265,187
  151. 583 Return 
  152. 600 Ink 3 : Draw 20,60 To 300,60
  153. 601 Ink 4 : Draw 50,60 To 70,60
  154. 602
  155. 604 Ink 10 : Bar 275,30 To 285,40
  156. 605 Return 
  157. 620 Ink 5 : Draw 40,20 To 40,170
  158. 621 Ink 3 : Draw 40,100 To 40,120
  159. 622 Ink 5 : Draw 60,40 To 60,190 : Bar 60,40 To 62,50
  160. 623 Ink 4 : Draw 60,40 To 280,40
  161. 624 Ink 5 : Draw 280,40 To 280,170
  162. 625 Ink 4 : Draw 280,170 To 80,170
  163. 626 Ink 3 : Draw 140,170 To 160,170
  164. 627 Ink 4 : Draw 60,150 To 260,150
  165. 628 Ink 5 : Draw 260,150 To 260,120 : Ink 4 : Bar 240,147 To 260,150
  166. 629 Ink 4 : Draw 280,100 To 220,100
  167. 630 Draw 260,120 To 220,120
  168. 631 Ink 10 : Bar 225,105 To 235,115
  169. 632 Ink 5 : Draw 220,120 To 220,100 : Return 
  170. 650 Ink 3 : Draw 30,25 To 290,25
  171. 652 Draw 290,25 To 290,180 : Draw 290,180 To 25,180
  172. 653 Draw 25,180 To 25,30 : Ink 10
  173. 654 Bar 275,165 To 285,175
  174. Return 
  175. 700 For K=1 To 20 : V=Rnd(25) : If V<4 Then V=4
  176. 701 B=Rnd(20) : If B<4 Then B=4
  177. 702 Locate V,B : Pen 4 : Print "THE END"
  178. 703 Next K
  179. 704 Return 
  180. 10000 Ink 4 : Circle 145,70,60 : Paint 145,70,1
  181. 10001 Ink 2 : Circle 125,50,10 : Paint 125,50,1
  182. 10002 Circle 165,50,10 : Paint 165,50,1 : Ink 1
  183. 10003 Circle 125,50,2 : Circle 165,50,2
  184. 10004 Circle 145,90,15 : Paint 145,90,1
  185. 10005 Pen 4
  186. 10006 Locate 1,19
  187. 10007 Print "           JOHNNY BALL!"
  188. 10008 Print 
  189. 10009 Print "          BY STEVEN LAWSON"
  190. 10010 Print 
  191. 10011 Print "        CLICK MOUSE TO BEGIN"
  192. 10020 Q=Mouse Click : If Q=0 Then Goto 10020
  193. 55559 For H=63 To 0 Step -1 : Volume H : Wait 2 : Next H : Music Off : Volume 17
  194. 10021 Cls : Ink 6 : Bar 20,55 To 40,75 : Pen 6 : Locate 7,8 : Print "LOAD LEVEL"
  195. 10022 Ink 5 : Bar 20,15 To 40,35 : Pen 5 : Locate 7,3 : Print "PLAY JOHNNY BALL"
  196. 10023 Ink 4 : Bar 20,95 To 40,115 : Pen 4 : Locate 7,13 : Print "READ INSTRUCTIONS"
  197. 10024 Ink 12 : Bar 20,135 To 40,155 : Pen 12 : Locate 7,18 : Print "DESIGN LEVEL"
  198. 10025 Q=Mouse Click : If Q=0 Then Goto 10025
  199. 10026 X=X Mouse : Y=Y Mouse
  200. 10027 X=X-128 : Y=Y-50
  201. 10028 C=Point(X,Y) : If C=1 Then Goto 10025
  202. 10029 If C=5 Then Return 
  203. 10030 If C=4 Then Goto 10040
  204. 10031 If C=12 Then Goto 10200
  205. 88888 If C=6 Then Goto 10110
  206. 10032 Goto 10025
  207. 10035 Rem ================================================ 
  208. 10036 Rem
  209. 10037 Rem        THE INSTRUCTIONS ======================== 
  210. 10038 Rem
  211. 10039 Rem ================================================ 
  212. 10040 Cls : Pen 4
  213. 10041 Print " This game was designed to be a cross"
  214. 10042 Print 
  215. 10043 Print "between Lemmings, Brat, and Deflektor."
  216. 10044 Print 
  217. 10045 Print " The star of the game is Johnny, a "
  218. 10046 Print 
  219. 10047 Print "small round character who bounces "
  220. 10048 Print 
  221. 10049 Print "aimlessly around the screen. You must"
  222. 10050 Print 
  223. 10051 Print "direct Johnny towards his house (shown"
  224. 10052 Print 
  225. 10053 Print "as a pink block) by putting down cubes"
  226. 10054 Print 
  227. 10055 Print "in his path which he will bounce off."
  228. 10056 Print 
  229. 10057 Print " The aim is to bounce Johnny into his"
  230. 10058 Print 
  231. 10059 Print "within the time limit, but with only"
  232. 10060 Print 
  233. 10061 Print "six cubes."
  234. 10062 Print : Print : Print "             CLICK MOUSE "
  235. 10063 Q=Mouse Click : If Q=0 Then Goto 10063
  236. 10064 Pen 5 : Print : Print 
  237. 10065 Print " Cubes are positioned with a click of" : Print 
  238. 10066 Print "either mouse button. When all six of" : Print 
  239. 10067 Print "the cubes are used up, clicking will" : Print 
  240. 10068 Print "have no effect." : Print 
  241. 10069 Print " Whenever Johnny hits an object he " : Print 
  242. 10070 Print "will bounce off, with two exceptions :" : Print 
  243. 10071 Print " If he hits an electric fence (shown" : Print 
  244. 10072 Print "as a flashing wall) he will die. If " : Print 
  245. 10073 Print "he makes contact with his house, he " : Print 
  246. 10074 Print "automatically enters and the level is" : Print 
  247. 10075 Print "completed." : Print 
  248. 10076 Print "             CLICK MOUSE "
  249. 10077 Q=Mouse Click : If Q=0 Then Goto 10077
  250. 10078 Pen 4 : Print : Print 
  251. 10079 Print " When using the level designer, type" : Print 
  252. 10080 Print "VL for a vertical line, HL for a " : Print 
  253. 10081 Print "horizontal wall, VE for a vertical " : Print 
  254. 10082 Print "electric fence and HE for a horizontal" : Print 
  255. 10083 Print "electric fence. " : Print 
  256. 10084 Print " Type PH to position Johnny's house. " : Print 
  257. 10085 Print "After you have typed one of these " : Print 
  258. 10086 Print "commands you can click the start point" : Print 
  259. 10087 Print "of the line or position of the house " : Print 
  260. 10088 Print "with either mouse button, and then type" : Print 
  261. 10089 Print "the number of pixels the line extends." : Print 
  262. 10090 Rem
  263. 10091 Print "             CLICK MOUSE"
  264. 999999 Q=Mouse Click : If Q=0 Then Goto 999999
  265. 10092 Pen 5 : Print : Print 
  266. 10093 Print " Things to remember :" : Print 
  267. 10094 Print "When drawing lines and fences the point" : Print 
  268. 10095 Print "you click should be at the TOP of a " : Print 
  269. 10096 Print "vertical line or the LEFT end of a " : Print 
  270. 10097 Print "horizontal line. Also, the point you " : Print 
  271. 10098 Print "click for the house will be where the " : Print 
  272. 10099 Print "house's top left-hand corner will be." : Print 
  273. 10100 Print " When you have finished, type SAVE and" : Print 
  274. 10101 Print "a filename and the level will be saved." : Print 
  275. 10102 Print " If you enter QUIT as the filename the" : Print 
  276. 10103 Print "design will be aborted."
  277. 10104 Print : Print 
  278. 10105 Print "              CLICK MOUSE"
  279. 10106 Q=Mouse Click : If Q=0 Then Goto 10106
  280. 10107 Goto 1
  281. 10108 Rem ---------------------- LOADING A LEVEL --------------- 
  282. 10109 Rem--------------------                        ----------- 
  283. 10110 Cls : Pen 5 : Print : Print : Print 
  284. 10111 Print " ENTER FILENAME OF LEVEL TO LOAD"
  285. 10112 Print 
  286. 10113 Input L$
  287. 10114 Cls : Locate 1,10 : Curs Off 
  288. 10115 Print "               LOADING"
  289. 10116 Load Iff L$,1 : Flash 3,"(008,10)(010,10)" : Curs Off 
  290. 10117 S=0 : Goto 10
  291. 10118 Rem -------------------------------------------------- 
  292. 10119 Rem ================================================== 
  293. 10120 Rem
  294. 10121 Rem --------   L E V E L   D E S I G N E R  ---------- 
  295. 10122 Rem
  296. 10123 Rem ================================================== 
  297. 10124 Rem -------------------------------------------------- 
  298. 10125 Rem
  299. 10200 Cls : Ink 15 : Box 20,20 To 300,190
  300. 10201 Pen 2 : Locate 0,0
  301. 10202 Print "COMMAND" : Input Z$
  302. 10203 If Z$="HL" Then Goto 10220
  303. 10204 If Z$="VL" Then Goto 10230
  304. 10205 If Z$="HE" Then Goto 10240
  305. 10206 If Z$="VE" Then Goto 10250
  306. 10207 If Z$="PH" Then Goto 10260
  307. 10208 If Z$="SAVE" Then Ink 1 : Bar 0,0 To 300,19 : Goto 10210
  308. 10209 Goto 10201
  309. 10210 Locate 0,0 : Print "FILENAME :"
  310. 10211 Rem
  311. 10212 Input L$ : Curs Off 
  312. 10213 If L$="QUIT" Then Goto 1
  313. 10214 Bar 0,0 To 300,19 : Save Iff L$
  314. 10215 Locate 0,0 : Print "LEVEL IS SAVED" : Wait 40 : Goto 1
  315. 10216 Rem ---
  316. 10217 Rem -----------  HORIZONTAL LINES  ------------------------
  317. 10218 Rem ---
  318. 10220 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT LEFT END OF LINE"
  319. 10221 Q=Mouse Click : If Q=0 Then Goto 10221
  320. 10222 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 4 : Plot X,Y
  321. 10223 Locate 0,0 : Print "ENTER NUMBER OF PIXELS LINE EXTENDS"
  322. 10224 Input L : Ink 4
  323. 10225 Draw X,Y To X+L,Y : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
  324. 10226 Rem -- 
  325. 10227 Rem ----------  VERTICAL LINES --------------------------- 
  326. 10228 Rem -- 
  327. 10230 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT TOP OF LINE"
  328. 10231 Q=Mouse Click : If Q=0 Then Goto 10231
  329. 10232 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 5 : Plot X,Y
  330. 10233 Locate 0,0 : Print "ENTER NUMBER OF PIXELS LINE EXTENDS"
  331. 10234 Input L : Ink 5
  332. 10235 Draw X,Y To X,Y+L : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
  333. 10236 Rem ---
  334. 10237 Rem ------------   HORIZONTAL ELECTRIC FENCE   ----------- 
  335. 10238 Rem ---
  336. 10240 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT LEFT END OF FENCE"
  337. 10241 Q=Mouse Click : If Q=0 Then Goto 10241
  338. 10242 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 3 : Plot X,Y
  339. 10243 Locate 0,0 : Print "ENTER NUMBER OF PIXELS FENCE EXTENDS"
  340. 10244 Input L : Ink 3
  341. 10245 Draw X,Y To X+L,Y : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
  342. 10246 Rem ---
  343. 10247 Rem -------------   VERTICAL ELECTRIC FENCES ------------
  344. 10248 Rem ---
  345. 10250 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT TOP OF FENCE"
  346. 10251 Q=Mouse Click : If Q=0 Then Goto 10251
  347. 10252 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 3 : Plot X,Y
  348. 10253 Locate 0,0 : Print "ENTER NUMBER OF PIXELS FENCE EXTENDS"
  349. 10254 Input L : Ink 3
  350. 10255 Draw X,Y To X,Y+L : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
  351. 10256 Rem ---
  352. 10257 Rem ------------------ POSITION HOUSE -------------------
  353. 10258 Rem ---
  354. 10260 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT TOP LEFT-HAND CORNER" : Print "OF HOUSE"
  355. 10261 Q=Mouse Click : If Q=0 Then Goto 10261
  356. 10262 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 10
  357. 10263 Bar X,Y To X+10,Y+10
  358. 10264 Ink 1 : Bar 0,0 To 300,19
  359. 10265 Goto 10201