DECLARE SUB paddle3 (x%)
DECLARE SUB paddle4 (x%)
DECLARE SUB stuff ()
DECLARE SUB ball (r, s)
DECLARE SUB ball2 (r, s)
DECLARE SUB p ()
DECLARE SUB paddle2 (x%)
DECLARE SUB paddle (x%)
DECLARE SUB goonies ()
DECLARE SUB opening ()
COMMON SHARED x
COMMON SHARED y
COMMON SHARED aa
COMMON SHARED bb
COMMON SHARED cc
COMMON SHARED dd
COMMON SHARED ee
COMMON SHARED ff
COMMON SHARED gg
COMMON SHARED hh
COMMON SHARED ii
COMMON SHARED jj
COMMON SHARED kk
COMMON SHARED ll
CALL opening
x = 65
y = 50
a = 3
aa = 1
bb = 14
cc = 1
dd = 14
ee = 14
ff = 14
gg = 14
hh = 14
ii = 14
jj = 14
kk = 14
ll = 14
mm = 14
nn = 14
CLS
SCREEN 12
CALL stuff
qw = 2
we = 1
er = 2
rt = 1
ty = 1
yu = 1
ui = 1
io = 1
op = 1
df = 1
dg = 1
fg = 1
DO
CLS
LOCATE 1, 2
INPUT "Choose difficulty: e - easy, m - medium, h - hard , p - psycho (you can't win so don't bother) q - quit: ", choose$
CLS
SELECT CASE choose$
CASE "e"
speed = 3
CASE "m"
speed = 5
CASE "h"
speed = 6
CASE "p"
speed = 11
CASE "q"
END
CASE ELSE
CLS
LOCATE 10, 10
PRINT "Sorry, you must have typed a wrong letter - restarting"
FOR x = 1 TO 35000: NEXT x
LOCATE 10, 65
PRINT "."
FOR x = 1 TO 15000: NEXT x
LOCATE 10, 66
PRINT "."
FOR x = 1 TO 15000: NEXT x
LOCATE 10, 67
PRINT "."
FOR x = 1 TO 15000: NEXT x
END SELECT
LOOP UNTIL choose$ = "e" OR choose$ = "m" OR choose$ = "h" OR choose$ = "p"
LOCATE 10, 2
PRINT "Instructions - Hit the blocks; use 4 and 6 to move. 4 is left;six, right"
LINE (20, 190)-(50, 205), 14, BF
LINE (20, 225)-(50, 240), 1, BF
LINE (20, 255)-(50, 270), 13, BF
LOCATE 13, 8
PRINT "- Only hit once"
LOCATE 15, 8
PRINT "- Hit twice"
LOCATE 17, 8
PRINT "- Indefinite hit value"
COLOR 0
INPUT "", dddd$
COLOR 15
CLS
RANDOMIZE TIMER
level = 1
r% = INT(RND * 2) + 1
SELECT CASE r%
CASE 1
movex1 = -speed
movey1 = -speed
CASE 2
movex1 = -speed
movey1 = speed
END SELECT
count% = 3
REM MUSIC-----------------------------------------------------------------
z$ = "mb l17c"
blocks% = 12
DO
D% = INT(RND * 639) + 1
r = 120
s = 395
x% = 100
DO
LOCATE 2, 3
PRINT "Lives in game: "; count%
LOCATE 3, 3
PRINT "Blocks left  : "; blocks%
LOCATE 1, 3
PRINT "Current level: "; level
CALL goonies
KEY$ = INKEY$
CALL ball(r, s)

'*****If pill touches paddle then make paddle bigger******'

 CALL paddle(x%)
FOR x = 1 TO 900: NEXT x

CALL p

'*****If pill touches paddle then make paddle bigger******'


CALL paddle2(x%)

CALL ball2(r, s)

'*******Paddle Movement******'

SELECT CASE KEY$
 
  CASE "4"
 x% = x% - 8
 
  CASE "6"
 x% = x% + 8
 
  CASE "q"
 EXIT DO

END SELECT

SELECT CASE r
   CASE IS <= 1
 movex1 = speed
 PLAY z$
 
   CASE IS >= 635
 movex1 = -speed
 PLAY z$
END SELECT

'*******s is when the ball moves up or down********'

SELECT CASE s
   CASE IS <= 1
 movey1 = speed
 PLAY z$
END SELECT
'********Boundries of paddle START*********'
 SELECT CASE s
   CASE IS > 391 AND s < 408
     IF (r > x% - 2) AND r < (x% + 5) THEN
 PLAY z$
 movey1 = -speed
 movex1 = -speed
   ELSEIF (r > x% + 4) AND r < (x% + 10) THEN
 PLAY z$
 movey1 = -speed
 movex1 = -speed + 1
   ELSEIF (r > x% + 9) AND r < (x% + 15) THEN
 PLAY z$
 movey1 = -speed
 movex1 = -speed + 2
   ELSEIF (r > x% + 14) AND r < (x% + 25) THEN
 PLAY z$
 movey1 = -speed
 movex1 = 0
   ELSEIF (r > x% + 24) AND r < (x% + 30) THEN
 PLAY z$
 movey1 = -speed
 movex1 = speed - 2
   ELSEIF (r > x% + 29) AND r < (x% + 35) THEN
 PLAY z$
 movey1 = -speed
 movex1 = speed - 1
   ELSEIF (r > x% + 34) AND r < (x% + 42) THEN
 PLAY z$
 movey1 = -speed
 movex1 = speed
   ELSE
   movey1 = speed
 END IF
     END SELECT

'**********Movement of ball************'
r = r + movex1
s = s + movey1

CALL stuff
IF x% >= 601 THEN x% = 600
IF x% <= -2 THEN x% = -1

REM******'the beginning of the blocks'*******


'**** Number 1 block*******#########################################
 
  '******Hit Bottom******
 IF s >= 58 AND s <= 65 THEN

   IF r >= 65 AND r <= 95 AND qw > 0 THEN
        qw = qw - 1
        IF qw <= 0 THEN
                aa = 0
        ELSEIF qw > 0 THEN
                aa = 1
         END IF
        PSET (65, 50)
        LINE -STEP(30, 15), aa, BF
        movey1 = speed
        PLAY z$
        IF aa = 0 THEN blocks% = blocks% - 1
    END IF
END IF
 
  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN
  
  IF r >= 65 AND r <= 95 AND qw > 0 THEN
        qw = qw - 1
        IF qw <= 0 THEN
                aa = 0
        ELSEIF qw > 0 THEN
                aa = 1
         END IF
        PSET (65, 50)
        LINE -STEP(30, 15), aa, BF
        movey1 = -speed

        PLAY z$
        IF aa = 0 THEN blocks% = blocks% - 1
  END IF
END IF

'**** Number 2 block*******#########################################

 '********Hit Bottom**********
 IF s >= 58 AND s <= 65 THEN
 
   IF r >= 105 AND r <= 135 AND we > 0 THEN
we = 0
bb = 0
PSET (105, 50)
LINE -STEP(30, 15), bb, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
    END IF
 END IF
 
 
  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN

   IF r >= 105 AND r <= 135 AND we = 1 THEN
we = we - 1
 IF we <= 0 THEN
 bb = 0

  PSET (105, 50)
  LINE -STEP(30, 15), bb, BF
  movey1 = -speed
PLAY z$
blocks% = blocks% - 1

   END IF
END IF
END IF

'**** Number 3 block*******#########################################

 IF s >= 58 AND s <= 65 THEN

  IF r >= 145 AND r <= 175 AND er > 0 THEN
er = er - 1
 IF er <= 0 THEN
cc = 0
 ELSEIF er > 0 THEN
 cc = 1
  END IF
   PSET (145, 50)
   LINE -STEP(30, 15), cc, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
 END IF
END IF

  '******Hit Top******

 IF s >= 50 AND s <= 57 THEN
 
   IF r >= 145 AND r <= 175 AND er > 0 THEN
er = er - 1
  IF er <= 0 THEN
 cc = 0
 ELSEIF er > 0 THEN
 cc = 1
 END IF
PSET (145, 50)
LINE -STEP(30, 15), cc, BF
movey1 = -speed

PLAY z$
IF cc = 0 THEN blocks% = blocks% - 1
  END IF
END IF

'**** Number 4 block*******#########################################

 IF s >= 58 AND s <= 65 THEN

  IF r >= 185 AND r <= 215 AND rt = 1 THEN
rt = 0
dd = 0
   PSET (185, 50)
   LINE -STEP(30, 15), dd, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
  END IF
END IF

  '******Hit Top******

 IF s >= 50 AND s <= 57 THEN
 
   IF r >= 185 AND r <= 215 AND rt > 0 THEN
rt = rt - 1
  IF rt <= 0 THEN
 dd = 0
 ELSEIF rt > 0 THEN
 dd = 1
END IF
PSET (185, 50)
LINE -STEP(30, 15), dd, BF
movey1 = -speed
PLAY z$
blocks% = blocks% - 1
  END IF
END IF

'**** Number 5 block*******#########################################

 IF s >= 58 AND s <= 65 THEN
   IF r >= 225 AND r <= 255 AND ty = 1 THEN
ty = 0
ee = 0
   PSET (225, 50)
   LINE -STEP(30, 15), ee, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
  END IF
END IF


  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN

   IF r >= 225 AND r <= 255 AND ty > 0 THEN
ty = ty - 1
  IF ty <= 0 THEN
 ff = 0
 ELSEIF ty > 0 THEN
 ff = 1
 END IF
PSET (225, 50)
LINE -STEP(30, 15), ff, BF
movey1 = -speed

PLAY z$
blocks% = blocks% - 1
  END IF
END IF

'**** Number 6 block*******#########################################
 IF s >= 58 AND s <= 65 THEN
 
   IF r >= 265 AND r <= 295 AND yu = 1 THEN
yu = 0
ff = 0
   PSET (265, 50)
   LINE -STEP(30, 15), ff, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
   END IF
END IF
 
  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN

   IF r >= 265 AND r <= 295 AND yu > 0 THEN
yu = yu - 1
  IF yu <= 0 THEN
 ff = 0
 ELSEIF yu > 0 THEN
 ff = 1
END IF
PSET (265, 50)
LINE -STEP(30, 15), ff, BF
movey1 = -speed

PLAY z$
blocks% = blocks% - 1
   END IF
END IF

'**** Number 7 block*******#########################################
 
 IF s >= 58 AND s <= 65 THEN
 
   IF r >= 305 AND r <= 335 AND ui = 1 THEN
ui = 0
gg = 0
   PSET (305, 50)
   LINE -STEP(30, 15), gg, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
   END IF
END IF

  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN

   IF r >= 305 AND r <= 335 AND ui > 0 THEN
ui = ui - 1
  IF ui <= 0 THEN
 gg = 0
 ELSEIF ui > 0 THEN
 gg = 1
 END IF
PSET (305, 50)
LINE -STEP(30, 15), gg, BF
movey1 = -speed
PLAY z$
blocks% = blocks% - 1
 END IF
END IF

'**** Number 8 block*******#########################################
  
 IF s >= 58 AND s <= 65 THEN
   IF r >= 345 AND r <= 375 AND io = 1 THEN
io = 0
hh = 0
   PSET (345, 50)
   LINE -STEP(30, 15), hh, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
  END IF
END IF

  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN

   IF r >= 345 AND r <= 375 AND io > 0 THEN
io = io - 1
  IF io <= 0 THEN
 hh = 0
 ELSEIF io > 0 THEN
 hh = 1
 END IF
PSET (345, 50)
LINE -STEP(30, 15), hh, BF
movey1 = -speed

PLAY z$
blocks% = blocks% - 1
 END IF
END IF

'**** Number 9 block*******#########################################
 IF s >= 58 AND s <= 65 THEN
 
   IF r >= 385 AND r <= 415 AND op = 1 THEN
op = 0
ii = 0
   PSET (385, 50)
   LINE -STEP(30, 15), ii, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
  END IF
END IF

  '******Hit Top******
 IF s >= 50 AND s <= 57 THEN

   IF r >= 385 AND r <= 415 AND op > 0 THEN
op = op - 1
  IF op <= 0 THEN
 ii = 0
 ELSEIF op > 0 THEN
 ii = 1
 END IF
PSET (385, 50)
LINE -STEP(30, 15), ii, BF
movey1 = -speed

PLAY z$
blocks% = blocks% - 1
 END IF
END IF
 
'**** Number 10 block*******#########################################
 
 IF s >= 58 AND s <= 65 THEN
   IF r >= 425 AND r <= 455 AND df = 1 THEN
df = 0
jj = 0
   PSET (425, 50)
   LINE -STEP(30, 15), jj, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
 END IF
END IF

  '******Hit Top******

 IF s >= 50 AND s <= 57 THEN
   IF r >= 425 AND r <= 455 AND df > 0 THEN
df = df - 1
  IF df <= 0 THEN
 jj = 0
 ELSEIF qw > 0 THEN
 jj = 1
END IF
PSET (425, 50)
LINE -STEP(30, 15), jj, BF
movey1 = -speed
PLAY z$
blocks% = blocks% - 1
   END IF
END IF

'**** Number 11 block*******#########################################
 
 IF s >= 58 AND s <= 65 THEN
   IF r >= 465 AND r <= 495 AND dg = 1 THEN
dg = 0
kk = 0
   PSET (465, 50)
   LINE -STEP(30, 15), kk, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
 END IF
END IF

  '******Hit Top******

 IF s >= 50 AND s <= 57 THEN
   IF r >= 465 AND r <= 495 AND dg > 0 THEN
dg = dg - 1
  IF dg <= 0 THEN
 kk = 0
 ELSEIF dg > 0 THEN
 kk = 1
 END IF
PSET (465, 50)
LINE -STEP(30, 15), kk, BF
movey1 = -speed

PLAY z$
blocks% = blocks% - 1
 END IF
END IF

'**** Number 12 block*******#########################################
 
 IF s >= 58 AND s <= 65 THEN
   IF r >= 505 AND r <= 535 AND fg = 1 THEN
fg = 0
ll = 0
   PSET (505, 50)
   LINE -STEP(30, 15), ll, BF
movey1 = speed
PLAY z$
blocks% = blocks% - 1
 END IF
END IF

  '******Hit Top******

 IF s >= 50 AND s <= 57 THEN
   IF r >= 505 AND r <= 535 AND fg > 0 THEN
fg = fg - 1
  IF fg <= 0 THEN
 ll = 0
 ELSEIF fg > 0 THEN
 ll = 1
 END IF
PSET (505, 50)
LINE -STEP(30, 15), ll, BF
movey1 = -speed

PLAY z$
blocks% = blocks% - 1
 END IF
END IF
LOOP UNTIL s >= 420 OR (aa = 0 AND bb = 0 AND cc = 0 AND dd = 0 AND ee = 0 AND ff = 0 AND gg = 0 AND hh = 0 AND ii = 0 AND jj = 0 AND kk = 0 AND ll = 0)
count% = count% - 1
IF KEY$ = "q" THEN EXIT DO
LOOP UNTIL count% = 0 OR (aa = 0 AND bb = 0 AND cc = 0 AND dd = 0 AND ee = 0 AND ff = 0 AND gg = 0 AND hh = 0 AND ii = 0 AND jj = 0 AND kk = 0 AND ll = 0)
CLS
SCREEN 13
IF (aa = 0 AND bb = 0 AND cc = 0 AND dd = 0 AND ee = 0 AND ff = 0 AND gg = 0 AND hh = 0 AND ii = 0 AND jj = 0 AND kk = 0 AND ll = 0) THEN
DO
LOCATE 10, 15
r% = INT(RND * 14) + 1
COLOR r%
PRINT "You have won!"
FOR zzz = 1 TO 2000: NEXT zzz
LOOP UNTIL INKEY$ <> ""
10 ELSEIF KEY$ = "q" THEN
DO
r% = INT(RND * 14) + 1
COLOR r%
LOCATE 10, 15
PRINT "You Quit!"
FOR zzz = 1 TO 2000: NEXT zzz
LOOP UNTIL INKEY$ <> ""
ELSE
DO
r% = INT(RND * 14) + 1
COLOR r%
LOCATE 10, 15
PRINT "Game Over"
FOR zzz = 1 TO 2000: NEXT zzz
LOOP UNTIL INKEY$ <> ""
END IF
COLOR 0
INPUT "", h$

END
SYSTEM

SUB ball (r, s)
CIRCLE (r, s), 5, 15
PAINT STEP(0, 0), 11, 15
END SUB

SUB ball2 (r, s)
CIRCLE (r, s), 5, 0
PAINT STEP(0, 0), 0, 0
END SUB

SUB goonies

PSET (65, 50)
LINE -STEP(30, 15), aa, BF
PSET (105, 50)
LINE -STEP(30, 15), bb, BF
PSET (145, 50)
LINE -STEP(30, 15), cc, BF
PSET (185, 50)
LINE -STEP(30, 15), dd, BF
PSET (225, 50)
LINE -STEP(30, 15), ee, BF
PSET (265, 50)
LINE -STEP(30, 15), ff, BF
PSET (305, 50)
LINE -STEP(30, 15), gg, BF
PSET (345, 50)
LINE -STEP(30, 15), hh, BF
PSET (385, 50)
LINE -STEP(30, 15), ii, BF
PSET (425, 50)
LINE -STEP(30, 15), jj, BF
PSET (465, 50)
LINE -STEP(30, 15), kk, BF
PSET (505, 50)
LINE -STEP(30, 15), ll, BF
END SUB

SUB opening
SCREEN 12
LINE (90, 60)-STEP(10, 340), 15, BF
LINE -STEP(400, -10), 15, BF
LINE -STEP(-10, -340), 15, BF
LINE -STEP(-400, 10), 15, BF

PSET (140, 200)
LINE -STEP(20, -40)
LINE -STEP(20, 40)
LINE -STEP(-10, -20)
LINE -STEP(-20, 0)
LINE STEP(40, 20)-STEP(0, -40)
LINE -STEP(25, 0)
LINE -STEP(0, 15)
LINE -STEP(-25, 0)
LINE -STEP(16, 0)
LINE -STEP(7, 25)
LINE STEP(10, 0)-STEP(20, -40)
LINE -STEP(20, 40)
LINE -STEP(-10, -20)
LINE -STEP(-20, 0)
LINE STEP(40, 20)-STEP(0, -40)
LINE STEP(0, 20)-STEP(20, -20)
LINE -STEP(-20, 20)
LINE -STEP(20, 20)
LINE STEP(10, 0)-STEP(0, -40)
LINE -STEP(25, 40)
LINE -STEP(0, -40)
CIRCLE STEP(20, 20), 20, 15, , , 1.5
LINE STEP(35, -20)-STEP(0, 40)
LINE STEP(10, 0)-STEP(-20, 0)
LINE -STEP(10, 0)
LINE -STEP(0, -40)
LINE -STEP(-10, 0)
LINE -STEP(20, 0)
LINE STEP(10, 0)-STEP(0, 0)
LINE -STEP(0, 40)
CIRCLE STEP(0, -20), 30, 15, 4.7, 1.56, .7
LOCATE 15, 15
PRINT "Press any key to continue"
DO
RANDOMIZE TIMER
r% = INT(RND * 14) + 1
PAINT (1, 1), r%, 15
LOOP UNTIL INKEY$ <> ""

END SUB

SUB p
'start! = TIMER
'DO
'LOOP UNTIL TIMER > .005
END SUB

SUB paddle (x%)
y = 400
PSET (x%, y)
LINE -STEP(40, 10), 4, B
PAINT STEP(-1, -1), 14, 4
LINE -STEP(-10, -9), 4
LINE -STEP(-10, 9), 4
LINE -STEP(-10, -9), 4
LINE -STEP(-10, 9), 4
END SUB

SUB paddle2 (x%)
y = 400
PSET (x%, y), 0
LINE -STEP(40, 10), 0, B
PAINT STEP(-1, -1), 0, 0
LINE -STEP(-10, -9), 0
LINE -STEP(-10, 9), 0
LINE -STEP(-10, -9), 0
LINE -STEP(-10, 9), 0
END SUB

SUB paddle3 (x%)
y = 400
PSET (x%, y)
LINE -STEP(70, 10), 4, B
PAINT STEP(-1, -1), 14, 4
LINE -STEP(-18, -9), 4
LINE -STEP(-17, 9), 4
LINE -STEP(-18, -9), 4
LINE -STEP(-17, 9), 4

END SUB

SUB paddle4 (x%)
PSET (x%, y)
LINE -STEP(70, 10), 0, B
PAINT STEP(-1, -1), 0, 0
LINE -STEP(-18, -9), 0
LINE -STEP(-17, 9), 0
LINE -STEP(-18, -9), 0
LINE -STEP(-17, 9), 0

END SUB

SUB pills
PSET (e, f)
LINE -STEP(15, 7), 15, BF
LINE STEP(-9, -6)-STEP(0, 5), 4
LINE STEP(0, -5)-STEP(3, 0), 4
LINE -STEP(0, 3), 4
LINE -STEP(-3, 0), 4
END SUB

SUB pills2
PSET (e, f)
LINE -STEP(15, 7), 0, BF
LINE STEP(-9, -6)-STEP(0, 5), 0
LINE STEP(0, -5)-STEP(3, 0), 0
LINE -STEP(0, 3), 0
LINE -STEP(-3, 0), 0
END SUB

SUB stuff
PSET (140, 200)
LINE -STEP(20, -40)
LINE -STEP(20, 40)
LINE -STEP(-10, -20)
LINE -STEP(-20, 0)
LINE STEP(40, 20)-STEP(0, -40)
LINE -STEP(25, 0)
LINE -STEP(0, 15)
LINE -STEP(-25, 0)
LINE -STEP(16, 0)
LINE -STEP(7, 25)
LINE STEP(10, 0)-STEP(20, -40)
LINE -STEP(20, 40)
LINE -STEP(-10, -20)
LINE -STEP(-20, 0)
LINE STEP(40, 20)-STEP(0, -40)
LINE STEP(0, 20)-STEP(20, -20)
LINE -STEP(-20, 20)
LINE -STEP(20, 20)
LINE STEP(10, 0)-STEP(0, -40)
LINE -STEP(25, 40)
LINE -STEP(0, -40)
CIRCLE STEP(20, 20), 20, 15, , , 1.5
LINE STEP(35, -20)-STEP(0, 40)
LINE STEP(10, 0)-STEP(-20, 0)
LINE -STEP(10, 0)
LINE -STEP(0, -40)
LINE -STEP(-10, 0)
LINE -STEP(20, 0)
LINE STEP(10, 0)-STEP(0, 0)
LINE -STEP(0, 40)
CIRCLE STEP(0, -20), 30, 15, 4.7, 1.56, .7

END SUB

