1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51:
| procedure VisibleStein(px,py:Integer); var x,y,OldType:Integer; Raus,R1,R2,R3,R4:Bool; begin Raus:=True; R1:=True; R2:=True; R3:=True; R4:=True; OldType:=Game.Karte[px,py].typ; repeat das geht for x:=px to MapX do begin if (Game.karte[x,py].Typ = OldType) and (R1 = True) then begin Game.karte[x,py].Typ:=None; Game.karte[x,py].Visible:=False; end else R1:=False; end; // das geht for x:=px-1 downto 0 do begin if (Game.karte[x,py].Typ = OldType) and (R2 = True) then begin Game.karte[x,py].Typ:=None; Game.karte[x,py].Visible:=False; end else R2:=False; end;
// das geht nicht for y:=py to MapY do begin if (Game.karte[px,y].Typ = OldType) and (R3 = True) then begin Game.karte[px,y].Typ:=None; Game.karte[px,y].Visible:=False; end else R3:=False; end; // das geht for y:=py-1 downto 0 do begin if (Game.karte[px,y].Typ = OldType) and (R4 = True) then begin Game.karte[px,y].Typ:=None; Game.karte[px,y].Visible:=False; end else R4:=False; end;
// und das geht auch Raus:=R1 and R2 and R3 and R4; until Raus = False; end; |