MODULE; SQUEEZE by David Plotkin››; CHECKSUM DATA›;[9D B7 4C F7 52 58 31 F9›; 40 38 55 8D C3 54 96 2B›; 04 40 20 7F 1B 2A 55 57›; 0A 61 51 8F 9F 58 F4 4B›; B6 B4 B5 E9 ]››BYTE ChrBase=756,Max,Bkgrnd=710,› Fate=53770,Level=[1],CursIn=752,› Gunx=[19],Guny=[12],Ps=[1],› Loud=[0],Dly=[3],Hard=[1]››CARD Scrn=88,RamSet,HiMem=$2E5,› Score=[0],Target››CARD ARRAY Linept(24),Ll(30)›››BYTE ARRAY Charset,Shotstatus(30),› Shotx(30),Shoty(30),EndL(24),› EndR(24),› ShapeTable(0)=› [104 208 208 213 213 208 208 104› 10 8 7 87 87 7 7 10› 255 255 255 255 255 255 255 255› 170 170 170 170 170 170 170 170› 85 85 85 85 85 85 85 85› 87 87 87 87 87 87 87 87› 175 175 175 175 175 175 175 175› 170 255 170 255 170 255 170 255› 85 255 85 255 85 255 85 255› 85 170 85 170 85 170 85 170]››PROC Download()›;Step back HiMem and move the›;character set into RAM›RamSet=(HiMem-$400)&$FC00;1K boundary›ChrBase=RamSet RSH 8›HiMem=RamSet›MOVEBLOCK(RamSet,57344,1024)›Charset=RamSet›RETURN››PROC Gr0Init()›;Set up address of each screen›;line and initialize›CARD xx›GRAPHICS(0) CursIn=1 PRINT(" ")›FOR xx=0 TO 23›DO› Linept(xx)=Scrn+(40*xx)› EndL(xx)=0 EndR(xx)=39›OD›FOR xx=0 TO 29›DO Shotstatus(xx)=0 Shotx(xx)=0› Shoty(xx)=0 Ll(xx)=xx*1000›OD Bkgrnd=0›RETURN››PROC Plot0(BYTE x,y,ch)›;Plot a char at location x,y›BYTE ARRAY line›line=Linept(y) line(x)=ch›RETURN››PROC Modify()›;Modify the RAM character set›CARD xx›FOR xx=0 TO 79›DO › Charset(xx+8)=ShapeTable(xx)›OD›RETURN››PROC UpdateScore()›;Print the score and Level›POSITION(1,23) PRINT("ÓÃÏÒź")›POSITION(8,23) PRINTC(Score)›POSITION(16,23) PRINT("ÌÅÖÅ̺")›POSITION(23,23) PRINTB(Level)›POSITION(27,23) PRINT("Targ: ")›POSITION(33,23) PRINTC(Target)›RETURN››PROC Noise()›;the explosions when a block is hit›IF Loud=0 THEN RETURN FI›Loud==-2 SOUND(1,90,8,Loud)›RETURN››PROC NewLevel()›;set up a more difficult level›BYTE time=20,lp›SOUND(1,0,0,0) PUT(125) Level==+1›POSITION(9,12)›PRINT("New Ìåöåìº") POSITION(20,12)›PRINTB(Level) time=0› DO SOUND(0,time,10,4)› UNTIL time>100› OD›PUT(125) SOUND(0,0,0,0)›UpdateScore()›FOR lp=0 TO 29›DO Shotstatus(lp)=0 OD›FOR lp=0 TO 23›DO EndL(lp)=0 EndR(lp)=39 OD›IF Level>8 THEN Dly=1 ELSEIF Level>3› THEN Dly=2 ELSE Dly=3›FI Loud=0›RETURN››PROC Choice()›;choose the difficulty level›BYTE lp=[1],time=20,trig=644,stick=632›POSITION(2,13)›PRINT("Select Difficulty with Jojstick")›POSITION(2,14)›PRINT("Then press  æéòå ")›POSITION(7,16)›PRINT("1. Åáóù - Goal 8000 points")›POSITION(7,17)›PRINT("2. Íåäéõí - Goal 12000 points")›POSITION(7,18)›PRINT("3. Èáòä - Goal 14000 points")›DO Plot0(5,lp+15,0)› IF stick=14 AND lp>1 THEN lp==-1› ELSEIF stick=13 AND lp<3 THEN› lp==+1› FI Plot0(5,lp+15,84)› time=0 DO UNTIL time=20 OD› UNTIL trig=0›OD Hard=lp›IF lp=1 THEN Target=8000 ELSEIF› lp=2 THEN Target=12000 ELSE› Target=14000›FI›RETURN››PROC Intro()›;The introduction›BYTE time=20,lp,xx›BYTE ARRAY hello(0)=[51 49 53 37 37›37 37 58 37 1 1 1]›POSITION(7,5)›PRINT("ÁÎÁÌÏÇ ÐÒÅÓÅÎÔÓ")›FOR lp=0 TO 11›DO Plot0(lp+9,8,hello(lp))› SOUND(0,hello(lp) LSH 1,10,4)› time=0 DO UNTIL time=9 OD›OD SOUND(0,0,0,0) POSITION(7,9)›PRINT("written in ACTION")›POSITION(7,10)›PRINT("by David Plotkin")›Choice()›FOR lp=0 TO 11›DO xx=lp+9› DO Plot0(xx,8,0) xx==-1› IF xx<1 THEN EXIT FI› Plot0(xx,8,hello(lp))› SOUND(0,xx LSH 3,10,4)› time=0 DO UNTIL time=1 OD› OD›OD SOUND(0,0,0,0) PUT(125)›RETURN››PROC EndGame()›;the game over routines›BYTE time=20,lp,trig=644,xx,yy›BYTE ARRAY gameover(0)=[39 97 109 101›0 47 118 101 114]›PUT(125) SOUND(1,0,0,0)›FOR lp=0 TO 8›DO Plot0(lp+7,12,gameover(lp)) OD›IF Score>=Target THEN POSITION(5,7)› PRINT("You met your çïáì!!!")›FI Updatescore()›time=0›DO SOUND(0,time,10,8)UNTIL time=60 OD›SOUND(0,0,0,0) Choice() Level=0›FOR lp=0 TO 8›DO xx=lp+7 yy=12› DO Plot0(xx,yy,0) xx==+1 yy==-1› IF (xx>39 or yy<1) THEN EXIT FI› Plot0(xx,yy,gameover(lp))› SOUND(0,xx LSH 3,10,4)› time=0 DO UNTIL time=1 OD› OD›OD Score=0 NewLevel()›RETURN››PROC Movegun()›;Read joystick and move the gun›BYTE stick=632›Plot0(Gunx,Guny,0);erase the gun›IF stick=14 THEN;this is a stick up› Guny==-1 ELSEIF stick=13;stick down› THEN Guny==+1›FI›IF stick=7 THEN Ps=1 ELSEIF stick=11› THEN Ps=2;stick right(1) or left(2)›FI›IF Guny<1 THEN Guny=1 ELSEIF;out of› Guny>21 THEN Guny=21; Bounds›FI›Plot0(Gunx,Guny,Ps);redraw the gun›RETURN››PROC Testcol(BYTE wh)›;see if bullet wh hit anything›BYTE qq›qq=Shoty(wh)›IF Shotstatus(wh)=1 THEN› IF EndR(qq)<=Shotx(wh) THEN› Plot0(Shotx(wh),Shoty(wh),0)› Shotstatus(wh)=0› EndR(qq)==+1 Loud=6 Score==+2› FI ELSE› IF EndL(qq)>=Shotx(wh) THEN› Plot0(Shotx(wh),Shoty(wh),0)› Shotstatus(wh)=0› EndL(qq)==-1 Loud=6 Score==+2› FI›FI›IF Score>Ll(Level) THEN NewLevel() FI›RETURN››PROC Shoot()›;check the tigger and fire if pushed›BYTE trig=644,lp›IF trig=1 THEN RETURN FI›FOR lp=0 to 29;find an empty shot›DO› IF Shotstatus(lp)=0 THEN;got one› IF Ps=1 THEN;gun facing right› Shotstatus(lp)=1› Shotx(lp)=Gunx+1 ELSE› Shotstatus(lp)=2› Shotx(lp)=Gunx-1› FI Shoty(lp)=Guny› Plot0(Shotx(lp),Shoty(lp),84)› Testcol(lp) EXIT› FI›OD›RETURN››PROC MoveShots()›;move the fired bullets›BYTE lp›FOR lp=0 TO 29;for each shot›DO› IF Shotstatus(lp)=1 THEN;going right› Plot0(Shotx(lp),Shoty(lp),0)› Shotx(lp)==+1› IF Shotx(lp)=39 THEN› Shotstatus(lp)=0 ELSE› Plot0(Shotx(lp),Shoty(lp),84)› Testcol(lp)› FI› FI› IF Shotstatus(lp)=2 THEN;going left› Plot0(Shotx(lp),Shoty(lp),0)› Shotx(lp)==-1› IF Shotx(lp)=0 THEN› Shotstatus(lp)=0 ELSE› Plot0(Shotx(lp),Shoty(lp),84)› Testcol(lp)› FI› FI›OD›RETURN››PROC GrowWalls()›;grow squares from both sides›BYTE lvl,lp,dum,y›BYTE ARRAY lmore(24),rmore(24)›FOR lp=0 TO 23›DO lmore(lp)=0 rmore(lp)=0 OD›IF Level>10 THEN› lvl=10 ELSE lvl=Level›FI›FOR lp=1 to lvl+Hard›DO›IF Fate>210-lvl LSH 2 THEN;grow› dum=RAND(8)+3 y=RAND(21)+1› IF Fate>128 AND EndR(y)>20 AND› rmore(y)=0 THEN rmore(y)=1› EndR(y)==-1 Plot0(EndR(y),y,dum)› ELSEIF EndL(y)<18 AND› lmore(y)=0 THEN lmore(y)=1› EndL(y)==+1 Plot0(EndL(y),y,dum)› FI›FI›OD›FOR lp=1 to 22›DO IF EndL(lp)=18 AND EndR(lp)=20› THEN EndGame() EXIT FI›OD›IF Score>=Target THEN EndGame() FI›RETURN››PROC Main()›BYTE time=20›Gr0Init() Intro()›Download()›Modify() UpdateScore()›DO Movegun() GrowWalls()›Shoot() MoveShots() Noise()›time=0 POSITION(8,23) PRINTC(Score)›DO UNTIL time=Dly OD OD›RETURN››