››; ********* WIPEOUT ********** › ›;by Gary Lee Evans›; October 30,1983››MODULE› ›BYTE level,sx,sy,dx,dy,cnt,vol›BYTE x,y,z,flag,miss›BYTE cursor=752,attract=77›CARD score,high,delay,tempo››BYTE FUNC Hstick(BYTE n)› IF (Stick(n)&8)=0 THEN RETURN (1) FI› IF (Stick(n)&4)=0 THEN RETURN (255) FI›RETURN (0)››BYTE FUNC Vstick(BYTE n)› IF (Stick(n)&2)=0 THEN RETURN (1) FI› IF (Stick(n)&1)=0 THEN RETURN (255) FI›RETURN (0)›››PROC game()›››high=0 ; Zero high score once›DO ; indefinite loop› ; initialize variables› level=1:score=0:sx=1:sy=0:miss=0:tempo=4000› attract=0› DO›› ;Setup Screen› Graphics(5)› Setcolor(2,8,2)› Setcolor(0,12,6)› cursor=1:tempo=800-(level*5)› cnt=0› Print("}Score:"):PrintC(score)› Print("High:"):PrintCE(high)› PrintE("|Wipeout|")› Print("Level:"):PrintB(level)› Print(" Men:"):PrintB(2-miss)› color=3› Plot(0,0):Drawto(79,0) › Drawto(79,39):Drawto(0,39)› Drawto(0,0)› color=3›› ; Plot obstacles› FOR z=1 TO (level+2)*((3-miss)*2)› DO› dx=Rand(77)+1:dy=Rand(37)+1› Plot(dx,dy)› OD› color=1›› ; Plot goals› FOR z=1 TO level+2› DO› dx=Rand(77)+1:dy=Rand(37)+1› Plot(dx,dy)› OD› FOR delay=1 TO 20000 DO OD› › ;Get your starting position› DO› x=Rand(77)+1:y=Rand(37)+1› z=Locate(x,y)› UNTIL z=0 › OD› color=2:Plot(x,y)›› ; Give you time to find yourself› FOR delay=1 TO 600› DO› FOR vol=0 TO 15› DO› Setcolor(1,vol,vol)› SOUND(0,vol*5,10,6)› OD› OD› Setcolor(1,10,12)››› ;Main game loop›› DO› color=2› Plot(x,y)› dx=Hstick(0)› IF dx<>0 THEN sx=dx:sy=0 FI› dy=Vstick(0)› IF dy<>0 THEN sy=dy:sx=0 FI› x=x+sx:y=y+sy› dx=Locate(x,y)› FOR vol=1 TO 14 STEP 2› DO› Sound(0,vol*10,8,6)› FOR delay=1 TO tempo DO OD› OD› Sndrst()› IF dx=0 THEN› Color=2:Plot(x,y)› FI›› ; Did you hit a goal?› IF dx=1 THEN› cnt==+1› color=2:Plot(x,y)› score==+(level*4) › FOR vol=0 to 15 › DO› Sound(0,50,10,15-vol)› FOR delay=0 to 100 DO OD› OD› Print("}Score:"):PrintC(score)› Print("High:"):PrintCE(high)› PrintE("|Wipeout|")› Print("Level:"):PrintB(level)› Print(" Men:"):PrintB(2-miss)› FI›› ; Did you hit an obstacle?› IF dx=2 OR dx=3 THEN› FOR vol=0 TO 15 DO› Setcolor(1,4,15-vol)› Sound(0,23,0,15-vol)› FOR delay=0 TO 2000 DO OD› OD› flag=1› EXIT› FI›› ; Repeat until all goals are wiped out› ; or until you've used three men› UNTIL cnt=level+2› OD› IF flag THEN level==-1 › flag=0› miss==+1› IF miss=3 THEN EXIT FI› FI› level==+1› OD›› ; Display score and new high score› ; if there was one.› Graphics(18) › IF score>high THEN› high=score› PrintDE(6," YOU HAVE THE NEW")› PRINTDE(6," HIGH SCORE!!")› PRINTDE(6,"")› FI› PrintD(6,"your score was: ")› PrintCDE(6,score)› PrintD(6," last level: ")› PrintBDE(6,level+1)› PrintDE(6,"")› PrintDE(6," TO PLAY AGAIN")› PrintDE(6," PRESS TRIGGER")› WHILE Strig(0)<>0 DO OD›OD›RETURN››