' FENCED! v1.03,Two player ' Initiation STICK 1 SETCOLOR 1,7,0,0 ! col 2 =blue SETCOLOR 2,0,0,7 ! col 3 =red DIM movex%(3),movey%(3) del%=150 ! The lower,the more difficult sx%=319 !Screen limits,adjust for med/hi res. sy%=199 right$="X" !Movement keys for player 2 left$="Z" hiscr%=1000 hiscr$="DDD og THP" RESTORE FOR i=0 TO 3 READ movex%(i),movey%(i) NEXT i ' ' Title screen titlescr: CLS RESTORE title REPEAT READ z$ PRINT TAB(20-LEN(z$)/2); PRINT z$ UNTIL z$="" PRINT " Hiscore:" PRINT hiscr$;" - ";hiscr% z$=INPUT$(1) IF ASC(z$)=27 THEN END ENDIF ' ' Game start scr%=0 hx%=32 !P1 placement,and default movement hy%=32 move1%=1 ax%=298 ! same for P2 ay%=170 move2%=3 ' l_360: CLS COLOR 1 BOX 0,0,sx%,sy% !Borders ' Game loop l_1000: d%=STICK(1) i$=UPPER$(INKEY$) SELECT d% !Player 1 movement selection CASE 1 IF move1%<>2 ! the IF statments prevents a flip suicide move1%=0 ENDIF CASE 2 IF move1%<>0 move1%=2 ENDIF CASE 4 IF move1%<>1 move1%=3 ENDIF CASE 8 IF move1%<>3 move1%=1 ENDIF ENDSELECT IF i$=right$ THEN !Movement for player 2 INC move2% ENDIF IF i$=left$ THEN DEC move2% ENDIF m%=move2% !Get coord movement for P1 GOSUB movem x2%=x% y2%=y% move2%=m% m%=move1% !Same for P2 GOSUB movem move1%=m% IF i$="P" THEN !Game Pause option z$=INPUT$(1) ENDIF IF ASC(i$)=27 THEN !Game Quit Option GOTO titlescr ENDIF hy%=hy%+y% !Move the players positions hx%=hx%+x% ax%=ax%+x2% ay%=ay%+y2% xx%=0 i%=POINT(hx%,hy%) !P1 hit anything? IF i%<>0 THEN INC xx% ENDIF i%=POINT(ax%,ay%) !P2 hit anything? IF i%<>0 THEN ADD xx%,2 ENDIF IF xx%<>0 THEN GOTO l_2000 ENDIF COLOR 2 PLOT hx%,hy% COLOR 3 PLOT ax%,ay% FOR i=0 TO del% NEXT i INC scr% GOTO l_1000 ' l_2000: PRINT AT(2,2);"Player"; SELECT xx% CASE 1 PRINT " 2 won."; CASE 2 PRINT " 1 won."; CASE 3 PRINT "s both lost."; ENDSELECT PRINT " Score: ";scr% PRINT AT(2,3); LINE INPUT "What's your name";z$ IF scr%>hiscr% THEN IF z$="" THEN z$="UNKOWN" ENDIF hiscr$=z$ hiscr%=scr% ENDIF GOTO titlescr ' PROCEDURE movem m%=m% AND 3 x%=movex%(m%) y%=movey%(m%) RETURN ' ' DATA 0,-1,1,0,0,1,-1,0 ' title: DATA "* FENCED v1.03 *","By Kent Dahl."," ","Objective:" DATA "To draw a line as long as possible","without 'crashing' into anything," DATA "and making your opponent crash instead."," ","Controls:","-----" DATA "Player 1 (Red):","Joystick in port 1","-","Player 2 (Blue):" DATA "Z & X rotates." DATA ""