10 GOSUB 1000:A=RND(-ABS(TMR(0)))
60 CLS:CO=8:SF=4:FOR X=0 TO 31:GPRINT CHR$(167),X,0,CO,SF:NEXT
70 CO=11:FOR X=0 TO 31:GPRINT CHR$(167),X,1,CO,SF:NEXT
80 CO=15:FOR Y=4 TO 5:FOR X=0 TO 31:GPRINT CHR$(167),X,Y,CO,SF:NEXT:NEXT
90 BX=14
100 LI=5:SC=0
110 GOSUB 420
120 K=INKEY(10):IF K<>32 THEN 120
130 GOTO 160:REM start the game
140 C$=CHR$(165)+CHR$(165)+CHR$(165)+CHR$(165)
145 IF BX>0 THEN A$="  ":H=BX-2:ELSE A$="":H=BX
146 IF BX<28 THEN B$="  ":ELSE B$=""
147 D$=A$+C$+B$
148 GPRINT D$,H,22
150 RETURN
160 XA=1:YA=1:IF INT(RND(1)*2)=1 THEN XA=-XA:REM for each life start here
170 GOSUB 140
190 X=BX+2:Y=11:X1=X:Y1=Y
200 X1=X+XA:Y1=Y+YA:REM start of main loop
210 IF X1=0 OR X1=31 THEN XA=-XA
220 GOSUB 360
230 IF Y1=22 AND X1>BX-1 AND X1<BX+5 THEN 233:ELSE 240
233 YA=-YA:Y1=Y1-2:SOUND 1,2000,10:A=((X>BX+4)OR(X<BX))
236 IF A=-1 THEN XA=XA*A:X1=X1+XA:Y1=Y1+1
240 IF Y1=23 THEN GPRINT " ",X,Y:GOTO 330
250 GOSUB 140
260 T=POINT((8*X1),(8*Y1)):IF T<>0 THEN YA=-YA:XZ=X1:YZ=Y1:Y1=Y1+YA:GOSUB 390
265 IF T=11 THEN SC=SC+10:GOSUB 420
270 IF T=8 THEN SC=SC+20:GOSUB 420
280 If T=15 THEN SC=SC+5:GOSUB 420
290 IF Y1=0 THEN YA=1
300 GPRINT " ",X,Y:GPRINT CHR$(223),X1,Y1:X=X1:Y=Y1
310 IF Y=0 OR X=0 OR X=31 THEN SOUND 1,4050,10
320 GOTO 200:REM finish of main loop
330 LI=LI-1:SOUND 1,100,100:IF LI=0 THEN GOTO 400
340 GOSUB 420
350 GOTO 160
360 K=INKEY(5) AND 223
365 IF (K=28 OR K=90) AND BX>0 THEN BX=BX-2:ELSE 370
367 IF BX<0 THEN BX=0
368 RETURN
370 IF (K=29 OR K=88) AND BX<28 THEN BX=BX+2:IF BX>28 THEN BX=28
380 RETURN
390 GPRINT " ",XZ,YZ:RETURN
400 IF SC>=HI THEN HI=SC
410 SC=0:LI=5:GOSUB 420:GOTO 60
420 SOUND 1,3000,10:A$="HI"+STR$(HI):GPRINT A$,0,23
430 A$="PTS"+STR$(SC):GPRINT A$,14,23
440 A$=CHR$(223)+STR$(LI):GPRINT A$,29,23:RETURN
1000 SCREEN 2:COLOR 15,4,4:VOLUME 0,15
1010 Y=3:CO=1:SF=15:A$=" >  B U S T O U T  < ":GOSUB 2000
1020 Y=5:CO=7:SF=1:A$="by Alexander Martin (1984)":GOSUB 2000
1030 Y=7:CO=8:A$="ported to LM80C BASIC":GOSUB 2000
1040 Y=8:A$="by Leonardo Miliani (2023)":GOSUB 2000
1050 Y=12:CO=15:A$="Move the bar by using the left":GOSUB 2000
1060 Y=13:A$="& right arrow keys or Z and X.":GOSUB 2000
1070 Y=14:A$="Press SPACE to start a game.":GOSUB 2000
1080 Y=16:A$="Press any key to continue":GOSUB 2000
1090 SOUND 1,4000,10:K=INKEY(0)
1100 K=INKEY(5):IF K=0 THEN 1100
1110 RETURN
2000 X=(32-LEN(A$))#2:GPRINT A$,X,Y,CO,SF:RETURN
