If Xbios(4)<>0 Then Alert 3," | This GFA Game Demo|is intended for LOW| Resolution.",1,"Rats!",Dummy% End Endif If Exist("SWEEPER.CL1") Open "I",#1,"SWEEPER.CL1" Else Alert 3," |SWEEPER.CL1 not found| | Abort run",1,"Rats!",Dummy% End Endif ' ********** First load the picture clip of the dialog Input #1,Clip_len,Colr_len,Clip_width,Clip_hite,Rez_pic Pic$=String$(Clip_len,0) Colr$=String$(Colr_len,0) Bget #1,Varptr(Colr$),Colr_len Bget #1,Varptr(Pic$),Clip_len Close #1 Void Xbios(6,L:Varptr(Colr$)) ' ********** Now initialize variables and dimension the Sq array Bx%=245 By%=10 Dim Sq(259) Arrayfill Sq(),0 ' ********** Read the data describing out target squares For J=1 To 15 Read D Read C Sq(C)=D Next J Cls ' ********** Show the Box Put Bx%,By%,Pic$ Dim A(11,17) L=1 S=0 M=0 Lay_mines: Deffill 4,2,20 Pbox 0,16,240,176 For X=1 To 10 For Y=1 To 15 K=Int(Rnd*25)+1-L A(X,Y)=46 If K=1 Then A(X,Y)=64 Endif Next Y A(X,10)=46 Next X C=5 B=1 A(C,B)=33 Goto Ln500 Show_minefield: For X=1 To 10 For Y=1 To 15 If A(X,Y)=46 Then Goto No_change Endif If A(X,Y)=32 Then Deffill 4,2,1 Endif If A(X,Y)=49 Then Deffill 2,1,1 Endif If A(X,Y)=48 Then Deffill 1,1,1 Endif If A(X,Y)=64 Then Goto No_change Endif Pbox Y*16-16,X*16,Y*16,X*16+16 No_change: Next Y Next X A(C,B)=32 Move_sweeper: Mainloop: Repeat Until Mousek<>0 @Sample_mouse If Sq(P)=0 Then Goto Mainloop Endif C1=0 B1=0 Pause 20 If Sq(P)=8 Then C1=-1 Endif If Sq(P)=5 Then C1=1 Endif If Sq(P)=6 Then B1=1 Endif If Sq(P)=7 Then B1=-1 Endif If Sq(P)=1 Then Alert 1," |Thanks for playing| | MINE SWEEPER!",1,"BYE",Dummy End Endif If Sq(P)=2 Then Alert 3," -HELP-|Move your black marker| across deadly waters.|Avoid the hidden mines!",1,"MORE",Dummy Alert 3," -HELP-| Your marker turns RED|if your within 1 square| of a hidden mine!",1,"continue",Dummy Endif If Sq(P)=3 Then Alert 3," -INFO-| Compiled GFA BASIC| by GFA Systemtechnik|distributed by MichTron,Inc.",1,"Continue",Dummy Endif If Sq(P)=9 Then Sound 1,10,1,1,40 Sound 1,0,0,0,0 Goto Mainloop Endif If C+C1>10 Or C+C1<1 Then Goto Move_sweeper Endif If B+B1>15 Then Goto Ln600 Endif C=C+C1 B=B+B1 If A(C,B)=64 Then Goto Splat Endif Ln500: N=0 For K=-1 To 1 For D=-1 To 1 If A(C+K,B+D)=64 Then N=N+1 Endif Next D Next K A(C,B)=48+N M=M+1 Goto Show_minefield Ln600: L=L+1 L$=Str$(L) M$=Str$(M) S=S+100-M Sc$=Str$(S) M=0 For X=1 To 10 For Y=1 To 15 If A(X,Y)=64 Then Deffill 2,2,22 Pbox Y*16-16,X*16,Y*16,X*16+16 Endif Next Y Next X Pause 100 Alert 3," CONGRATULATIONS!|It took "+M$+" moves.|Your Score is "+Sc$+"| On to level "+L$+"?",1," YES |QUIT",Ans If Ans=2 Then End Endif Goto Lay_mines Splat: Splat1$=" | You hit a mine!" Splat2$="The game is over." Sc$=Str$(S+L*10-M) Splat3$="Your Score was "+Sc$ For X=1 To 10 For Y=1 To 15 If A(X,Y)=64 Then Deffill 2,2,22 Pbox Y*16-16,X*16,Y*16,X*16+16 Endif Next Y Next X Pause 100 Alert 3,Splat1$+"|"+Splat2$+"|"+Splat3$,1,"BYE",Dummy End ' ************ Now the data which describes the dialog Data 1,216,1,217,1,218 Data 2,196,2,197,2,198 Data 3,176,3,177,3,178 Data 4,21 Data 5,137 Data 6,118 Data 7,116 Data 8,97 Data 9,117 ' ************* Here we check mouse are convert it to (P) Procedure Sample_mouse Mouse Mox,Moy,Dumb_key Xpos=Int(Mox/16) Ypos=Int(Moy/16) P=((Ypos*17)+(Ypos*3))+Xpos Return