
Hi all HP28S-fans!
If you type these programs in your HP28S
you'll have very funny computergame called SUBS!
This is how you play the game:
When you have pressed the SUBS-key
a pixel turns up down in the middle of the screen,
that's you, suddenly a submarine is in sight
and you want to destroy it. Now use your LEFT-
or RIGH- key to move in front of the sub 
and fire a missile by pressing the SHIFT- key.
If you have hit the sub soon a new sub will turn up.
When 20 subs have been seen the game is over
and your result will be shown.
If you want more games: check out my BLOB-game.

                                    Rickard Petersson M89 LTH.
 
 
            SUBS
            ^^^^
            
<< CLLCD
"DESTROY THE SUBS" 2
DISP 2 WAIT CLMF FAST
(68,1) PIXEL 68 'G' STO
1 'H' STO 0 'ANT' STO
0 'NSUB' STO 0 'PTS' STO
PSUB
WHILE 1 REPEAT
 DO
  IF RAND .01 <
  THEN TSUB
  ELSE
   IF RAND .9 >
   THEN PSUB
   END
  END
  IF ANT 20 >
  THEN MAXI
  CLLCD "GAME OVER"
  1 DISP
  "YOU DESTROYED " PTS
  ->STR + 2 DISP
  "OF 20 SUBS" 3 DISP
  "BEST IS " MAXP ->STR
   + " POINTS" + 4 DISP
    DO 
     DO
     UNTIL KEY 
     END
    UNTIL "ENTER"
    SAME END
    ABORT
   END
 UNTIL KEY
 END
 IF DUP "LEFT"
 SAME 
 THEN DROP G H -2 0
 MOVE 'H' STO 'G' STO
 ELSE
   IF DUP "RIGHT"
   SAME
   THEN DROP G H 2 0 
   MOVE 'H' STO 'G' STO
   ELSE
 	    IF "SHIFT" 
     SAME THEN  G H 1 + 
     FIRE
     END  
   END
 END CLEAR
END
>>


   
            TSUB
            ^^^^
<<
IF NSUB 0 >
THEN Q LIST-> DROP
1 6
START R->C UNPIXEL
NEXT { 0 0 0 0 0 0
0 0 0 0 } 'Q' STO
0 'NSUB' STO
END
>>



            MAXI
            ^^^^
<<
IF PTS MAXP >
THEN 2000 .1 BEEP
PTS 'MAXP' STO
END
>>


            FIRE
            ^^^^
<< 1000 .01 BEEP G H
-> x y
<< H 1 + 'H' STO 
0 'HIT' STO
WHILE H 32 <= HIT 0 ==
AND
REPEAT G H 0 2 
MOVE 'H' STO 'G' STO
  IF NSUB 0 >
  THEN G H CHK
  END
  IF RAND .02 <
  THEN TSUB PSUB
  END
END x 'G' STO y 
'h' STO
  >> 
>>                                       


            MOVE            
            ^^^^
<< -> a b x y
 << a b R->C UNPIXEL 
a x + b y + R->C DUP
PIXEL C->R
 >>
>>


            CHK
            ^^^
<< R->C -> t
  <<Q  LIST-> DROP 1 6
  START R->C 
   IF t ==
   THEN 50 .1 BEEP
   TSUB PTS 1 + 'PTS' STO
   1 'HIT' STO
   END
  NEXT
  >>
>> 


            PSUB
            ^^^^
<<
  IF NSUB 1 < 
  THEN RAND 50 * IP
  43 + RAND 22 * IP 10
  + -> a b
  << a 3 + b
     a b
     a 2 + b 1 +
     a 1 + b 1 +
     a 2 + b 
     a 1 + b
     12 ->LIST  DUP 'Q' STO 
     LIST-> DROP 1 6
     START R->C PIXEL NEXT
     1 'NSUB' STO ANT 1 + 
     'ANT' STO
   >>
   END
>>


            PPAR
            ^^^^   
[ (0,0) (136,31)
constant 1 (0,0) ]
             

            UNPIXEL
            ^^^^^^^
This program is Eric Toonen's version.
It's described in HP28-UTILITIES-PIXEL_TOONEN.TXT.

            FAST
            ^^^^
If you don't use this program it'll all be too slow.
You find it in HP28-UTILITIES-FAST.TXT.
Set the highest speed.           
                                         
