%%HP: T(3)A(D)F(.);
@ CARGAME by Jonas Lindstedt
DIR
  BI
    DIR
      PPAR { (-6.5,-3.1) (6.5,3.2) X 0 (0,0) FUNCTION Y }
      SPEL 153
      HIGH 4
      COOLAST "Jonas"
      HIGH2 3
      TV\197A "Jonas"
      HIGH3 2
      TREA "Jonas"
      HIGH4 1
      FYRA "Jonas"
      SON1 { 493 740 493 493 698 493 493 740 493 493 698 493 493 740 493 493
        440 622 440 440 587 440 440 622 440 440 587 440 440 622 440 440 }
      TUT
        \<< SON1 OBJ\-> DROP SON1 OBJ\-> DROP 1 MAXR
          FOR I .02 WAIT .1 BEEP
          NEXT
        \>>
      REK
        \<< -1 'P' STO+
          IF P HIGH4 >
          THEN
"GRATTIS TILL ATT HA
F\197TT EN HAJSK\197R!
SKRIV DITT NAMN!"
"" INPUT 'NA' STO 'COOLAST' 'HIGH' HIGH 'PO' STO JAM
'TV\197A' 'HIGH2' HIGH2 'PO' STO JAM
'TREA' 'HIGH3' HIGH3 'PO' STO JAM
'FYRA' 'HIGH4' HIGH4 'PO' STO JAM
          ELSE UPDIR
          END
        \>>
      NA "Jonas"
      PO 3
      JAM
        \<<
          IF 'P>PO'
          THEN P SWAP STO NA SWAP STO 'P' PURGE UPDIR CLEAR HIGH KILL
          END
        \>>
    END
  INTRO
    \<<
GROB 24 12 000F0000422000224008FFF00EFFF10FFFF18FFFF38FFFF3F7FFBFFBEF5F0220110C10E0
GROB 42 19 0000000C1000000000022000CFF700077000400800022000C9BB810410000AAA420410000AAA420410000AAA7EF730000AB30000400002000000410009FFFFFF51000100000041000170700041000F8F8FFF700004050183F1000425216CA600040501925D10088880929F300070706C0000
GROB 71 55 000000000000020000000000000000030000000000000000070000000000000000070000000000000000074000000000000E30876000000000000FF0873000000000008FC18B3000000000008FA18F3000000000004CC1CF10000000000048F1EF20000000000024F1EF30000000000814F0FF1000000000060BF8FF000000000002CCFEFF00000000030CFFFFF7000000000700FFFFF3000000000F1E7FFFF1000000000EFFBFFFFC4000000001EFFFFF7EB30000000FF100FF9F0C0000008DFFFFC7F140100000CCD3E7DC7000300000C37F97AF0010200000C842E1E10804400000EF930E30080070000032EFFF00000A2000088108F700040D20000640000600040D20008130008000008C30006C00004000048E3000120000200004CB3008010000100810493004800008000438493002400004000A2079100120000200027CF81080100001000F5EE91080100080000FFFEF104800008C100F3FDF00E8000043600F3EF700EB0000AF808F3CB7007E0000EF908C78F3003C0008F831887000007C308F30396A700000E77FF330392B700000CFDF3C7C941B7000000FF0CFF3EB187000000EFFF3FF1E6C3000000EBFFF00CDFF3000000CFF3000EDFF3000000C7FF000EFFF30000008FC7000CBFF10000000EF3000C7FF000000000000008F87000000000000000E70000000
\-> BUG TRAIN BIRD
      \<< BI ERASE { # 0h # 0h } PVIEW 0 110
        FOR i PICT i R\->B # 0h 2 \->LIST BUG REPL 3
        STEP PICT { # 14h # 2h } "HIGHWAYRACE" 1 \->GROB REPL 130 2
        FOR i PICT i R\->B # Ch 2 \->LIST BIRD REPL -4
        STEP
        IFERR TUT
        THEN
        END
        DO PICT { # 46h # 3Ah } "PRESS ENTER!" 1 \->GROB GXOR
        UNTIL KEY 1 SAME
        END UPDIR HIGH CAR
      \>>
    \>>
  CAR
    \<< 0 0 -15 0 # 0h # 0h # 18h
GROB 131 2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70
GROB 131 1 EFBFFEFBFFEFBFFEFBFFEFBFFEFBFFEF30
GROB 12 9 C910EF303A402290229022902A40EF30C910
GROB 34 9 8930000000CF70000000254000000094400000009440000000944000000025C0000000CF700000008930000000
\-> LIV p S X k z c L1 L2 CAR CAR2
      \<< BI 1 'SPEL' STO+ ERASE { # 0h # 0h } PVIEW
PICT { # 0h # 9h } L1 REPL
PICT { # 0h # 16h } L2 REPL
PICT { # 0h # 22h } L2 REPL
PICT { # 0h # 2Eh } L1 REPL
{ # 63h # 0h } { # 63h # 9h } LINE
{ # 63h # 2Eh } { # 63h # 40h } LINE
PICT z c 2 \->LIST CAR REPL
PICT { # Ah # 32h } COOLAST 1 \->GROB REPL
PICT { # Ah # 39h } HIGH 1 \->GROB REPL
PICT { # 14h # 2h } "HIGHWAYRACE" 1 \->GROB REPL
PICT { # 73h # 38h } SPEL 1 \->GROB REPL 1 MAXR
        FOR p RAND 3 * .5 - 0 RND 12 * 12 + R\->B 'X' STO 120 0
          FOR i 1 KEY DROP 'k' STO
            IF k 35 SAME
            THEN
              PICT z c 2 \->LIST CAR GXOR
              12 'c' STO+ PICT z c 2 \->LIST CAR REPL
            END
            IF k 25 SAME
            THEN
              PICT z c 2 \->LIST CAR GXOR
              c 12 - 'c' STO PICT z c 2 \->LIST CAR REPL
            END PICT i R\->B X 2 \->LIST CAR2 REPL
            IF z B\->R 10 - i < z 10 + B\->R i \>= X c == AND AND
              c B\->R 9 < OR c B\->R 46 > OR
            THEN 200 .5 BEEP PICT i R\->B X 2 \->LIST CAR2 GXOR
120 'i' STO PICT z c 2 \->LIST CAR REPL
LASTARG GXOR # 18h 'c' STO # 0h 'z' STO PICT z c 2 \->LIST CAR REPL
1 'LIV' STO+
              IF LIV 3 ==
              THEN PICT { # 28h # 39h } "GAME OVER" 1 \->GROB REPL
                2 WAIT p 'P' STO REK UPDIR KILL
              END
            END S
          STEP 1 'p' STO+ PICT { # 2h # 2h } p 1 \->GROB REPL
PICT { # 2h # 37h } 3 LIV - 1 \->GROB REPL
PICT # 0h X 2 \->LIST CAR2 GXOR
PICT z c 2 \->LIST CAR GXOR
10 'z' STO+ PICT z c 2 \->LIST CAR REPL
          IF z B\->R 99 >
          THEN PICT z c 2 \->LIST CAR GXOR # 0h 'z' STO -5 'S' STO+
            IF S -25 ==
            THEN 5 'S' STO+ p 10 + 'p' STO
            END PICT z c 2 \->LIST CAR REPL
          END
        NEXT
      \>>
    \>>
  HIGH
    \<< BI ERASE { # 0h # 0h } PVIEW PICT "* HIGHSCORELIST *" 2 \->GROB
DUP SIZE DROP 2 / 65 SWAP - # 3h 2 \->LIST SWAP REPL
{ # 0h # 0h } { # 82h # 3Fh } BOX
{ # 0h # Ch } { # 82h # Ch } LINE
{ # 0h # 3Dh } { # 82h # 3Dh } LINE
{ # 0h # 3Bh } { # 82h # 3Bh } LINE
PICT COOLAST ".." HIGH + + 2 \->GROB
DUP SIZE DROP 2 / 65 SWAP - # Fh 2 \->LIST SWAP REPL
PICT TV\197A ".." HIGH2 + + 2 \->GROB
DUP SIZE DROP 2 / 65 SWAP - # 19h 2 \->LIST SWAP REPL
PICT TREA ".." HIGH3 + + 2 \->GROB
DUP SIZE DROP 2 / 65 SWAP - # 23h 2 \->LIST SWAP REPL
PICT FYRA ".." HIGH4 + + 2 \->GROB
DUP SIZE DROP 2 / 65 SWAP - # 2Dh 2 \->LIST SWAP REPL CLEAR UPDIR
      DO
      UNTIL KEY 1 ==
      END
    \>>
END
