glados: add rudimentary sound effects

This commit is contained in:
Vince Weaver 2017-01-09 14:27:50 -05:00
parent 6087ff6284
commit 262a2e0371

View File

@ -13,18 +13,41 @@
' ZY,PY=Laser Y ZX,PX = BEGIN/END
' T = TIME
'
'
' Load Sound Library
' Violin sound, based on: https://gist.github.com/thelbane/9291cc81ed0d8e0266c8
5 DATA 172,1,3,173,0,3,133,250,174,0,3,228,250,208,3,173,48,192,202,208,246,173,48,192,136,240,7,198,250,208,233,76,5,3,96
6 FOR L=770 TO 804:READ V:POKE L,V:NEXT L
' Clear screen to black#2
10 HOME:HGR:SCALE=2:ROT=0:HCOLOR=4:HPLOT 0,0:CALL 62454
'
' Load Shape Table
'
11 POKE 232,0:POKE 233,29
12 PRINT CHR$(4)+"BLOAD OBJECTS.SHAPE,A$1D00"
20 CX=21:CY=100:CD=0:VX=0:VY=0:SX=140:SY=80:BO=0:GO=0:T=0:ZY=42:ZX=0:PX=0:PY=0
'
' Initialize Variables
'
20 CX=21:CY=100:CD=0:VX=0:VY=0:SX=140:SY=80:BO=0:GO=0:T=0:ZY=42:ZX=0:PX=0:PY=0:L=1
'
' Draw Level Background
'
21 GOSUB 1000
'
' Draw Initial Chell and Gun Cursor
'
22 SCALE=2:XDRAW 1 AT SX,SY
25 SCALE=1:XDRAW 3 AT CX,CY
'
30 REM MAIN LOOP
'
' Time related activities
32 T=T+1:IF T>100 THEN T=0:GOSUB 8000
'
35 OX=CX:OY=CY:OD=CD:LX=SX:LY=SY
'
' Check keyboard
'
37 IF PEEK(-16384)<128 THEN GOTO 100
40 GET A$
42 IF A$="I" AND SY>4 THEN SY=SY-4
@ -36,11 +59,13 @@
52 IF A$="A" AND VX>0 THEN VX=0:CD=1:GOTO 54
53 IF A$="A" THEN VX=-8:CD=1
54 IF A$="Q" THEN GOTO 800
56 IF A$=" " THEN VY=5
56 IF A$=" " THEN VY=5:POKE 768,240:POKE 769,10:CALL 770
58 IF A$="H" THEN GOSUB 5000
60 IF A$="," THEN GOSUB 6000
62 IF A$="." THEN GOSUB 6100
'
' PHYSICS ENGINE
'
100 CY=CY-VY
105 VY=VY-4.5
' Move X. Ensure we are always odd so colors are right
@ -51,8 +76,8 @@
'
' Portals
200 IF BO=0 OR GO=0 GOTO 210
202 IF CX>BX-5 AND CX<BX+5 AND CY<BY+12 AND CY>BY-12 THEN CX=GX+5*VX:CY=GY
204 IF CX>GX-5 AND CX<GX+5 AND CY<GY+12 AND CY>GY-12 THEN CX=BX+5*VX:CY=BY
202 IF CX>BX-5 AND CX<BX+5 AND CY<BY+12 AND CY>BY-12 THEN CX=GX+5*VX:CY=GY:POKE 768,180:POKE 769,40:CALL 770
204 IF CX>GX-5 AND CX<GX+5 AND CY<GY+12 AND CY>GY-12 THEN CX=BX+5*VX:CY=BY:POKE 768,180:POKE 769,40:CALL 770
' Edges
210 IF CX<7 THEN CX=7:VX=0
212 IF CX>271 THEN CX=271:VX=0
@ -158,6 +183,7 @@
5120 RETURN
' DRAW BLUE PORTAL
6000 REM DRAW BLUE
6002 POKE 768,143:POKE 769,40:CALL 770
' Erase old
6004 SCALE=2
6005 IF BO=1 THEN XDRAW 2 AT BX,BY
@ -167,6 +193,7 @@
6030 RETURN
' DRAW ORANGE PORTAL
6100 REM DRAW ORANGE
6102 POKE 768,72:POKE 769,40:CALL 770
' Erase old
6104 SCALE=2
6105 IF GO=1 THEN XDRAW 2 AT GX,GY
@ -219,7 +246,6 @@
'
' Opening:
' General:
' Sound effects?
' Parametric Levels (Generic Game Engine)
'
' Level 1/19: