DECLARE SUB BORDER ()
DECLARE SUB TAG1 ()
DECLARE SUB REF ()
DECLARE SUB bodyshape (h!, v!, di!, c!)
DECLARE SUB boxer2 ()
DECLARE SUB Boxer1 ()
COMMON SHARED LPC
COMMON SHARED h1h, v1v
COMMON SHARED a1a, b1b
COMMON SHARED h1h1, v1v1
COMMON SHARED Rh, Rv
COMMON SHARED RH1, RV1
COMMON SHARED JRh, JRv
COMMON SHARED JRh1, JRv1


SCREEN 12

 txspeed = 5
 h1h = 540: v1v = 40
 a1a = 320 - 50: b1b = 100
 Rh = 40: Rv = 200
 JRh = 400: JRv = 210



DO
LOCATE 1, 1: PRINT h, v, a, b; KE$

  KE$ = INKEY$
   
    h = STICK(0): v = STICK(1): a = STICK(2): b = STICK(3)

    IF KE$ = "K" THEN h1h = h1h + txspeed
    IF KE$ = "J" THEN h1h = h1h - txspeed
    IF KE$ = "M" THEN v1v = v1v + txspeed
    IF KE$ = "I" THEN v1v = v1v - txspeed


    IF KE$ = "S" THEN Rh = Rh + txspeed
    IF KE$ = "A" THEN Rh = Rh - txspeed
    IF KE$ = "Z" THEN Rv = Rv + txspeed
    IF KE$ = "W" THEN Rv = Rv - txspeed



    CALL Boxer1
    CALL boxer2
    CALL REF
    CALL TAG1
    CALL BORDER



LOOP UNTIL KE$ = CHR$(27)

SUB bodyshape (h, v, di, c)


hxa$ = "bu5l5d10r10u10l5bd10d5"
bglxa$ = "l10d10u10r20d10u10l10d5"
LEGXA$ = "d15l5d10l5br20l5u10l5"

LEGXA$ = "d15l5d5l5br20l5u5l5"

DRAW "bm" + STR$(h) + "," + STR$(v + 20) + "c" + STR$(c) + hxa$ + bglxa$
DRAW LEGXA$

END SUB

SUB BORDER


LINE (1, 200)-(40, 100), 7
LINE -(500, 100), 7
LINE -(600, 400), 7



END SUB

SUB Boxer1
REM left Boxer

c = 3
CIRCLE (h1h, v1v), 10, c
CALL bodyshape(h1h, v1v, di, c)


IF h1h <> (h1h1) OR v1v <> (v1v1) THEN
  
  CIRCLE (h1h1, v1v1), 10, 0
  CALL bodyshape(h1h1, v1v1, di, 0)
 
  h1h1 = h1h: v1v1 = v1v
END IF


END SUB

SUB boxer2

REM right Boxer
c = 2
CIRCLE (a1a, b1b), 10, c
CALL bodyshape(a1a, b1b, di, c)

IF a1a <> (a1a1) OR b1b <> (b1b1) THEN
 
  CIRCLE (a1a1, b1b1), 10, 0
 
  CALL bodyshape(a1a1, b1b1, di, 0)
  a1a1 = a1a: b1b1 = b1b
END IF



END SUB

SUB REF

REM THE REFFERIE
c = 4
CIRCLE (Rh, Rv), 10, c
CALL bodyshape(Rh, Rv, di, c)


IF Rh <> (RH1) OR Rv <> (RV1) THEN
 
  CIRCLE (RH1, RV1), 10, 0
  CALL bodyshape(RH1, RV1, di, 0)

  RH1 = Rh: RV1 = Rv
END IF

END SUB

SUB TAG1
REM TAG TEAM 1
c = 6
CIRCLE (JRh, JRv), 10, c
CALL bodyshape(JRh, JRv, di, c)


IF JRh <> (JRh1) OR JRv <> (JRv1) THEN
 
  CIRCLE (JRh1, JRv1), 10, 0
  CALL bodyshape(JRh1, JRv1, di, 0)

  JRh1 = JRh: JRv1 = JRv
END IF




END SUB

