From 03414aab1b6787f005ebd44180ebdb1b90b7533f Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 6 Jan 2017 14:10:06 -0500 Subject: [PATCH] glados: initial game --- glados3.3/portal.bas | 72 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/glados3.3/portal.bas b/glados3.3/portal.bas index c4b187c6..f6b75237 100644 --- a/glados3.3/portal.bas +++ b/glados3.3/portal.bas @@ -1,12 +1,64 @@ -10 HGR -20 CX=100:CY=100 -30 HCOLOR=3 -35 HPLOT CX,CY-7 TO CX,CY+7 +10 HOME:HGR +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 +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 40 GET A$ -42 HCOLOR=0 -43 HPLOT CX,CY-7 TO CX,CY+7 -45 IF A$="D" THEN CX=CX+1 -46 IF A$="A" THEN CX=CX-1 -50 GOTO 30 - +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 +' PHYSICS ENGINE +100 CY=CY-VY +105 VY=VY-4.5 +' COLLISION DETECTION +200 IF CX<7 THEN CX=7 +205 IF CX>271 THEN CX=271 +210 IF CY<7 THEN CY=7:VY=-VY +' DETECT THE FLOOR +220 IF CX < 119 AND CY > 112 THEN CY=112:VY=0 +225 IF CX > 161 AND CY > 112 THEN CY=112:VY=0 +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 +250 XDRAW 2 AT OX,OY-7 +251 XDRAW 2 AT CX,CY-7 +500 GOTO 30 +' +800 REM DEAD +805 VTAB 21:PRINT "YOU DIED!":PRINT "TRY AGAIN? (Y/N) "; +810 GET A$ +815 IF A$="Y" THEN GOTO 10 +820 IF A$="N" THEN GOTO 999 +830 GOTO 810 +' +999 END +1000 REM LEVEL 1 +' FLOOR +1005 HCOLOR=3 +1010 HPLOT 0,120 TO 112,120 TO 112,159 TO 168,159 TO 168,120 TO 279,120 +' "WATER" +1015 HCOLOR=1 +1020 FOR I=113 TO 167:HPLOT I,130 TO I,158:NEXT I +' PLATFORM +1030 HCOLOR=2:FOR I=230 TO 279:HPLOT I,50 TO I,56:NEXT I +' SENTRY +1035 HCOLOR=3:HPLOT 242,40 TO 242,46:HPLOT 243,40 TO 243,46:HPLOT 247,40 TO 247,46:HPLOT 248,40 TO 248,46 +1037 HPLOT 243,39 TO 247,39:HPLOT 242,46 TO 248,46 +1038 HPLOT 240,47 TO 241,47:HPLOT 239,48 TO 240,48:HPLOT 239,49 TO 240,49 +1039 HPLOT 249,47 TO 250,47:HPLOT 250,48 TO 251,48:HPLOT 250,49 TO 251,49 +1040 HCOLOR=5:HPLOT 244,41 TO 245,41:HPLOT 244,43 TO 245,43 +' LASER +1042 HPLOT 0,42 TO 240,42 +1050 RETURN