10 HOME:HGR:SCALE=2:ROT=0 11 POKE 232,0:POKE 233,29 12 PRINT CHR$(4)+"BLOAD OBJECTS.SHAPE,A$1D00" 15 GOSUB 1000 20 CX=20:CY=100:VX=0:VY=0:SX=140:SY=80:BO=0:GO=0 22 SCALE=2:XDRAW 1 AT SX,SY 25 SCALE=1:XDRAW 3 AT CX,CY 30 REM 35 OX=CX:OY=CY:LX=SX:LY=SY 37 IF PEEK(-16384)<128 THEN GOTO 100 40 GET A$ 42 IF A$="I" AND SY>4 THEN SY=SY-4 44 IF A$="J" AND SX>4 THEN SX=SX-4 46 IF A$="K" AND SX<275 THEN SX=SX+4 48 IF A$="M" AND SY<150 THEN SY=SY+4 50 IF A$="D" AND VX<0 THEN VX=0:GOTO 52 51 IF A$="D" THEN VX=5 52 IF A$="A" AND VX>0 THEN VX=0:GOTO 54 53 IF A$="A" THEN VX=-5 54 IF A$="Q" THEN GOTO 800 56 IF A$=" " THEN VY=5 58 IF A$="H" THEN GOSUB 5000 60 IF A$="," THEN GOSUB 6000 62 IF A$="." THEN GOSUB 7000 ' PHYSICS ENGINE 100 CY=CY-VY 105 VY=VY-4.5 107 CX=CX+VX 110 IF VX<0.5 AND VX>-0.5 THEN VX=0 ' ' COLLISION DETECTION ' ' Portals 200 IF BO=0 OR GO=0 GOTO 210 202 IF CX>BX-5 AND CXBY-12 THEN CX=GX+5*VX:CY=GY 204 IF CX>GX-5 AND CXGY-12 THEN CX=BX+5*VX:CY=BY ' Edges 210 IF CX<7 THEN CX=7:VX=0 212 IF CX>271 THEN CX=271:VX=0 214 IF CY<7 THEN CY=7:VY=-VY ' Floors 220 IF CX < 119 AND CY > 112 THEN CY=112:VY=0:VX=VX/2 225 IF CX > 161 AND CY > 112 THEN CY=112:VY=0:VX=VX/2 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 255 250 SCALE=1:XDRAW 3 AT OX,OY 251 XDRAW 3 AT CX,CY 255 IF LX=SX AND LY=SY GOTO 300 256 SCALE=2:XDRAW 1 AT LX,LY 257 XDRAW 1 AT SX,SY 300 REM 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 ' ' COMPANION CUBE ' 0123456789012 '0 #### ### #### '1 ### ### '2 ## ## '3 ## ## '4 ## ##### ## '5 ## ##### ## '6 ### '7 ## # # '8 ### ### '9 #### ### #### 1050 HCOLOR=3:X=261:Y=39 1052 HPLOT X,Y TO X+3,Y :HPLOT X+5,Y TO X+7,Y:HPLOT X+9,Y TO X+12,Y 1054 HPLOT X,Y+1 TO X+2,Y+1: HPLOT X+10,Y+1 TO X+12,Y+1 1056 HPLOT X,Y+2 TO X+1,Y+2: HPLOT X+11,Y+2 TO X+12,Y+2 1058 HPLOT X,Y+4 TO X+1,Y+4: HPLOT X+11,Y+4 TO X+12,Y+4 1060 HPLOT X,Y+5 TO X+1,Y+5: HPLOT X+11,Y+5 TO X+12,Y+5 1062 HPLOT X,Y+7 TO X+1,Y+7: HPLOT X+11,Y+7 TO X+12,Y+7 1064 HPLOT X,Y+8 TO X+2,Y+8: HPLOT X+10,Y+8 TO X+12,Y+8 1066 HPLOT X,Y+9 TO X+3,Y+9:HPLOT X+5,Y+9 TO X+7,Y+9:HPLOT X+9,Y+9 TO X+12,Y+9 1068 HPLOT X+4,Y+3 TO X+5,Y+3:HPLOT X+7,Y+3 TO X+8,Y+3 1070 HPLOT X+4,Y+4 TO X+8,Y+4 1072 HPLOT X+4,Y+5 TO X+8,Y+5 1074 HPLOT X+5,Y+6 TO X+7,Y+6 1076 HPLOT X+6,Y+7 1099 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$ ' return to hires 5110 POKE -16304,0 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 ' ' BUGS: ' Shouldn't be able to create portals underground ' Artifacts when deleting portals ' ' TODO: ' ' Opening: ' Aperture Science Logo ' Print Level 1/19 ' General ' Sound effects? ' Configurable Levels ' ' Level 1/19 ' Have sentry "talk" on text screen ' Clear screen to black4 so chell's colors are right ' Only allow chell on odd X co-ord ' Use xdraw for portals ' Allow Chell to face backward ' Walking animation? ' Sentries kill ' Sentries shoot/laser through portal ' Walk on platform ' Sentries can be knocked over from behind ' Sentries an object that can go through portal ' Companion cube? ' ' End level ' GLADOS ' Have GLADOS talk? ' Objects through portal ' Incinerator ' Die if go into incinerator ' Call out to Still Alive