From b849e7da6fa7ffa3366fe4545d5b6011142057e6 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 6 Jan 2017 14:42:42 -0500 Subject: [PATCH] glados: portals work (sort of) --- glados3.3/portal.bas | 53 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/glados3.3/portal.bas b/glados3.3/portal.bas index f6b75237..f18c8469 100644 --- a/glados3.3/portal.bas +++ b/glados3.3/portal.bas @@ -2,21 +2,27 @@ 11 POKE 232,0:POKE 233,16 12 PRINT CHR$(4)+"BLOAD OBJECTS.SHAPE,A$1000" 15 GOSUB 1000 -20 CX=99:CY=100:VY=0 +20 CX=20:CY=100:VY=0:SX=140:SY=80:BO=0:GO=0 +22 XDRAW 1 AT SX,SY 25 XDRAW 2 AT CX,CY-7 30 HCOLOR=5:REM ORANGE '35 HPLOT CX,CY-7 TO CX,CY+7 ' ERASE OLD COPY '35 XDRAW 2 AT CX,CY-7 -35 OX=CX:OY=CY -37 IF PEEK(-16384)<128 THEN GOTO 50 +35 OX=CX:OY=CY:LX=SX:LY=SY +37 IF PEEK(-16384)<128 THEN GOTO 100 40 GET A$ +41 IF A$="I" AND SY>4 THEN SY=SY-4 +42 IF A$="J" AND SX>4 THEN SX=SX-4 +43 IF A$="K" AND SX<275 THEN SX=SX+4 +44 IF A$="M" AND SY<150 THEN SY=SY+4 45 IF A$="D" THEN CX=CX+2 46 IF A$="A" THEN CX=CX-2 47 IF A$="Q" THEN GOTO 800 48 IF A$=" " THEN VY=5 -50 HCOLOR=0 -'53 HPLOT CX,CY-7 TO CX,CY+7 +49 IF A$="H" THEN GOSUB 5000 +50 IF A$="," THEN GOSUB 6000 +51 IF A$="." THEN GOSUB 7000 ' PHYSICS ENGINE 100 CY=CY-VY 105 VY=VY-4.5 @@ -30,9 +36,13 @@ 230 IF CX > 119 AND CX < 161 AND CY>140 THEN GOTO 800 240 REM ' DRAW AT UPDATE CO-ORDS -245 IF OX=CX AND OY=CY GOTO 500 +245 IF OX=CX AND OY=CY GOTO 255 250 XDRAW 2 AT OX,OY-7 251 XDRAW 2 AT CX,CY-7 +255 IF LX=SX AND LY=SY GOTO 300 +256 XDRAW 1 AT LX,LY +257 XDRAW 1 AT SX,SY +300 REM 500 GOTO 30 ' 800 REM DEAD @@ -61,4 +71,33 @@ ' LASER 1042 HPLOT 0,42 TO 240,42 1050 RETURN - +' HELP +5000 REM HELP +5010 TEXT:HOME +5020 PRINT " **** HELP ****" +5025 PRINT +5030 PRINT " CHELL PORTAL GUN" +5035 PRINT " ~~~~~~~~~~~~~ ~~~~~~~~~~~~~" +5040 PRINT " A = MOVE LEFT I = UP" +5050 PRINT " D = MOVE RIGHT J = LEFT" +5060 PRINT " SPACE = JUMP K = RIGHT" +5070 PRINT " M = DOWN" +5080 PRINT " , = SHOOT BLUE" +5090 PRINT " Q = QUIT . = SHOOT ORANGE" +5100 PRINT:GET A$ +5110 HGR +5120 RETURN +' DRAW BLUE PORTAL +6000 REM DRAW BLUE +' Erase old +6005 IF BO=1 THEN HCOLOR=0: DRAW 2 AT BX,BY +6010 BX=SX:BY=SY +6020 BO=1:HCOLOR=6:DRAW 2 AT BX,BY +6030 RETURN +' DRAW ORANGE PORTAL +7000 REM DRAW ORANGE +' Erase old +7005 IF GO=1 THEN HCOLOR=0: DRAW 2 AT GX,GY +7010 GX=SX+1:GY=SY +7020 GO=1:HCOLOR=5:DRAW 2 AT GX,GY +7030 RETURN