DECLARE SUB REPLAY (repx%, repy%, repc%)
DECLARE SUB FINAL2 (f2x%, f2y%, f2c%)
DECLARE SUB FINAL (finx%, finy%, finc%)
DECLARE SUB LEVEL3p2 (l3p2x%, l3p2y%, l3p2c%)
DECLARE SUB LEVEL3 (l3x%, l3y%, l3c%)
DECLARE SUB FIREBALL4 (fire4x%, fire4y%, fire4c%)
DECLARE SUB FIREBALL5 (fire5x%, fire5y%, fire5c%)
DECLARE SUB FIREBALL6 (fire6x%, fire6y%, fire6c%)
DECLARE SUB FIREBALL7 (fire7x%, fire7y%, fire7c%)
DECLARE SUB ERASEFIREBALL4 (fire4x%, fire4y%, fire4c%)
DECLARE SUB ERASEFIREBALL5 (fire5x%, fire5y%, fire5c%)
DECLARE SUB ERASEFIREBALL6 (fire6x%, fire6y%, fire6c%)
DECLARE SUB ERASEFIREBALL7 (fire7x%, fire7y%, fire7c%)
DECLARE SUB red (redx%, redy%, redc%)
DECLARE SUB erasered (redx%, redy%, redc%)
DECLARE SUB LEVEL2p2 (l2p2x%, l2p2y%, l2p2c%)
DECLARE SUB TITLE (tx%, ty%, tc%)
DECLARE SUB ESIDEFIRE2 (s2x%, s2y%, s2c%)
DECLARE SUB ESIDEFIRE3 (s3x%, s3y%, s3c%)
DECLARE SUB ESIDEFIRE4 (s4x%, s4y%, s4c%)
DECLARE SUB SIDEFIRE2 (s2x%, s2y%, s2c%)
DECLARE SUB SIDEFIRE3 (s3x%, s3y%, s3c%)
DECLARE SUB SIDEFIRE4 (s4x%, s4y%, s4c%)
DECLARE SUB SIDEFIRE1 (s1x%, s1y%, s1c%)
DECLARE SUB ESIDEFIRE1 (s1x%, s1y%, s1c%)
DECLARE SUB BOTFIRE2 (b2firex%, b2firey%, b2firec%)
DECLARE SUB BOTFIRE3 (b3firex%, b3firey%, b3firec%)
DECLARE SUB ERASEBOTFIRE2 (b2firex%, b2firey%, b2firec%)
DECLARE SUB ERASEBOTFIRE3 (b3firex%, b3firey%, b3firec%)
DECLARE SUB LEVEL2 (l2x%, l2y%, l2c%)
DECLARE SUB CHARACTER2 (c2x%, c2y%, c2c%)
DECLARE SUB LEVEL1p2 (l1p2x%, l1p2y%, l1p2c%)
DECLARE SUB erasecharacter2 (c2x%, c2y%, c2c%)
DECLARE SUB LEVEL1 (l1x%, l1y%, l1c%)
DECLARE SUB FIREBALL3 (fire3x%, fire3y%, fire3c%)
DECLARE SUB ERASEFIREBALL3 (fire3x%, fire3y%, fire3c%)
DECLARE SUB CLOUD (x%, y%, c%)
DECLARE SUB ERASEFIREBALL2 (fire2x%, fire2y%, fire2c%)
DECLARE SUB FIREBALL (fx%, fy%, fc%)
DECLARE SUB ERASEFIREBALL (fx%, fy%, fc%)
DECLARE SUB FIREBALL2 (fire2x%, fire2y%, fire2c%)
DECLARE SUB FLOWER1 (f1x%, f1y%, f1c%)
DECLARE SUB FLOWER2 (f2x%, f2y%, f2c%)
DECLARE SUB KIRBY (kx%, ky%, kc%)
DECLARE SUB BACKGROUND2 (b2x%, b2y%, b2c%)
DECLARE SUB erasecharacter1 (cx%, cy%, cc%)
DECLARE SUB PAUSE (time%)
DECLARE SUB CHARACTER1 (cx%, cy%, cc%)
DECLARE SUB COIN (coinx%, coiny%, coinc%)
DECLARE SUB RULES (rx%, ry%, rc%)
DECLARE SUB BACKGROUND (bx%, by%, bc%)

SCREEN 12

CALL TITLE(tx%, ty%, tc%)
CALL RULES(rx%, ry%, rc%)

REM *********** Character 1 intro.

CALL BACKGROUND(bx%, by%, bc%)
CALL COIN(coinx%, coiny%, coinc%)

cx% = -100
cy% = 36

FOR i% = 1 TO 17

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)

cx% = cx% + 10

NEXT i%

FOR i2% = 1 TO 6

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)

cx% = cx% + 5
cy% = cy% - 10

NEXT i2%

FOR i3% = 1 TO 6

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)

cx% = cx% + 5
cy% = cy% + 10

NEXT i3%

CALL CHARACTER1(cx%, cy%, cc%)

FOR i4% = 1 TO 1
 
   LOCATE 20, 28
      PRINT "Player 1"
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3

NEXT i4%


REM*********** Character 2 intro.

CLS

CALL BACKGROUND2(b2x%, b2y%, b2c%)
CALL KIRBY(kx%, ky%, kc%)

FOR i5% = 1 TO 1
   LOCATE 20, 38
      PRINT "Player 2"
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3
NEXT i5%

REM*********** Start of game.


CALL LEVEL1(l1x%, l1y%, l1c%)
CALL LEVEL1p2(l1p2x%, l1p2y%, l1p2c%)
CALL LEVEL2(l2x%, l2y%, l2c%)
CALL LEVEL2p2(l2p2x%, l2p2y%, l2p2c%)
CALL LEVEL3(l3x%, l3y%, l3c%)
CALL LEVEL3p2(l3p2x%, l3p2y%, l3p2c%)
CALL FINAL(finx%, finy%, finc%)

time% = INT(RND * 10) + 1
CALL PAUSE(time%)
CALL FINAL2(f2x%, f2y%, f2c%)

SUB BACKGROUND (bx%, by%, bc%)

CLS

LINE (0, 380)-(640, 380), 10
PAINT (0, 381), 10, 10
PAINT (0, 0), 1, 10
LINE (500, 398)-(540, 398), 2  'pipe
LINE (500, 398)-(500, 340), 2
LINE (540, 340)-(540, 398), 2
LINE (500, 340)-(540, 340), 2
PAINT (501, 341), 2, 2
LINE (490, 330)-(550, 340), 2, BF


   Key$ = INKEY$
   LINE (518, 340)-(522, 300), 2, BF  'flower
   LINE (518, 329)-(522, 329), 0
   CIRCLE (520, 280), 20, 4
   PAINT (520, 280), 4, 4
   LINE (500, 260)-(520, 285), 1
   LINE (540, 260)-(520, 285), 1
   PAINT (520, 268), 1, 1
   LINE (520, 277)-(530, 265)
   LINE (520, 277)-(510, 265)
   LINE (530, 265)-(535, 267)
   LINE (510, 265)-(505, 267)
   LINE (520, 285)-(505, 267)
   LINE (520, 285)-(535, 267)
   PAINT (520, 280)


FOR i% = 1 TO 3
CIRCLE (100 + x%, 100 + y%), 15
CIRCLE (90 + x%, 109 + y%), 12
CIRCLE (130 + x%, 100 + y%), 12
CIRCLE (117 + x%, 116 + y%), 14
CIRCLE (133 + x%, 120 + y%), 14
CIRCLE (115 + x%, 94 + y%), 8
PAINT (100 + x%, 100 + y%)
PAINT (90 + x%, 109 + y%)
PAINT (130 + x%, 100 + y%)
PAINT (117 + x%, 116 + y%)
PAINT (133 + x%, 120 + y%)
PAINT (115 + x%, 94 + y%)
PAINT (120 + x%, 120 + y%)
PAINT (133 + x%, 110 + y%)
PAINT (85 + x%, 110 + y%)
PAINT (110 + x%, 95 + y%)
PAINT (120 + x%, 95 + y%)
PAINT (110 + x%, 120 + y%)
LINE (105 + x%, 100 + y%)-(130 + x%, 125 + y%), , BF
CIRCLE (100 + x%, 114 + y%), 16
PAINT (100 + x%, 120 + y%)

x% = x% + 250

NEXT i%

END SUB

SUB BACKGROUND2 (b2x%, b2y%, b2c%)

LINE (0, 400)-(640, 400), 2  ' background
PAINT (1, 402), 2, 2
PAINT (2, 390), 1, 2

CIRCLE (500, 75), 20, 14' sun
PAINT (500, 75), 14, 14

FOR i% = 1 TO 3                             '    cloud
CIRCLE (100 + x%, 100 + y%), 15
CIRCLE (90 + x%, 109 + y%), 12
CIRCLE (130 + x%, 100 + y%), 12
CIRCLE (117 + x%, 116 + y%), 14
CIRCLE (133 + x%, 120 + y%), 14
CIRCLE (115 + x%, 94 + y%), 8
PAINT (100 + x%, 100 + y%)
PAINT (90 + x%, 109 + y%)
PAINT (130 + x%, 100 + y%)
PAINT (117 + x%, 116 + y%)
PAINT (133 + x%, 120 + y%)
PAINT (115 + x%, 94 + y%)
PAINT (120 + x%, 120 + y%)
PAINT (133 + x%, 110 + y%)
PAINT (85 + x%, 110 + y%)
PAINT (110 + x%, 95 + y%)
PAINT (120 + x%, 95 + y%)
PAINT (110 + x%, 120 + y%)
LINE (105 + x%, 100 + y%)-(130 + x%, 125 + y%), , BF
CIRCLE (100 + x%, 114 + y%), 16
PAINT (100 + x%, 120 + y%)

x% = x% + 400
NEXT i%


END SUB

SUB BOTFIRE2 (b2firex%, b2firey%, b2firec%)

CIRCLE (520 + b2firex%, 270 + b2firey%), 5, 14
PAINT (520 + b2firex%, 270 + b2firey%), 14, 14

END SUB

SUB BOTFIRE3 (b3firex%, b3firey%, b3firec%)

CIRCLE (520 + b3firex%, 270 + b3firey%), 5, 14
PAINT (520 + b3firex%, 270 + b3firey%), 14, 14


END SUB

SUB CHARACTER1 (cx%, cy%, cc%)
LINE (100 + cx%, 300 + cy%)-(118 + cx%, 300 + cy%), 4
LINE (100 + cx%, 301 + cy%)-(118 + cx%, 301 + cy%), 4
LINE (100 + cx%, 302 + cy%)-(118 + cx%, 302 + cy%), 4
LINE (118 + cx%, 296 + cy%)-(130 + cx%, 305 + cy%), 6, BF
LINE (97 + cx%, 303 + cy%)-(121 + cx%, 305 + cy%), 4, BF
LINE (97 + cx%, 306 + cy%)-(121 + cx%, 318 + cy%), 6, BF
LINE (97 + cx%, 306 + cy%)-(106 + cx%, 309 + cy%), 0, BF
LINE (110 + cx%, 306 + cy%)-(113 + cx%, 309 + cy%), 9, BF
LINE (118 + cx%, 306 + cy%)-(130 + cx%, 312 + cy%), 8, BF
LINE (94 + cx%, 309 + cy%)-(97 + cx%, 318 + cy%), 0, BF
LINE (98 + cx%, 315 + cy%)-(101 + cx%, 318 + cy%), 0, BF
LINE (102 + cx%, 306 + cy%)-(105 + cx%, 315 + cy%), 0, BF
LINE (105 + cx%, 312 + cy%)-(108 + cx%, 315 + cy%), 0, BF
LINE (116 + cx%, 313 + cy%)-(122 + cx%, 315 + cy%), 0, BF
LINE (123 + cx%, 312 + cy%)-(126 + cx%, 315 + cy%), 8, BF
LINE (115 + cx%, 309 + cy%)-(123 + cx%, 312 + cy%), 6, BF
LINE (120 + cx%, 315 + cy%)-(126 + cx%, 318 + cy%), 8, BF

LINE (81 + cx%, 324 + cy%)-(93 + cx%, 330 + cy%), 6, BF

LINE (87 + cx%, 318 + cy%)-(123 + cx%, 327 + cy%), 8, BF

LINE (114 + cx%, 318 + cy%)-(117 + cx%, 321 + cy%), 4, BF
LINE (102 + cx%, 318 + cy%)-(105 + cx%, 321 + cy%), 4, BF
LINE (105 + cx%, 321 + cy%)-(108 + cx%, 324 + cy%), 4, BF
LINE (117 + cx%, 321 + cy%)-(123 + cx%, 324 + cy%), 4, BF

LINE (105 + cx%, 324 + cy%)-(123 + cx%, 336 + cy%), 4, BF

LINE (117 + cx%, 327 + cy%)-(120 + cx%, 330 + cy%), 6, BF
LINE (109 + cx%, 327 + cy%)-(112 + cx%, 330 + cy%), 6, BF
LINE (123 + cx%, 327 + cy%)-(132 + cx%, 336 + cy%), 8, BF
LINE (126 + cx%, 321 + cy%)-(132 + cx%, 336 + cy%), 8, BF

LINE (84 + cx%, 321 + cy%)-(87 + cx%, 324 + cy%), 8, BF
LINE (84 + cx%, 330 + cy%)-(90 + cx%, 333 + cy%), 6, BF

LINE (93 + cx%, 327 + cy%)-(108 + cx%, 342 + cy%), 4, BF
LINE (99 + cx%, 327 + cy%)-(102 + cx%, 330 + cy%), 8, BF
LINE (93 + cx%, 333 + cy%)-(96 + cx%, 336 + cy%), 8, BF
LINE (90 + cx%, 330 + cy%)-(93 + cx%, 339 + cy%), 8, BF
LINE (87 + cx%, 333 + cy%)-(90 + cx%, 342 + cy%), 8, BF
LINE (84 + cx%, 336 + cy%)-(87 + cx%, 342 + cy%), 8, BF
LINE (108 + cx%, 336 + cy%)-(117 + cx%, 339 + cy%), 4, BF


END SUB

SUB CHARACTER2 (c2x%, c2y%, c2c%)

CIRCLE (290 + c2x%, 350 + c2y%), 15, 13  ' kirby
CIRCLE (350 + c2x%, 350 + c2y%), 15, 13
CIRCLE (350 + c2x%, 350 + c2y%), 15, 0
CIRCLE (290 + c2x%, 350 + c2y%), 15, 0
PAINT (290 + c2x%, 350 + c2y%), 13, 0
PAINT (350 + c2x%, 350 + c2y%), 13, 0
CIRCLE (320 + c2x%, 380 + c2y%), 40, 13
PAINT (320 + c2x%, 380 + c2y%), 13, 13
CIRCLE (310 + c2x%, 370 + c2y%), 8
CIRCLE (330 + c2x%, 370 + c2y%), 8
PAINT (310 + c2x%, 370 + c2y%)
PAINT (330 + c2x%, 370 + c2y%)
CIRCLE (310 + c2x%, 370 + c2y%), 2, 0
CIRCLE (330 + c2x%, 370 + c2y%), 2, 0
PAINT (310 + c2x%, 370 + c2y%), 0, 0
PAINT (330 + c2x%, 370 + c2y%), 0, 0
CIRCLE (320 + c2x%, 380 + c2y%), 40, 0
CIRCLE (320 + c2x%, 390 + c2y%), 6, 0
PAINT (320 + c2x%, 390 + c2y%), 0, 0

END SUB

   SUB CLOUD (x%, y%, c%)
x% = 0
FOR i% = 1 TO 3
CIRCLE (100 + x%, 100 + y%), 15
CIRCLE (90 + x%, 109 + y%), 12
CIRCLE (130 + x%, 100 + y%), 12
CIRCLE (117 + x%, 116 + y%), 14
CIRCLE (133 + x%, 120 + y%), 14
CIRCLE (115 + x%, 94 + y%), 8
PAINT (100 + x%, 100 + y%)
PAINT (90 + x%, 109 + y%)
PAINT (130 + x%, 100 + y%)
PAINT (117 + x%, 116 + y%)
PAINT (133 + x%, 120 + y%)
PAINT (115 + x%, 94 + y%)
PAINT (120 + x%, 120 + y%)
PAINT (133 + x%, 110 + y%)
PAINT (85 + x%, 110 + y%)
PAINT (110 + x%, 95 + y%)
PAINT (120 + x%, 95 + y%)
PAINT (110 + x%, 120 + y%)
LINE (105 + x%, 100 + y%)-(130 + x%, 125 + y%), , BF
CIRCLE (100 + x%, 114 + y%), 16
PAINT (100 + x%, 120 + y%)

x% = x% + 250

NEXT i%

END SUB

SUB COIN (coinx%, coiny%, coinc%)

LINE (200, 300)-(200, 316), 0  'coin
LINE (218, 300)-(218, 316), 0
LINE (200, 316)-(201, 316), 0
LINE (201, 316)-(201, 319), 0
LINE (201, 319)-(202, 319), 0
LINE (202, 319)-(202, 320), 0
LINE (202, 320)-(203, 320), 0
LINE (203, 320)-(203, 321), 0
LINE (203, 321)-(206, 321), 0
LINE (206, 321)-(206, 322), 0
LINE (206, 322)-(215, 322), 0

LINE (218, 316)-(217, 316), 0
LINE (217, 316)-(217, 319), 0
LINE (217, 319)-(216, 319), 0
LINE (216, 319)-(216, 320), 0
LINE (216, 320)-(215, 320), 0
LINE (215, 320)-(215, 321), 0
LINE (215, 321)-(214, 321), 0
LINE (214, 321)-(212, 322), 0

LINE (200, 300)-(201, 300), 0
LINE (201, 300)-(201, 297), 0
LINE (201, 297)-(202, 297), 0
LINE (202, 297)-(202, 296), 0
LINE (202, 296)-(203, 296), 0
LINE (203, 296)-(203, 295), 0
LINE (203, 295)-(206, 295), 0
LINE (206, 295)-(206, 294), 0
LINE (206, 295)-(215, 295), 0

LINE (218, 300)-(217, 300), 0
LINE (217, 300)-(217, 297), 0
LINE (217, 297)-(216, 297), 0
LINE (216, 297)-(216, 296), 0
LINE (216, 296)-(215, 296), 0
LINE (215, 296)-(215, 295), 0
LINE (215, 295)-(212, 295), 0
LINE (212, 295)-(212, 294), 0

LINE (208, 319)-(213, 319), 0
LINE (207, 318)-(207, 316), 0
LINE (208, 316)-(208, 314), 0
LINE (209, 314)-(209, 312), 0
LINE (210, 312)-(210, 311), 0
LINE (208, 310)-(210, 310), 0
LINE (205, 309)-(208, 309), 0
LINE (206, 308)-(208, 308), 0
LINE (209, 306)-(209, 308), 0
LINE (209, 308)-(211, 308), 0
LINE (204, 308)-(205, 309), 0
LINE (203, 305)-(203, 308), 0
LINE (204, 304)-(205, 304), 0
LINE (205, 303)-(209, 303), 0
LINE (209, 303)-(209, 300), 0
LINE (210, 299)-(212, 299), 0
LINE (210, 301)-(210, 303), 0
LINE (213, 300)-(213, 303), 0
LINE (210, 304)-(212, 304), 0
LINE (214, 301)-(214, 302), 0
LINE (215, 303)-(215, 306), 0
LINE (214, 307)-(214, 308), 0
LINE (213, 309)-(213, 313), 0
LINE (213, 313)-(217, 313), 0
PAINT (203, 303), 14, 0
PAINT (212, 300), 14, 0


END SUB

SUB ERASEBOTFIRE2 (b2firex%, b2firey%, b2firec%)

CIRCLE (520 + b2firex%, 270 + b2firey%), 5, 1
PAINT (520 + b2firex%, 270 + b2firey%), 1, 1

END SUB

SUB ERASEBOTFIRE3 (b3firex%, b3firey%, b3firec%)

CIRCLE (520 + b3firex%, 270 + b3firey%), 5, 1
PAINT (520 + b3firex%, 270 + b3firey%), 1, 1

END SUB

SUB erasecharacter1 (cx%, cy%, cc%)

LINE (100 + cx%, 300 + cy%)-(118 + cx%, 300 + cy%), 1
LINE (100 + cx%, 301 + cy%)-(118 + cx%, 301 + cy%), 1
LINE (100 + cx%, 302 + cy%)-(118 + cx%, 302 + cy%), 1
LINE (118 + cx%, 296 + cy%)-(130 + cx%, 305 + cy%), 1, BF
LINE (97 + cx%, 303 + cy%)-(121 + cx%, 305 + cy%), 1, BF
LINE (97 + cx%, 306 + cy%)-(121 + cx%, 318 + cy%), 1, BF
LINE (97 + cx%, 306 + cy%)-(106 + cx%, 309 + cy%), 1, BF
LINE (110 + cx%, 306 + cy%)-(113 + cx%, 309 + cy%), 1, BF
LINE (118 + cx%, 306 + cy%)-(130 + cx%, 312 + cy%), 1, BF
LINE (94 + cx%, 309 + cy%)-(97 + cx%, 318 + cy%), 1, BF
LINE (98 + cx%, 315 + cy%)-(101 + cx%, 318 + cy%), 1, BF
LINE (102 + cx%, 306 + cy%)-(105 + cx%, 315 + cy%), 1, BF
LINE (105 + cx%, 312 + cy%)-(108 + cx%, 315 + cy%), 1, BF
LINE (116 + cx%, 313 + cy%)-(122 + cx%, 315 + cy%), 1, BF
LINE (123 + cx%, 312 + cy%)-(126 + cx%, 315 + cy%), 1, BF
LINE (115 + cx%, 309 + cy%)-(123 + cx%, 312 + cy%), 1, BF
LINE (120 + cx%, 315 + cy%)-(126 + cx%, 318 + cy%), 1, BF

LINE (81 + cx%, 324 + cy%)-(93 + cx%, 330 + cy%), 1, BF

LINE (87 + cx%, 318 + cy%)-(123 + cx%, 327 + cy%), 1, BF

LINE (114 + cx%, 318 + cy%)-(117 + cx%, 321 + cy%), 1, BF
LINE (102 + cx%, 318 + cy%)-(105 + cx%, 321 + cy%), 1, BF
LINE (105 + cx%, 321 + cy%)-(108 + cx%, 324 + cy%), 1, BF
LINE (117 + cx%, 321 + cy%)-(123 + cx%, 324 + cy%), 1, BF

LINE (105 + cx%, 324 + cy%)-(123 + cx%, 336 + cy%), 1, BF

LINE (117 + cx%, 327 + cy%)-(120 + cx%, 330 + cy%), 1, BF
LINE (109 + cx%, 327 + cy%)-(112 + cx%, 330 + cy%), 1, BF
LINE (123 + cx%, 327 + cy%)-(132 + cx%, 336 + cy%), 1, BF
LINE (126 + cx%, 321 + cy%)-(132 + cx%, 336 + cy%), 1, BF

LINE (84 + cx%, 321 + cy%)-(87 + cx%, 324 + cy%), 1, BF
LINE (84 + cx%, 330 + cy%)-(90 + cx%, 333 + cy%), 1, BF

LINE (93 + cx%, 327 + cy%)-(108 + cx%, 342 + cy%), 1, BF
LINE (99 + cx%, 327 + cy%)-(102 + cx%, 330 + cy%), 1, BF
LINE (93 + cx%, 333 + cy%)-(96 + cx%, 336 + cy%), 1, BF
LINE (90 + cx%, 330 + cy%)-(93 + cx%, 339 + cy%), 1, BF
LINE (87 + cx%, 333 + cy%)-(90 + cx%, 342 + cy%), 1, BF
LINE (84 + cx%, 336 + cy%)-(87 + cx%, 342 + cy%), 1, BF
LINE (108 + cx%, 336 + cy%)-(117 + cx%, 339 + cy%), 1, BF


END SUB

SUB erasecharacter2 (c2x%, c2y%, c2c%)

CIRCLE (290 + c2x%, 350 + c2y%), 15, 1' kirby
CIRCLE (350 + c2x%, 350 + c2y%), 15, 1
CIRCLE (350 + c2x%, 350 + c2y%), 15, 1
CIRCLE (290 + c2x%, 350 + c2y%), 15, 1
PAINT (290 + c2x%, 350 + c2y%), 1, 1
PAINT (350 + c2x%, 350 + c2y%), 1, 1
CIRCLE (320 + c2x%, 380 + c2y%), 40, 1
PAINT (320 + c2x%, 380 + c2y%), 1, 1
CIRCLE (310 + c2x%, 370 + c2y%), 1
CIRCLE (330 + c2x%, 370 + c2y%), 1
PAINT (310 + c2x%, 370 + c2y%), 1, 1
PAINT (330 + c2x%, 370 + c2y%), 1, 1
CIRCLE (310 + c2x%, 370 + c2y%), 2, 1
CIRCLE (330 + c2x%, 370 + c2y%), 2, 1
PAINT (310 + c2x%, 370 + c2y%), 1, 1
PAINT (330 + c2x%, 370 + c2y%), 1, 1
CIRCLE (320 + c2x%, 380 + c2y%), 40, 1
CIRCLE (320 + c2x%, 390 + c2y%), 6, 1
PAINT (320 + c2x%, 390 + c2y%), 1, 1
END SUB

SUB ERASEFIREBALL (fx%, fy%, fc%)

CIRCLE (520 + fx%, 270 + fy%), 5, 1
PAINT (520 + fx%, 270 + fy%), 1


END SUB

   SUB ERASEFIREBALL2 (fire2x%, fire2y%, fire2c%)

CIRCLE (520 + fire2x%, 270 + fire2y%), 5, 1
PAINT (520 + fire2x%, 270 + fire2y%), 1


END SUB

   SUB ERASEFIREBALL3 (fire3x%, fire3y%, fire3c%)

CIRCLE (520 + fire3x%, 270 + fire3y%), 5, 1
PAINT (520 + fire3x%, 270 + fire3y%), 1

END SUB

SUB ERASEFIREBALL4 (fire4x%, fire4y%, fire4c%)

CIRCLE (520 + fire4x%, 270 + fire4y%), 5, 1
PAINT (520 + fire4x%, 270 + fire4y%), 1

END SUB

SUB ERASEFIREBALL5 (fire5x%, fire5y%, fire5c%)

CIRCLE (520 + fire5x%, 270 + fire5y%), 5, 1
PAINT (520 + fire5x%, 270 + fire5y%), 1

END SUB

SUB ERASEFIREBALL6 (fire6x%, fire6y%, fire6c%)

CIRCLE (520 + fire6x%, 270 + fire6y%), 5, 1
PAINT (520 + fire6x%, 270 + fire6y%), 1

END SUB

SUB ERASEFIREBALL7 (fire7x%, fire7y%, fire7c%)

CIRCLE (520 + fire7x%, 270 + fire7y%), 5, 1
PAINT (520 + fire7x%, 270 + fire7y%), 1

END SUB

SUB erasered (redx%, redy%, redc%)

CIRCLE (520 + redx%, 270 + redy%), 5, 1
PAINT (520 + redx%, 270 + redy%), 1, 1

END SUB

SUB ESIDEFIRE1 (s1x%, s1y%, s1c%)

CIRCLE (520 + s1x%, 270 + s1y%), 5, 1
PAINT (520 + s1x%, 270 + s1y%), 1, 1

END SUB

SUB ESIDEFIRE2 (s2x%, s2y%, s2c%)

CIRCLE (520 + s2x%, 270 + s2y%), 5, 1
PAINT (520 + s2x%, 270 + s2y%), 1, 1

END SUB

SUB ESIDEFIRE3 (s3x%, s3y%, s3c%)

CIRCLE (520 + s3x%, 270 + s3y%), 5, 1
PAINT (520 + s3x%, 270 + s3y%), 1, 1

END SUB

SUB ESIDEFIRE4 (s4x%, s4y%, s4c%)

CIRCLE (520 + s4x%, 270 + s4y%), 5, 1
PAINT (520 + s4x%, 270 + s4y%), 1, 1

END SUB

SUB FINAL (finx%, finy%, finc%)

FOR i% = 1 TO 1
LOCATE 10, 20
PRINT "Well, it seems you are both worthy of surviving..."
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 4
NEXT i%

CLS

FOR i% = 1 TO 1
LOCATE 10, 20
PRINT "But we all know there can only be one survivor here..."
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 4
NEXT i%

CLS

FOR i% = 1 TO 1
LOCATE 10, 20
PRINT "Player 1, put your finger on the (x) key.  Player 2 on the (m) key. "
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 6
NEXT i%

CLS

FOR i% = 1 TO 1
LOCATE 10, 20
PRINT "When the screen changes color... The first one to hit their button wins!"; ""
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 3
NEXT i%

CLS

END SUB

SUB FINAL2 (f2x%, f2y%, f2c%)

CLS
PAINT (1, 1), 4, 4

DO
   Key$ = INKEY$

      IF Key$ = "x" THEN
         PAINT (1, 1), 14, 14
         cx% = cx% + 150
         CALL CHARACTER1(cx%, cy%, cc%)
         LOCATE 10, 30
         PRINT "PLAYER 1 WINS!"
         CALL PAUSE(5)
         INPUT "Would you like to play again? (y/n)"; answer$
         IF answer$ = "n" THEN
            END
         ELSEIF answer$ = "y" THEN
            CLS
            CALL REPLAY(repx%, repy%, repc%)
         END IF

      ELSEIF Key$ = "m" THEN
         PAINT (1, 1), 14, 14
         c2x% = c2x% - 30
         CALL CHARACTER2(c2x%, c2y%, c2c%)
         LOCATE 10, 30
         PRINT "PLAYER 2 WINS!"
         CALL PAUSE(5)
         INPUT "Would you like to play again? (y/n)"; answer$
         IF answer$ = "n" THEN
            END
         ELSEIF answer$ = "y" THEN
            CLS
            CALL REPLAY(repx%, repy%, repc%)
         END IF

      END IF

LOOP UNTIL Key$ = "x" OR Key$ = "m"

END SUB

   SUB FIREBALL (fx%, fy%, fc%)

CIRCLE (520 + fx%, 270 + fy%), 5, 14
PAINT (520 + fx%, 270 + fy%), 14, 14

END SUB

   SUB FIREBALL2 (fire2x%, fire2y%, fire2c%)

CIRCLE (520 + fire2x%, 270 + fire2y%), 5, 14
PAINT (520 + fire2x%, 270 + fire2y%), 14, 14

END SUB

   SUB FIREBALL3 (fire3x%, fire3y%, fire3c%)

CIRCLE (520 + fire3x%, 270 + fire3y%), 5, 14
PAINT (520 + fire3x%, 270 + fire3y%), 14, 14

END SUB

SUB FIREBALL4 (fire4x%, fire4y%, fire4c%)

CIRCLE (520 + fire4x%, 270 + fire4y%), 5, 14
PAINT (520 + fire4x%, 270 + fire4y%), 14, 14

END SUB

SUB FIREBALL5 (fire5x%, fire5y%, fire5c%)

CIRCLE (520 + fire5x%, 270 + fire5y%), 5, 14
PAINT (520 + fire5x%, 270 + fire5y%), 14, 14

END SUB

SUB FIREBALL6 (fire6x%, fire6y%, fire6c%)

CIRCLE (520 + fire6x%, 270 + fire6y%), 5, 14
PAINT (520 + fire6x%, 270 + fire6y%), 14, 14

END SUB

SUB FIREBALL7 (fire7x%, fire7y%, fire7c%)

CIRCLE (520 + fire7x%, 270 + fire7y%), 5, 14
PAINT (520 + fire7x%, 270 + fire7y%), 14, 14

END SUB

SUB FLOWER1 (f1x%, f1y%, f1c%)

   LINE (500, 398)-(540, 398), 2  'pipe
   LINE (500, 398)-(500, 340), 2
   LINE (540, 340)-(540, 398), 2
   LINE (500, 340)-(540, 340), 2
   PAINT (501, 341), 2, 2
   LINE (490, 330)-(550, 340), 2, BF

   LINE (518, 340)-(522, 300), 2, BF  'flower
   LINE (518, 329)-(522, 329), 0
   CIRCLE (520, 280), 20, 4
   PAINT (520, 280), 4, 4
   LINE (500, 260)-(520, 285), 1
   LINE (540, 260)-(520, 285), 1
   PAINT (520, 268), 1, 1
   LINE (520, 277)-(530, 265)
   LINE (520, 277)-(510, 265)
   LINE (530, 265)-(535, 267)
   LINE (510, 265)-(505, 267)
   LINE (520, 285)-(505, 267)
   LINE (520, 285)-(535, 267)
   PAINT (520, 280)

END SUB

   SUB FLOWER2 (f2x%, f2y%, f2c%)

   LINE (500, 398)-(540, 398), 2  'pipe
   LINE (500, 398)-(500, 340), 2
   LINE (540, 340)-(540, 398), 2
   LINE (500, 340)-(540, 340), 2
   PAINT (501, 341), 2, 2
   LINE (490, 330)-(550, 340), 2, BF

   LINE (518, 340)-(522, 300), 2, BF  'flower
   LINE (518, 329)-(522, 329), 0
   CIRCLE (520, 280), 20, 4
   PAINT (520, 280), 4, 4

END SUB

SUB KIRBY (kx%, ky%, kc%)

CIRCLE (290, 350), 15, 13 ' kirby
CIRCLE (350, 350), 15, 13
CIRCLE (350, 350), 15, 0
CIRCLE (290, 350), 15, 0
PAINT (290, 350), 13, 0
PAINT (350, 350), 13, 0
CIRCLE (320, 380), 40, 13
PAINT (320, 380), 13, 13
CIRCLE (310, 370), 8
CIRCLE (330, 370), 8
PAINT (310, 370)
PAINT (330, 370)
CIRCLE (310 + x5%, 370), 2, 0
CIRCLE (330 + x5%, 370), 2, 0
PAINT (310 + x5%, 370), 0, 0
PAINT (330 + x5%, 370), 0, 0
CIRCLE (320, 380), 40, 0
CIRCLE (320 + x6%, 390), 6, 0
PAINT (320 + x6%, 390), 0, 0

FOR i5% = 1 TO 5                   ' kirby eye move
CIRCLE (310 + x5%, 370), 2, 0
CIRCLE (330 + x5%, 370), 2, 0
PAINT (310 + x5%, 370), 0, 0
PAINT (330 + x5%, 370), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
CIRCLE (310 + x5%, 370), 2
CIRCLE (330 + x5%, 370), 2
PAINT (310 + x5%, 370)
PAINT (330 + x5%, 370)
x5% = x5% - 1
NEXT i5%

CIRCLE (310 + x5%, 370), 2, 0          '    kirby new eye position
CIRCLE (330 + x5%, 370), 2, 0
PAINT (310 + x5%, 370), 0, 0
PAINT (330 + x5%, 370), 0, 0

FOR i6% = 1 TO 5                        '   kirby mouth position 2
CIRCLE (320 + x6%, 390), 6, 0
PAINT (320 + x6%, 390), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
LINE (305, 382)-(345, 398), 13, BF
x6% = x6% + 1
NEXT i6%

FOR i7% = 1 TO 20                        '   kirbys mouth postion 3
CIRCLE (320 + x6%, 390), 6, 0
PAINT (320 + x6%, 390), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
LINE (305, 382)-(345, 398), 13, BF
x6% = x6% - 1
NEXT i7%

FOR i8% = 1 TO 2                          '     kirby open mouth
CIRCLE (320 + x6%, 390), 6, 0
PAINT (320 + x6%, 390), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
CIRCLE (320 + x6%, 390), 7, 4
PAINT (320 + x6%, 390), 0, 4
NEXT i8%

FOR i9% = 1 TO 2
CIRCLE (320 + x6%, 390), 7, 0
PAINT (320 + x6%, 390), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
CIRCLE (320 + x6%, 390), 8, 4
PAINT (320 + x6%, 390), 0, 4
NEXT i9%

FOR i10% = 1 TO 2
CIRCLE (320 + x6%, 390), 8, 0
PAINT (320 + x6%, 390), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
CIRCLE (320 + x6%, 390), 9, 4
PAINT (320 + x6%, 390), 0, 4
NEXT i10%

FOR i11% = 1 TO 2
CIRCLE (320 + x6%, 390), 9, 0
PAINT (320 + x6%, 390), 0, 0
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > .05
CIRCLE (320 + x6%, 390), 10, 4
PAINT (320 + x6%, 390), 0, 4
NEXT i11%

CIRCLE (320 + x6%, 390), 10, 4
PAINT (320 + x6%, 390), 5, 4

END SUB

SUB LEVEL1 (l1x%, l1y%, l1c%)

lives% = 3
cy% = cy% + 37
CLS

REM ************ ROUND 1 PLAYER 1
FOR i6% = 1 TO 1
LOCATE 10, 30
   PRINT "Round 1.  Player 1.  GO!"
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 2
NEXT i6%

CLS
RANDOMIZE TIMER
CALL BACKGROUND(bx%, by%, bc%)
timestart! = TIMER
fire3x% = -200
fire2x% = -100
counter! = TIMER
DO
LOCATE 1, 1
PRINT "Lives:"; lives%
   timegone% = TIMER - timestart!
   Key$ = INKEY$
   IF timegone% = 2 * (timegone% \ 2) THEN
      CALL FLOWER1(f1x%, f1y%, f1c%)
   ELSE
   CALL FLOWER2(f2x%, f2y%, f2c%)
   END IF

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL FIREBALL(fx%, fy%, fc%)
   CALL FIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL FIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL CLOUD(x%, y%, c%)
   CALL PAUSE(.05)
   CALL ERASEFIREBALL(fx%, fy%, fc%)
   CALL erasecharacter1(cx%, cy%, cc%)
   CALL ERASEFIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL ERASEFIREBALL3(fire3x%, fire3y%, fire3c%)

   IF fy% < -400 THEN
      fy% = 0
   ELSE fy% = fy% - 10
   END IF


   fire2y% = fire2y% + 10
      IF fire2y% > 100 THEN
         RANDOMIZE TIMER
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
      ELSE fire2y% = fire2y% + 0
      END IF

   fire3y% = fire3y% + 10
      IF fire3y% > 100 THEN
         RANDOMIZE TIMER
            fire3y% = -400
            fire3x% = INT(RND * 200) - 500
      ELSE fire3y% = fire3y% + 0
      END IF


   IF Key$ = "4" THEN
      IF cx% < -65 THEN
         cx% = cx% - 0
      ELSE cx% = cx% - 10
      END IF
   ELSEIF Key$ = "6" THEN
      IF cx% > 350 THEN
         cx% = cx% + 0
      ELSE cx% = cx% + 10
      END IF
   ELSEIF Key$ = "q" THEN
      END

   END IF

'FOR IGNORE% = 1 TO -1
d2% = SQR((520 + fire2x% - 112 - cx%) ^ 2 + (270 + fire2y% - 307 - cy%) ^ 2)
d3% = SQR((520 + fire3x% - 112 - cx%) ^ 2 + (270 + fire3y% - 307 - cy%) ^ 2)

IF d2% < 20 THEN
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "n") OR (answer$ = "y")

            END IF
END IF

IF d3% < 20 THEN
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR (answer$ = "n")
            END IF
END IF
continue! = TIMER
continue! = continue! - counter!
LOOP UNTIL continue! > 15

CLS

END SUB

SUB LEVEL1p2 (l1p2x%, l1p2y%, l1p2c%)

lives% = 3
c2y% = c2y% - 40
CLS

REM ************ ROUND 1 PLAYER 1
FOR i6% = 1 TO 1
LOCATE 10, 30
   PRINT "Round 1.  Player 2.  GO!"
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 2
NEXT i6%

CLS
RANDOMIZE TIMER
CALL BACKGROUND(bx%, by%, bc%)
timestart! = TIMER
fire3x% = -300
fire2x% = -300
counter! = TIMER
DO
LOCATE 1, 1
PRINT "Lives:"; lives%
   timegone% = TIMER - timestart!
   Key$ = INKEY$
   IF timegone% = 2 * (timegone% \ 2) THEN
      CALL FLOWER1(f1x%, f1y%, f1c%)
   ELSE
   CALL FLOWER2(f2x%, f2y%, f2c%)
   END IF

   CALL CHARACTER2(c2x%, c2y%, c2c%)
   CALL FIREBALL(fx%, fy%, fc%)
   CALL FIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL FIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL CLOUD(x%, y%, c%)
   CALL PAUSE(.05)
   CALL ERASEFIREBALL(fx%, fy%, fc%)
   CALL erasecharacter2(c2x%, c2y%, c2c%)
   CALL ERASEFIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL ERASEFIREBALL3(fire3x%, fire3y%, fire3c%)

   IF fy% < -400 THEN
      fy% = 0
   ELSE fy% = fy% - 10
   END IF
  

   fire2y% = fire2y% + 10
      IF fire2y% > 40 THEN
         RANDOMIZE TIMER
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
      ELSE fire2y% = fire2y% + 0
      END IF
 
   fire3y% = fire3y% + 10
      IF fire3y% > 40 THEN
         RANDOMIZE TIMER
            fire3y% = -400
            fire3x% = INT(RND * 200) - 500
      ELSE fire3y% = fire3y% + 0
      END IF


   IF Key$ = "4" THEN
      IF c2x% < -300 THEN
         c2x% = c2x% - 0
     ELSE c2x% = c2x% - 10
      END IF

   ELSEIF Key$ = "6" THEN
      IF c2x% > 100 THEN
         c2x% = c2x% + 0
      ELSE c2x% = c2x% + 10
      END IF
   ELSEIF Key$ = "q" THEN
      END

   END IF


d2% = SQR((520 + fire2x% - 320 - c2x%) ^ 2 + (270 + fire2y% - 370 - c2y%) ^ 2)
d3% = SQR((520 + fire3x% - 320 - c2x%) ^ 2 + (270 + fire3y% - 370 - c2y%) ^ 2)
IF d2% < 40 THEN
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR (answer$ = "n")
            END IF
END IF

IF d3% < 40 THEN
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR (answer$ = "n")
            END IF
END IF
continue! = TIMER
continue! = continue! - counter!
LOOP UNTIL continue! > 15

CLS

END SUB

SUB LEVEL2 (l2x%, l2y%, l2c%)
FOR i% = 1 TO 1
LOCATE 10, 20
PRINT "Welcome to level 2.  Survive for 30s."
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 3
NEXT i%

CLS
lives% = 3
cy% = cy% + 37
PAINT (1, 1), 1

RANDOMIZE TIMER
timestart! = TIMER
fire3x% = -200
fire2x% = -100
b2firex% = -400
b3firex% = -50
s1y% = -300
s2y% = -200
s3y% = -100
s4y% = 0
counter! = TIMER
DO
   Key$ = INKEY$
   LOCATE 1, 1
   PRINT "Lives:"; lives%

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL FIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL FIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL BOTFIRE2(b2firex%, b2firey%, b2firec%)
   CALL BOTFIRE3(b3firex%, b3firey%, b3firec%)
   CALL SIDEFIRE1(s1x%, s1y%, s1c%)
   CALL SIDEFIRE2(s2x%, s2y%, s2c%)
   CALL SIDEFIRE3(s3x%, s3y%, s3c%)
   CALL SIDEFIRE4(s4x%, s4y%, s4c%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)
   CALL ERASEFIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL ERASEFIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL ERASEBOTFIRE2(b2firex%, b2firey%, b2firec%)
   CALL ERASEBOTFIRE3(b3firex%, b3firey%, b3firec%)
   CALL ESIDEFIRE1(s1x%, s1y%, s1c%)
   CALL ESIDEFIRE2(s2x%, s2y%, s2c%)
   CALL ESIDEFIRE3(s3x%, s3y%, s3c%)
   CALL ESIDEFIRE4(s4x%, s4y%, s4c%)
 
  fire2y% = fire2y% + 10
      IF fire2y% > 220 THEN
         RANDOMIZE TIMER
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
      ELSE fire2y% = fire2y% + 0
      END IF

   fire3y% = fire3y% + 10
      IF fire3y% > 220 THEN
         RANDOMIZE TIMER
            fire3y% = -400
            fire3x% = INT(RND * 200) - 500
      ELSE fire3y% = fire3y% + 0
      END IF

   b2firey% = b2firey% - 10
      IF b2firey% < -400 THEN
         RANDOMIZE TIMER
            b2firey% = 220
            b2firex% = INT(RND * 360) - 400
      ELSE b2firey% = b2firey% + 0
      END IF

   b3firey% = b2firey% - 10
      IF b3firey% < -400 THEN
         RANDOMIZE TIMER
            b3firey% = 220
            b3firex% = INT(RND * 360) - 400
      ELSE b3firey% = b3firey% + 0
      END IF

REM ********* SIDE FIRE

  s1x% = s1x% + 10
      IF s1x% > 100 THEN
         RANDOMIZE TIMER
            s1x% = -500
            s1y% = INT(RND * 380) - 200
      ELSE s1x% = s1x% + 0
      END IF

  s2x% = s2x% + 10
      IF s2x% > 100 THEN
         RANDOMIZE TIMER
            s2x% = -500
            s2y% = INT(RND * 380) - 200
      ELSE s2x% = s2x% + 0
      END IF

  s3x% = s3x% + 10
      IF s3x% > 100 THEN
         RANDOMIZE TIMER
            s3x% = -500
            s3y% = INT(RND * 380) - 200
      ELSE s3x% = s3x% + 0
      END IF

  s4x% = s4x% + 10
      IF s4x% > 100 THEN
         RANDOMIZE TIMER
            s4x% = -500
            s4y% = INT(RND * 280) - 200
      ELSE s4x% = s4x% + 0
      END IF


   IF Key$ = "4" THEN
      IF cx% < -75 THEN
         cx% = cx% - 0
     ELSE cx% = cx% - 10
      END IF
 
   ELSEIF Key$ = "6" THEN
      IF cx% > 500 THEN
         cx% = cx% + 0
      ELSE cx% = cx% + 10
      END IF
   ELSEIF Key$ = "8" THEN
      IF cy% < -280 THEN
         cy% = cy% + 0
      ELSE cy% = cy% - 10
      END IF
   ELSEIF Key$ = "5" THEN
      IF cy% > 125 THEN
         cy% = cy% + 0
      ELSE cy% = cy% + 10
      END IF
   ELSEIF Key$ = "q" THEN
      END
   END IF

d2% = SQR((520 + fire2x% - 112 - cx%) ^ 2 + (270 + fire2y% - 307 - cy%) ^ 2)
d3% = SQR((520 + fire3x% - 112 - cx%) ^ 2 + (270 + fire3y% - 307 - cy%) ^ 2)
bd2% = SQR((520 + b2firex% - 112 - cx%) ^ 2 + (270 + b2firey% - 307 - cy%) ^ 2)
bd3% = SQR((520 + b3firex% - 112 - cx%) ^ 2 + (270 + b3firey% - 307 - cy%) ^ 2)
sd1% = SQR((520 + s1x% - 112 - cx%) ^ 2 + (270 + s1y% - 307 - cy%) ^ 2)
sd2% = SQR((520 + s2x% - 112 - cx%) ^ 2 + (270 + s2y% - 307 - cy%) ^ 2)
sd3% = SQR((520 + s3x% - 112 - cx%) ^ 2 + (270 + s3y% - 307 - cy%) ^ 2)
sd4% = SQR((520 + s4x% - 112 - cx%) ^ 2 + (270 + s4y% - 307 - cy%) ^ 2)

IF d2% < 20 THEN
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y") OR (answer$ = "n")
            END IF
END IF

IF d3% < 20 THEN
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y") OR (answer$ = "n")
            END IF
END IF

IF bd2% < 20 THEN
            b2firey% = 220
            b2firex% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR answer$ = "n")
            END IF
END IF

IF bd3% < 20 THEN
            b3firey% = 220
            b3firex% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR answer$ = "n")

            END IF
END IF

IF sd1% < 30 THEN
            s1x% = -500
            s1y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR answer$ = "n")
            END IF
END IF

IF sd2% < 30 THEN
            s2x% = -500
            s2y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR (answer$ = "n")
            END IF
END IF

IF sd3% < 30 THEN
            s3x% = -500
            s3y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR (answer$ = "n")
            END IF
END IF

IF sd4% < 30 THEN
            s4x% = -500
            s4y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               DO
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF
               LOOP UNTIL (answer$ = "y" OR (answer$ = "n")
            END IF
END IF

continue! = TIMER
continue! = continue! - counter!
LOOP UNTIL continue! > 30

CLS

END SUB

SUB LEVEL2p2 (l2p2x%, l2p2y%, l2p2c%)

FOR i% = 1 TO 1
   LOCATE 10, 20
   PRINT "Welcome to level 2 player 2.  Survive for 30s."
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3
   NEXT i%

CLS
lives% = 3
c2y% = c2y% + 37
c2x% = c2x% - 30
PAINT (1, 1), 1

RANDOMIZE TIMER
timestart! = TIMER
fire3x% = -200
fire2x% = -100
b2firex% = -400
b3firex% = -50
s1y% = -300
s2y% = -200
s3y% = -100
s4y% = 0
counter! = TIMER
DO
   Key$ = INKEY$
   LOCATE 1, 1
   PRINT "Lives:"; lives%

   CALL CHARACTER2(c2x%, c2y%, c2c%)
   CALL FIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL FIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL BOTFIRE2(b2firex%, b2firey%, b2firec%)
   CALL BOTFIRE3(b3firex%, b3firey%, b3firec%)
   CALL SIDEFIRE1(s1x%, s1y%, s1c%)
   CALL SIDEFIRE2(s2x%, s2y%, s2c%)
   CALL SIDEFIRE3(s3x%, s3y%, s3c%)
   CALL SIDEFIRE4(s4x%, s4y%, s4c%)
   CALL PAUSE(.05)
   CALL erasecharacter2(c2x%, c2y%, c2c%)
   CALL ERASEFIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL ERASEFIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL ERASEBOTFIRE2(b2firex%, b2firey%, b2firec%)
   CALL ERASEBOTFIRE3(b3firex%, b3firey%, b3firec%)
   CALL ESIDEFIRE1(s1x%, s1y%, s1c%)
   CALL ESIDEFIRE2(s2x%, s2y%, s2c%)
   CALL ESIDEFIRE3(s3x%, s3y%, s3c%)
   CALL ESIDEFIRE4(s4x%, s4y%, s4c%)
 
  fire2y% = fire2y% + 10
      IF fire2y% > 220 THEN
         RANDOMIZE TIMER
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
      ELSE fire2y% = fire2y% + 0
      END IF

   fire3y% = fire3y% + 10
      IF fire3y% > 220 THEN
         RANDOMIZE TIMER
            fire3y% = -400
            fire3x% = INT(RND * 200) - 500
      ELSE fire3y% = fire3y% + 0
      END IF

   b2firey% = b2firey% - 10
      IF b2firey% < -400 THEN
         RANDOMIZE TIMER
            b2firey% = 220
            b2firex% = INT(RND * 360) - 400
      ELSE b2firey% = b2firey% + 0
      END IF

   b3firey% = b2firey% - 10
      IF b3firey% < -400 THEN
         RANDOMIZE TIMER
            b3firey% = 220
            b3firex% = INT(RND * 360) - 400
      ELSE b3firey% = b3firey% + 0
      END IF

REM ********* SIDE FIRE

  s1x% = s1x% + 10
      IF s1x% > 100 THEN
         RANDOMIZE TIMER
            s1x% = -500
            s1y% = INT(RND * 380) - 200
      ELSE s1x% = s1x% + 0
      END IF

  s2x% = s2x% + 10
      IF s2x% > 100 THEN
         RANDOMIZE TIMER
            s2x% = -500
            s2y% = INT(RND * 380) - 200
      ELSE s2x% = s2x% + 0
      END IF

  s3x% = s3x% + 10
      IF s3x% > 100 THEN
         RANDOMIZE TIMER
            s3x% = -500
            s3y% = INT(RND * 380) - 200
      ELSE s3x% = s3x% + 0
      END IF

  s4x% = s4x% + 10
      IF s4x% > 100 THEN
         RANDOMIZE TIMER
            s4x% = -500
            s4y% = INT(RND * 280) - 200
      ELSE s4x% = s4x% + 0
      END IF


   IF Key$ = "4" THEN
      IF c2x% < -300 THEN
         c2x% = c2x% - 0
      ELSE c2x% = c2x% - 10
      END IF
   ELSEIF Key$ = "6" THEN
      IF c2x% > 300 THEN
         c2x% = c2x% + 0
      ELSE c2x% = c2x% + 10
      END IF
   ELSEIF Key$ = "8" THEN
      IF c2y% < -340 THEN
         c2y% = c2y% + 0
      ELSE c2y% = c2y% - 10
      END IF
   ELSEIF Key$ = "5" THEN
      IF c2y% > 60 THEN
         c2y% = c2y% + 0
      ELSE c2y% = c2y% + 10
      END IF
   ELSEIF Key$ = "q" THEN
      END
   END IF

d2% = SQR((520 + fire2x% - 320 - c2x%) ^ 2 + (270 + fire2y% - 370 - c2y%) ^ 2)
d3% = SQR((520 + fire3x% - 320 - c2x%) ^ 2 + (270 + fire3y% - 370 - c2y%) ^ 2)
bd2% = SQR((520 + b2firex% - 320 - c2x%) ^ 2 + (270 + b2firey% - 370 - c2y%) ^ 2)
bd3% = SQR((520 + b3firex% - 320 - c2x%) ^ 2 + (270 + b3firey% - 370 - c2y%) ^ 2)
sd1% = SQR((520 + s1x% - 320 - c2x%) ^ 2 + (270 + s1y% - 370 - c2y%) ^ 2)
sd2% = SQR((520 + s2x% - 320 - c2x%) ^ 2 + (270 + s2y% - 370 - c2y%) ^ 2)
sd3% = SQR((520 + s3x% - 320 - c2x%) ^ 2 + (270 + s3y% - 370 - c2y%) ^ 2)
sd4% = SQR((520 + s4x% - 320 - c2x%) ^ 2 + (270 + s4y% - 370 - c2y%) ^ 2)

IF d2% < 30 THEN
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d3% < 30 THEN
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF bd2% < 30 THEN
            b2firey% = 220
            b2firex% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF bd3% < 30 THEN
            b3firey% = 220
            b3firex% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF sd1% < 30 THEN
            s1x% = -500
            s1y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF sd2% < 30 THEN
            s2x% = -500
            s2y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF sd3% < 30 THEN
            s3x% = -500
            s3y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF sd4% < 30 THEN
            s4x% = -500
            s4y% = INT(RND * 380) - 200
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

continue! = TIMER
continue! = continue! - counter!
LOOP UNTIL continue! > 30

CLS


END SUB

SUB LEVEL3 (l3x%, l3y%, l3c%)

lives% = 7
cy% = cy% + 37
CLS

REM ************ ROUND 1 PLAYER 1
FOR i6% = 1 TO 1
LOCATE 10, 23
   PRINT "Round 3.  Player 1.  Catch the red balls!"
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 2
NEXT i6%

CLS
RANDOMIZE TIMER
CALL BACKGROUND(bx%, by%, bc%)
timestart! = TIMER
fire3x% = -300
fire2x% = -300
fire4x% = -300
fire5x% = -300
fire6x% = -300
fire7x% = -300
redx% = -400

counter! = TIMER
DO
LOCATE 1, 1
PRINT "Lives:"; lives%
   timegone% = TIMER - timestart!
   Key$ = INKEY$
   IF timegone% = 2 * (timegone% \ 2) THEN
      CALL FLOWER1(f1x%, f1y%, f1c%)
   ELSE
   CALL FLOWER2(f2x%, f2y%, f2c%)
   END IF

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL FIREBALL(fx%, fy%, fc%)
   CALL FIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL FIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL FIREBALL4(fire4x%, fire4y%, fire4c%)
   CALL FIREBALL5(fire5x%, fire5y%, fire5c%)
   CALL FIREBALL6(fire6x%, fire6y%, fire6c%)
   CALL FIREBALL7(fire7x%, fire7y%, fire7c%)
   CALL red(redx%, redy%, redc%)
   CALL CLOUD(x%, y%, c%)
   CALL PAUSE(.05)
   CALL ERASEFIREBALL(fx%, fy%, fc%)
   CALL erasecharacter1(cx%, cy%, cc%)
   CALL ERASEFIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL ERASEFIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL ERASEFIREBALL4(fire4x%, fire4y%, fire4c%)
   CALL ERASEFIREBALL5(fire5x%, fire5y%, fire5c%)
   CALL ERASEFIREBALL6(fire6x%, fire6y%, fire6c%)
   CALL ERASEFIREBALL7(fire7x%, fire7y%, fire7c%)
   CALL erasered(redx%, redy%, redc%)

   IF fy% < -400 THEN
      fy% = 0
   ELSE fy% = fy% - 10
   END IF


   fire2y% = fire2y% + 10
      IF fire2y% > 100 THEN
         RANDOMIZE TIMER
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
      ELSE fire2y% = fire2y% + 0
      END IF

   fire3y% = fire3y% + 10
      IF fire3y% > 100 THEN
         RANDOMIZE TIMER
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
      ELSE fire3y% = fire3y% + 0
      END IF

   fire4y% = fire4y% + 10
      IF fire4y% > 100 THEN
         RANDOMIZE TIMER
            fire4y% = -400
            fire4x% = INT(RND * 360) - 400
      ELSE fire4y% = fire4y% + 0
      END IF

   fire5y% = fire5y% + 10
      IF fire5y% > 100 THEN
         RANDOMIZE TIMER
            fire5y% = -400
            fire5x% = INT(RND * 360) - 400
      ELSE fire5y% = fire5y% + 0
      END IF

   fire6y% = fire6y% + 10
      IF fire6y% > 100 THEN
         RANDOMIZE TIMER
            fire6y% = -400
            fire6x% = INT(RND * 360) - 400
      ELSE fire6y% = fire6y% + 0
      END IF

   fire7y% = fire7y% + 10
      IF fire7y% > 100 THEN
         RANDOMIZE TIMER
            fire7y% = -400
            fire7x% = INT(RND * 360) - 400
      ELSE fire7y% = fire7y% + 0
      END IF

   redy% = redy% + 10
      IF redy% > 100 THEN
         RANDOMIZE TIMER
            redy% = -400
            redx% = INT(RND * 360) - 400
      ELSE redy% = redy% + 0
      END IF
 
   IF redy% = 100 THEN
      lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF
  

   IF Key$ = "4" THEN
      IF cx% < -65 THEN
         cx% = cx% - 0
      ELSE cx% = cx% - 10
      END IF
   ELSEIF Key$ = "6" THEN
      IF cx% > 350 THEN
         cx% = cx% + 0
      ELSE cx% = cx% + 10
      END IF
   ELSEIF Key$ = "q" THEN
      END

   END IF


d2% = SQR((520 + fire2x% - 112 - cx%) ^ 2 + (270 + fire2y% - 307 - cy%) ^ 2)
d3% = SQR((520 + fire3x% - 112 - cx%) ^ 2 + (270 + fire3y% - 307 - cy%) ^ 2)
d4% = SQR((520 + fire4x% - 112 - cx%) ^ 2 + (270 + fire4y% - 307 - cy%) ^ 2)
d5% = SQR((520 + fire5x% - 112 - cx%) ^ 2 + (270 + fire5y% - 307 - cy%) ^ 2)
d6% = SQR((520 + fire6x% - 112 - cx%) ^ 2 + (270 + fire6y% - 307 - cy%) ^ 2)
d7% = SQR((520 + fire7x% - 112 - cx%) ^ 2 + (270 + fire7y% - 307 - cy%) ^ 2)
dred% = SQR((520 + redx% - 112 - cx%) ^ 2 + (270 + redy% - 307 - cy%) ^ 2)

IF d2% < 20 THEN
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d3% < 20 THEN
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d4% < 20 THEN
            fire4y% = -400
            fire4x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d5% < 20 THEN
            fire5y% = -400
            fire5x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d6% < 20 THEN
            fire6y% = -400
            fire6x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d7% < 20 THEN
            fire7y% = -400
            fire7x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF dred% < 20 THEN
            redy% = -400
            redx% = INT(RND * 360) - 400
            lives% = lives% + 0
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 2 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

continue! = TIMER
continue! = continue! - counter!
LOOP UNTIL continue! > 60

CLS


END SUB

SUB LEVEL3p2 (l3p2x%, l3p2y%, l3p2c%)

lives% = 20
c2y% = c2y% - 40
CLS

REM ************ ROUND 1 PLAYER 1
FOR i6% = 1 TO 1
LOCATE 10, 23
   PRINT "Round 3.  Player 2.  Catch the red balls!"
LOCATE 15, 20
   PRINT "Being Kirby finally payed off.  You have 14 lives."
Start! = TIMER
DO
LOOP UNTIL (TIMER - Start!) > 2
NEXT i6%

CLS
RANDOMIZE TIMER
CALL BACKGROUND(bx%, by%, bc%)
timestart! = TIMER
fire3x% = -300
fire2x% = -300
fire4x% = -300
fire5x% = -300
fire6x% = -300
fire7x% = -300
redx% = -400

counter! = TIMER
DO
LOCATE 1, 1
PRINT "Lives:"; lives%
   timegone% = TIMER - timestart!
   Key$ = INKEY$
   IF timegone% = 2 * (timegone% \ 2) THEN
      CALL FLOWER1(f1x%, f1y%, f1c%)
   ELSE
   CALL FLOWER2(f2x%, f2y%, f2c%)
   END IF

   CALL CHARACTER2(c2x%, c2y%, c2c%)
   CALL FIREBALL(fx%, fy%, fc%)
   CALL FIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL FIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL FIREBALL4(fire4x%, fire4y%, fire4c%)
   CALL FIREBALL5(fire5x%, fire5y%, fire5c%)
   CALL FIREBALL6(fire6x%, fire6y%, fire6c%)
   CALL FIREBALL7(fire7x%, fire7y%, fire7c%)
   CALL red(redx%, redy%, redc%)
   CALL CLOUD(x%, y%, c%)
   CALL PAUSE(.05)
   CALL ERASEFIREBALL(fx%, fy%, fc%)
   CALL erasecharacter2(c2x%, c2y%, c2c%)
   CALL ERASEFIREBALL2(fire2x%, fire2y%, fire2c%)
   CALL ERASEFIREBALL3(fire3x%, fire3y%, fire3c%)
   CALL ERASEFIREBALL4(fire4x%, fire4y%, fire4c%)
   CALL ERASEFIREBALL5(fire5x%, fire5y%, fire5c%)
   CALL ERASEFIREBALL6(fire6x%, fire6y%, fire6c%)
   CALL ERASEFIREBALL7(fire7x%, fire7y%, fire7c%)
   CALL erasered(redx%, redy%, redc%)

   IF fy% < -400 THEN
      fy% = 0
   ELSE fy% = fy% - 10
   END IF


   fire2y% = fire2y% + 10
      IF fire2y% > 100 THEN
         RANDOMIZE TIMER
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
      ELSE fire2y% = fire2y% + 0
      END IF

   fire3y% = fire3y% + 10
      IF fire3y% > 100 THEN
         RANDOMIZE TIMER
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
      ELSE fire3y% = fire3y% + 0
      END IF

   fire4y% = fire4y% + 10
      IF fire4y% > 100 THEN
         RANDOMIZE TIMER
            fire4y% = -400
            fire4x% = INT(RND * 360) - 400
      ELSE fire4y% = fire4y% + 0
      END IF

   fire5y% = fire5y% + 10
      IF fire5y% > 100 THEN
         RANDOMIZE TIMER
            fire5y% = -400
            fire5x% = INT(RND * 360) - 400
      ELSE fire5y% = fire5y% + 0
      END IF

   fire6y% = fire6y% + 10
      IF fire6y% > 100 THEN
         RANDOMIZE TIMER
            fire6y% = -400
            fire6x% = INT(RND * 360) - 400
      ELSE fire6y% = fire6y% + 0
      END IF

   fire7y% = fire7y% + 10
      IF fire7y% > 100 THEN
         RANDOMIZE TIMER
            fire7y% = -400
            fire7x% = INT(RND * 360) - 400
      ELSE fire7y% = fire7y% + 0
      END IF

   redy% = redy% + 10
      IF redy% > 100 THEN
         RANDOMIZE TIMER
            redy% = -400
            redx% = INT(RND * 360) - 400
      ELSE redy% = redy% + 0
      END IF
 
   IF redy% = 100 THEN
      lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF
 
   IF Key$ = "4" THEN
      IF c2x% < -300 THEN
         c2x% = c2x% - 0
     ELSE c2x% = c2x% - 10
      END IF

   ELSEIF Key$ = "6" THEN
      IF c2x% > 100 THEN
         c2x% = c2x% + 0
      ELSE c2x% = c2x% + 10
      END IF
   ELSEIF Key$ = "q" THEN
      END

   END IF


d2% = SQR((520 + fire2x% - 320 - c2x%) ^ 2 + (270 + fire2y% - 370 - c2y%) ^ 2)
d3% = SQR((520 + fire3x% - 320 - c2x%) ^ 2 + (270 + fire3y% - 370 - c2y%) ^ 2)
d4% = SQR((520 + fire4x% - 320 - c2x%) ^ 2 + (270 + fire4y% - 370 - c2y%) ^ 2)
d5% = SQR((520 + fire5x% - 320 - c2x%) ^ 2 + (270 + fire5y% - 370 - c2y%) ^ 2)
d6% = SQR((520 + fire6x% - 320 - c2x%) ^ 2 + (270 + fire6y% - 370 - c2y%) ^ 2)
d7% = SQR((520 + fire7x% - 320 - c2x%) ^ 2 + (270 + fire7y% - 370 - c2y%) ^ 2)
dred% = SQR((520 + redx% - 320 - c2x%) ^ 2 + (270 + redy% - 370 - c2y%) ^ 2)

IF d2% < 20 THEN
            fire2y% = -400
            fire2x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d3% < 30 THEN
            fire3y% = -400
            fire3x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d4% < 30 THEN
            fire4y% = -400
            fire4x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d5% < 30 THEN
            fire5y% = -400
            fire5x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d6% < 30 THEN
            fire6y% = -400
            fire6x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF d7% < 30 THEN
            fire7y% = -400
            fire7x% = INT(RND * 360) - 400
            lives% = lives% - 1
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

IF dred% < 30 THEN
            redy% = -400
            redx% = INT(RND * 360) - 400
            lives% = lives% + 0
            IF lives% = 0 THEN
               CLS
               LOCATE 10, 30
               PRINT "You died. n00b.  Player 1 wins."
               INPUT "Would you like to play again? (y/n)"; answer$
               IF answer$ = "n" THEN
                  END
               ELSEIF answer$ = "y" THEN
                  CLS
                  CALL REPLAY(repx%, repy%, repc%)
               END IF

            END IF
END IF

continue! = TIMER
continue! = continue! - counter!
LOOP UNTIL continue! > 60

CLS

END SUB

SUB MOVINGFLOWER (mfx%, mfy%, mfc%)

DO
   Key$ = INKEY$
   LINE (500, 398)-(540, 398), 2  'pipe
   LINE (500, 398)-(500, 340), 2
   LINE (540, 340)-(540, 398), 2
   LINE (500, 340)-(540, 340), 2
   PAINT (501, 341), 2, 2
   LINE (490, 330)-(550, 340), 2, BF

   LINE (518, 340)-(522, 300), 2, BF  'flower
   LINE (518, 329)-(522, 329), 0
   CIRCLE (520, 280), 20, 4
   PAINT (520, 280), 4, 4
   LINE (500, 260)-(520, 285), 1
   LINE (540, 260)-(520, 285), 1
   PAINT (520, 268), 1, 1
   LINE (520, 277)-(530, 265)
   LINE (520, 277)-(510, 265)
   LINE (530, 265)-(535, 267)
   LINE (510, 265)-(505, 267)
   LINE (520, 285)-(505, 267)
   LINE (520, 285)-(535, 267)
   PAINT (520, 280)
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 1

   LINE (500, 398)-(540, 398), 2  'pipe
   LINE (500, 398)-(500, 340), 2
   LINE (540, 340)-(540, 398), 2
   LINE (500, 340)-(540, 340), 2
   PAINT (501, 341), 2, 2
   LINE (490, 330)-(550, 340), 2, BF

   LINE (518, 340)-(522, 300), 2, BF  'flower
   LINE (518, 329)-(522, 329), 0
   CIRCLE (520, 280), 20, 4
   PAINT (520, 280), 4, 4
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 1

LOOP UNTIL Key$ = "q"
END SUB

   SUB PAUSE (time%)
  
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > time%

END SUB

SUB red (redx%, redy%, redc%)

CIRCLE (520 + redx%, 270 + redy%), 5, 4
PAINT (520 + redx%, 270 + redy%), 4, 4

END SUB

               SUB REPLAY (repx%, repy%, repc%)

SCREEN 12
CALL TITLE(tx%, ty%, tc%)
CALL RULES(rx%, ry%, rc%)

REM *********** Character 1 intro.

CALL BACKGROUND(bx%, by%, bc%)
CALL COIN(coinx%, coiny%, coinc%)

cx% = -100
cy% = 36

FOR i% = 1 TO 17

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)

cx% = cx% + 10

NEXT i%

FOR i2% = 1 TO 6

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)

cx% = cx% + 5
cy% = cy% - 10

NEXT i2%

FOR i3% = 1 TO 6

   CALL CHARACTER1(cx%, cy%, cc%)
   CALL PAUSE(.05)
   CALL erasecharacter1(cx%, cy%, cc%)

cx% = cx% + 5
cy% = cy% + 10

NEXT i3%

CALL CHARACTER1(cx%, cy%, cc%)

FOR i4% = 1 TO 1
 
   LOCATE 20, 28
      PRINT "Player 1"
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3

NEXT i4%


REM*********** Character 2 intro.

CLS

CALL BACKGROUND2(b2x%, b2y%, b2c%)
CALL KIRBY(kx%, ky%, kc%)

FOR i5% = 1 TO 1
   LOCATE 20, 38
      PRINT "Player 2"
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3
NEXT i5%

REM*********** Start of game.


CALL LEVEL1(l1x%, l1y%, l1c%)
CALL LEVEL1p2(l1p2x%, l1p2y%, l1p2c%)
CALL LEVEL2(l2x%, l2y%, l2c%)
CALL LEVEL2p2(l2p2x%, l2p2y%, l2p2c%)
CALL LEVEL3(l3x%, l3y%, l3c%)
CALL LEVEL3p2(l3p2x%, l3p2y%, l3p2c%)
CALL FINAL(finx%, finy%, finc%)

time% = INT(RND * 10) + 1
CALL PAUSE(time%)
CALL FINAL2(f2x%, f2y%, f2c%)

END SUB

SUB RULES (rx%, ry%, rc%)
LINE (100, 100)-(540, 400), 6, BF
LOCATE 8, 36
PRINT "SURVIVAL"

LOCATE 12, 14
PRINT "Objective: Outlive the opposing player."
LOCATE 14, 14
PRINT "Use 4 & 6 Keys move left and right!"
LOCATE 16, 14
PRINT "Use 8 & 4 to move up and down. (Level 2)"
LOCATE 18, 14
PRINT "Dodge the yellow fireballs!"
LOCATE 20, 14
PRINT "Being Kirby (Player 2) is a disadvantage."
LOCATE 22, 14
PRINT "Life lesson here = Life is unfair."
LOCATE 24, 14
PRINT "Press q to quit and c to continue."
LOCATE 26, 14
PRINT "Enjoy! =)"

DO
Key$ = INKEY$
   DO
      rc% = INT(RND * 15) + 1
   LOOP UNTIL rc% <> 6
   PAINT (2, 2), rc%, 6
LOOP UNTIL Key$ = "c"

END SUB

SUB SIDEFIRE1 (s1x%, s1y%, s1c%)

CIRCLE (520 + s1x%, 270 + s1y%), 5, 14
PAINT (520 + s1x%, 270 + s1y%), 14, 14

END SUB

SUB SIDEFIRE2 (s2x%, s2y%, s2c%)

CIRCLE (520 + s2x%, 270 + s2y%), 5, 14
PAINT (520 + s2x%, 270 + s2y%), 14, 14

END SUB

SUB SIDEFIRE3 (s3x%, s3y%, s3c%)

CIRCLE (520 + s3x%, 270 + s3y%), 5, 14
PAINT (520 + s3x%, 270 + s3y%), 14, 14

END SUB

SUB SIDEFIRE4 (s4x%, s4y%, s4c%)

CIRCLE (520 + s4x%, 270 + s4y%), 5, 14
PAINT (520 + s4x%, 270 + s4y%), 14, 14

END SUB

SUB TITLE (tx%, ty%, tc%)

FOR i% = 1 TO 35
   LINE (0 + tx%, 0 + ty%)-(10 + tx%, 480 + y%), 2, BF
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > .07
   tx% = tx% + 20
NEXT i%

tx% = 0
FOR i% = 1 TO 10
   LINE (610 + tx%, 0 + ty%)-(620 + tx%, 480 + ty%), 13, BF
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > .07
   tx% = tx% - 40

   LINE (0 + tx%, 0 + ty%)-(10 + tx%, 480 + ty%), 2, BF
   LINE (610 + tx%, 0 + ty%)-(620 + tx%, 480 + ty%), 13, BF
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > .05
   LINE (0, 0)-(640, 480), 0, BF
   ty% = ty% - 30

   LINE (0 - tx%, 0 - ty%)-(10 - tx%, 480 - ty%), 7, BF
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > .5
   LINE (0, 0)-(640, 480), 0, BF
   ty% = ty% + 10

NEXT i%

FOR i% = 1 TO 1
   LOCATE 10, 23
   PRINT "Crazy Line Games Presents..."
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3
NEXT i%

CLS

FOR i% = 1 TO 1
   LOCATE 10, 23
   PRINT "A Richard Phillips' Project..."
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 3
NEXT i%

CLS

y% = 0
FOR i% = 1 TO 1
   LOCATE 10, 35
   PRINT "Survival."
   Start! = TIMER
   DO
   LOOP UNTIL (TIMER - Start!) > 5
NEXT i%


END SUB

