home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
351-375
/
apd360
/
johnny_ball.amos
/
johnny_ball.amosSourceCode
< prev
Wrap
AMOS Source Code
|
1988-11-13
|
13KB
|
359 lines
Rem
Rem
Rem ------------------------------------------------------------------
Rem
Rem JOHNNY BALL and LEVEL DESIGNER
Rem
Rem designed and written by Steven Lawson
Rem
Rem this program is public domain
Rem
Rem if you have any questions, comments or improvements
Rem
Rem write to me at: 24 Ryegate Crescent, Birstall, Leicester,
Rem
Rem Leicestershire, LE4 3HL. ENGLAND
Rem
Rem Also write to me if you are a fan of Jackie Chan or Cynthia
Rem
Rem Rothrock. I'm always looking for new pen pals who are into
Rem
Rem Chinese kung fu movies in a big way.
Rem ------------------------------------------------------------------
Rem
Rem
5555 Load "song"
5556 Volume 63
0 Screen Open 0,320,200,16,Lowres
1 Colour 1,$0 : Cls : Curs Off : Volume 63 : Music 1
2 Change Mouse 2
3 Gosub 10000
5 Pen 2
6 S=1 : E=3
7 L=0 : H=0
8 Limit Mouse : Curs Off : Flash 3,"(008,10)(010,10)"
9 Colour 1,$0 : If S>0 Then Cls
10 X=21 : If S=0 Then Load Iff L$ : E=3
11 Y=21
20 Curs Off
21 B=3
22 Ink 15 : Box 20,20 To 300,190
23 Locate 0,0 : Print " LIVES";E;" LEVEL";S
29 O=2000
30 If S=1 Then Gosub 300
31 If S=3 Then Gosub 400
32 If S=5 Then Gosub 450
33 If S=2 Then Gosub 500
34 If S=7 Then Gosub 550
3444 If S=4 Then Gosub 560
3445 If S=6 Then Gosub 580
3446 If S=8 Then Gosub 600
3447 If S=10 Then Gosub 620
3448 If S=9 Then Gosub 650
3449 If S=11 Then Gosub 700
35 Rem ++++++++++++++++++++++++++++++++++++++++++++++++
40 Locate 28,0 : Print "time";O
60 O=O-1 : If O<0 Then Goto 1000
61
62 Rem
64
65 Ink 1 : Bar X,Y To X+1,Y+1
66 A=Mouse Click : If A=0 or H>5 Then Goto 70
67 J=X Mouse : K=Y Mouse : J=J-135 : K=K-55
68 Ink 4 : Bar J,K To J+10,K+10 : H=H+1
69 Ink 5 : Bar J,K To J+1,K+10 : Bar J+9,K To J+10,K+10
70 If B=1 Then Goto 80
71 If B=2 Then Goto 90
72 If B=3 Then Goto 100
73 If B=4 Then Goto 110
80 Rem ball moving up left-----------------------------UP LEFT1
81 X=X-1 : Y=Y-1
82 If X-2<20 Then B=4 : Gosub 200 : Goto 70
83 If Y-2<20 Then B=2 : Gosub 200 : Goto 70
84 F=Point(X-2,Y-2) : If F=5 Then B=4 : Gosub 200 : Goto 70
85 If F=4 Then B=2 : Gosub 200 : Goto 70
86 If F=10 Then Gosub 210 : S=S+1 : Goto 7
87 If F=3 Then Goto 1100
88
89 Goto 125
90 Rem ball moving down left--------------------------DOWN LEFT 2
91 X=X-1 : Y=Y+1
92 If X-2<20 Then B=3 : Gosub 200 : Goto 70
93 If Y+2>190 Then B=1 : Gosub 200 : Goto 70
94 F=Point(X-2,Y+2) : If F=5 Then B=3 : Gosub 200 : Goto 70
95 If F=4 Then B=1 : Gosub 200 : Goto 70
96 If F=10 Then Gosub 210 : S=S+1 : Goto 7
97 If F=3 Then Goto 1100
98
99 Goto 125
100 Rem ball moving down right------------------------DOWN RIGHT
101 X=X+1 : Y=Y+1
102 If X+2>300 Then B=2 : Gosub 200 : Goto 70
103 If Y+2>190 Then B=4 : Gosub 200 : Goto 70
105 F=Point(X+2,Y+2) : If F=5 Then B=2 : Gosub 200 : Goto 70
106 If F=4 Then B=4 : Gosub 200 : Goto 70
107 If F=10 Then Gosub 210 : S=S+1 : Goto 7
108 If F=3 Then Goto 1100
109 Goto 125
110 Rem moving ball up right-------------------------UP RIGHT
111 X=X+1 : Y=Y-1
112 If X+2>300 Then B=1 : Gosub 200 : Goto 70
113 If Y-2<20 Then B=3 : Gosub 200 : Goto 70
114 F=Point(X+2,Y-2) : If F=5 Then B=1 : Gosub 200 : Goto 70
115 If F=4 Then B=3 : Gosub 200 : Goto 70
116 If F=10 Then Gosub 210 : S=S+1 : Goto 7
117 If F=3 Then Goto 1100
118
119 Goto 125
125 Ink 5 : Bar X,Y To X+1,Y+1
126 Goto 35
200 Bell 7 : Return
210 Locate 10,10 : Centre " LEVEL DONE! "
220 For U=1 To 2 : Wait 10 : Bell 50 : Wait 10 : Bell 40 : Wait 10 : Bell 60 : Wait 10 : Bell 40
230 Wait 10 : Next U
240 Q=Mouse Click : If Q=0 Then Goto 240
250 Return
300 Ink 10 : Bar 280,175 To 290,185
301 Ink 5 : Draw 270,190 To 270,50
302 Return
1000 Locate 10,10 : Centre "OUT OF TIME!"
1001 Wait 100 : E=E-1 : If E<1 Then Goto 1
1002 Goto 7
1100 Boom : Locate 10,10 : Centre "ELECTROCUTED!" : Wait 100 : E=E-1 : If E<1 Then Goto 1
1101 Goto 7
400 Ink 10 : Bar 165,175 To 175,185
401 Ink 5 : Draw 150,190 To 150,100 : Draw 190,190 To 190,100
402 Ink 3 : Draw 30,180 To 140,180
403 Return
450 Ink 10 : Bar 25,175 To 35,185
451 Ink 4 : Draw 21,170 To 260,170
452 Ink 3 : Draw 30,28 To 200,28
453 Return
500 Ink 10 : Bar 25,175 To 35,185
510 Ink 4 : Draw 21,170 To 250,170
511 Draw 40,150 To 300,150
512 Draw 21,40 To 260,40
513 Ink 3 : Draw 28,50 To 28,100
514 Return
550 Ink 10 : Bar 155,95 To 165,105
551 Ink 5 : Draw 150,90 To 150,110
552 Draw 170,90 To 170,110
555 Ink 4 : Draw 170,110 To 150,110
556 Return
560 Ink 10 : Bar 23,37 To 33,47
561 Ink 4 : Draw 21,50 To 41,50
562 Draw 80,50 To 300,50
563 Ink 3 : Draw 270,26 To 290,26
564 Return
580 Ink 10 : Bar 280,170 To 290,180
581 Ink 3 : Draw 297,160 To 297,187
582 Draw 297,187 To 265,187
583 Return
600 Ink 3 : Draw 20,60 To 300,60
601 Ink 4 : Draw 50,60 To 70,60
602
604 Ink 10 : Bar 275,30 To 285,40
605 Return
620 Ink 5 : Draw 40,20 To 40,170
621 Ink 3 : Draw 40,100 To 40,120
622 Ink 5 : Draw 60,40 To 60,190 : Bar 60,40 To 62,50
623 Ink 4 : Draw 60,40 To 280,40
624 Ink 5 : Draw 280,40 To 280,170
625 Ink 4 : Draw 280,170 To 80,170
626 Ink 3 : Draw 140,170 To 160,170
627 Ink 4 : Draw 60,150 To 260,150
628 Ink 5 : Draw 260,150 To 260,120 : Ink 4 : Bar 240,147 To 260,150
629 Ink 4 : Draw 280,100 To 220,100
630 Draw 260,120 To 220,120
631 Ink 10 : Bar 225,105 To 235,115
632 Ink 5 : Draw 220,120 To 220,100 : Return
650 Ink 3 : Draw 30,25 To 290,25
652 Draw 290,25 To 290,180 : Draw 290,180 To 25,180
653 Draw 25,180 To 25,30 : Ink 10
654 Bar 275,165 To 285,175
Return
700 For K=1 To 20 : V=Rnd(25) : If V<4 Then V=4
701 B=Rnd(20) : If B<4 Then B=4
702 Locate V,B : Pen 4 : Print "THE END"
703 Next K
704 Return
10000 Ink 4 : Circle 145,70,60 : Paint 145,70,1
10001 Ink 2 : Circle 125,50,10 : Paint 125,50,1
10002 Circle 165,50,10 : Paint 165,50,1 : Ink 1
10003 Circle 125,50,2 : Circle 165,50,2
10004 Circle 145,90,15 : Paint 145,90,1
10005 Pen 4
10006 Locate 1,19
10007 Print " JOHNNY BALL!"
10008 Print
10009 Print " BY STEVEN LAWSON"
10010 Print
10011 Print " CLICK MOUSE TO BEGIN"
10020 Q=Mouse Click : If Q=0 Then Goto 10020
55559 For H=63 To 0 Step -1 : Volume H : Wait 2 : Next H : Music Off : Volume 17
10021 Cls : Ink 6 : Bar 20,55 To 40,75 : Pen 6 : Locate 7,8 : Print "LOAD LEVEL"
10022 Ink 5 : Bar 20,15 To 40,35 : Pen 5 : Locate 7,3 : Print "PLAY JOHNNY BALL"
10023 Ink 4 : Bar 20,95 To 40,115 : Pen 4 : Locate 7,13 : Print "READ INSTRUCTIONS"
10024 Ink 12 : Bar 20,135 To 40,155 : Pen 12 : Locate 7,18 : Print "DESIGN LEVEL"
10025 Q=Mouse Click : If Q=0 Then Goto 10025
10026 X=X Mouse : Y=Y Mouse
10027 X=X-128 : Y=Y-50
10028 C=Point(X,Y) : If C=1 Then Goto 10025
10029 If C=5 Then Return
10030 If C=4 Then Goto 10040
10031 If C=12 Then Goto 10200
88888 If C=6 Then Goto 10110
10032 Goto 10025
10035 Rem ================================================
10036 Rem
10037 Rem THE INSTRUCTIONS ========================
10038 Rem
10039 Rem ================================================
10040 Cls : Pen 4
10041 Print " This game was designed to be a cross"
10042 Print
10043 Print "between Lemmings, Brat, and Deflektor."
10044 Print
10045 Print " The star of the game is Johnny, a "
10046 Print
10047 Print "small round character who bounces "
10048 Print
10049 Print "aimlessly around the screen. You must"
10050 Print
10051 Print "direct Johnny towards his house (shown"
10052 Print
10053 Print "as a pink block) by putting down cubes"
10054 Print
10055 Print "in his path which he will bounce off."
10056 Print
10057 Print " The aim is to bounce Johnny into his"
10058 Print
10059 Print "within the time limit, but with only"
10060 Print
10061 Print "six cubes."
10062 Print : Print : Print " CLICK MOUSE "
10063 Q=Mouse Click : If Q=0 Then Goto 10063
10064 Pen 5 : Print : Print
10065 Print " Cubes are positioned with a click of" : Print
10066 Print "either mouse button. When all six of" : Print
10067 Print "the cubes are used up, clicking will" : Print
10068 Print "have no effect." : Print
10069 Print " Whenever Johnny hits an object he " : Print
10070 Print "will bounce off, with two exceptions :" : Print
10071 Print " If he hits an electric fence (shown" : Print
10072 Print "as a flashing wall) he will die. If " : Print
10073 Print "he makes contact with his house, he " : Print
10074 Print "automatically enters and the level is" : Print
10075 Print "completed." : Print
10076 Print " CLICK MOUSE "
10077 Q=Mouse Click : If Q=0 Then Goto 10077
10078 Pen 4 : Print : Print
10079 Print " When using the level designer, type" : Print
10080 Print "VL for a vertical line, HL for a " : Print
10081 Print "horizontal wall, VE for a vertical " : Print
10082 Print "electric fence and HE for a horizontal" : Print
10083 Print "electric fence. " : Print
10084 Print " Type PH to position Johnny's house. " : Print
10085 Print "After you have typed one of these " : Print
10086 Print "commands you can click the start point" : Print
10087 Print "of the line or position of the house " : Print
10088 Print "with either mouse button, and then type" : Print
10089 Print "the number of pixels the line extends." : Print
10090 Rem
10091 Print " CLICK MOUSE"
999999 Q=Mouse Click : If Q=0 Then Goto 999999
10092 Pen 5 : Print : Print
10093 Print " Things to remember :" : Print
10094 Print "When drawing lines and fences the point" : Print
10095 Print "you click should be at the TOP of a " : Print
10096 Print "vertical line or the LEFT end of a " : Print
10097 Print "horizontal line. Also, the point you " : Print
10098 Print "click for the house will be where the " : Print
10099 Print "house's top left-hand corner will be." : Print
10100 Print " When you have finished, type SAVE and" : Print
10101 Print "a filename and the level will be saved." : Print
10102 Print " If you enter QUIT as the filename the" : Print
10103 Print "design will be aborted."
10104 Print : Print
10105 Print " CLICK MOUSE"
10106 Q=Mouse Click : If Q=0 Then Goto 10106
10107 Goto 1
10108 Rem ---------------------- LOADING A LEVEL ---------------
10109 Rem-------------------- -----------
10110 Cls : Pen 5 : Print : Print : Print
10111 Print " ENTER FILENAME OF LEVEL TO LOAD"
10112 Print
10113 Input L$
10114 Cls : Locate 1,10 : Curs Off
10115 Print " LOADING"
10116 Load Iff L$,1 : Flash 3,"(008,10)(010,10)" : Curs Off
10117 S=0 : Goto 10
10118 Rem --------------------------------------------------
10119 Rem ==================================================
10120 Rem
10121 Rem -------- L E V E L D E S I G N E R ----------
10122 Rem
10123 Rem ==================================================
10124 Rem --------------------------------------------------
10125 Rem
10200 Cls : Ink 15 : Box 20,20 To 300,190
10201 Pen 2 : Locate 0,0
10202 Print "COMMAND" : Input Z$
10203 If Z$="HL" Then Goto 10220
10204 If Z$="VL" Then Goto 10230
10205 If Z$="HE" Then Goto 10240
10206 If Z$="VE" Then Goto 10250
10207 If Z$="PH" Then Goto 10260
10208 If Z$="SAVE" Then Ink 1 : Bar 0,0 To 300,19 : Goto 10210
10209 Goto 10201
10210 Locate 0,0 : Print "FILENAME :"
10211 Rem
10212 Input L$ : Curs Off
10213 If L$="QUIT" Then Goto 1
10214 Bar 0,0 To 300,19 : Save Iff L$
10215 Locate 0,0 : Print "LEVEL IS SAVED" : Wait 40 : Goto 1
10216 Rem ---
10217 Rem ----------- HORIZONTAL LINES ------------------------
10218 Rem ---
10220 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT LEFT END OF LINE"
10221 Q=Mouse Click : If Q=0 Then Goto 10221
10222 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 4 : Plot X,Y
10223 Locate 0,0 : Print "ENTER NUMBER OF PIXELS LINE EXTENDS"
10224 Input L : Ink 4
10225 Draw X,Y To X+L,Y : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
10226 Rem --
10227 Rem ---------- VERTICAL LINES ---------------------------
10228 Rem --
10230 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT TOP OF LINE"
10231 Q=Mouse Click : If Q=0 Then Goto 10231
10232 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 5 : Plot X,Y
10233 Locate 0,0 : Print "ENTER NUMBER OF PIXELS LINE EXTENDS"
10234 Input L : Ink 5
10235 Draw X,Y To X,Y+L : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
10236 Rem ---
10237 Rem ------------ HORIZONTAL ELECTRIC FENCE -----------
10238 Rem ---
10240 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT LEFT END OF FENCE"
10241 Q=Mouse Click : If Q=0 Then Goto 10241
10242 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 3 : Plot X,Y
10243 Locate 0,0 : Print "ENTER NUMBER OF PIXELS FENCE EXTENDS"
10244 Input L : Ink 3
10245 Draw X,Y To X+L,Y : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
10246 Rem ---
10247 Rem ------------- VERTICAL ELECTRIC FENCES ------------
10248 Rem ---
10250 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT TOP OF FENCE"
10251 Q=Mouse Click : If Q=0 Then Goto 10251
10252 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 3 : Plot X,Y
10253 Locate 0,0 : Print "ENTER NUMBER OF PIXELS FENCE EXTENDS"
10254 Input L : Ink 3
10255 Draw X,Y To X,Y+L : Ink 1 : Bar 0,0 To 300,19 : Goto 10201
10256 Rem ---
10257 Rem ------------------ POSITION HOUSE -------------------
10258 Rem ---
10260 Ink 1 : Bar 0,0 To 300,19 : Locate 0,0 : Print "CLICK MOUSE AT TOP LEFT-HAND CORNER" : Print "OF HOUSE"
10261 Q=Mouse Click : If Q=0 Then Goto 10261
10262 X=X Mouse : Y=Y Mouse : X=X-128 : Y=Y-50 : Ink 10
10263 Bar X,Y To X+10,Y+10
10264 Ink 1 : Bar 0,0 To 300,19
10265 Goto 10201