Einzelnen Beitrag anzeigen

Bx3

Registriert seit: 25. Dez 2007
44 Beiträge
 
#4

Re: Fehlermeldung?? häh??

  Alt 31. Mär 2008, 18:17
also hier der quelltext, wenn da [...] steht is es eigtl unwichtig weil
ich an den stellen nur nen feld gefüllt habe:

Delphi-Quellcode:
type
  Spieler = record
    Name : String[20];
    SImage : byte;
    Guthaben : real;
    Stand : byte;
    gefae : byte;
    StrWel : array [0..28] of byte;
    StrHaeuser: array [0..28, 0..4] of byte;
    StrMiete : array [0..28, 0..5] of integer;
   end;

[...]

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1 : TForm1;
  Zaehler: array [0..28] of real;
  Spiela : array [0..4] of Spieler;
  k :byte;

implementation

{$R *.DFM}

[...]

procedure TForm1.FormCreate(Sender: TObject);
 var y,x:byte;
begin
 randomize;
 k:=random(4);
 y:=55;
 For x:=1 to 28 do
  Zaehler[x]:=1;
 For x:=1 to 4 do
  begin
   Spiela[x].stand:=2;
   Spiela[x].Simage:=y;
   inc(y);
  end;
 For x:=43 to 54 do
  (Findcomponent('Image'+intToStr(x))as TImage).visible:=false;
end;

[...]

procedure TForm1.BitBtn1Click(Sender: TObject);
 var i,x,y:byte;
begin
 If k = 5 then
  k:=1;
 For x:=43 to 54 do
  (Findcomponent('Image'+intToStr(x))as TImage).visible:=false;
 randomize;
 For i:=1 to 10 do
  begin
   x:=random(6)+43;
   y:=random(6)+49;
   (Findcomponent('Image'+intToStr(x))as TImage).visible:=true;
   (Findcomponent('Image'+intToStr(y))as TImage).visible:=true;
   sleep(100);
   Application.ProcessMessages;
   If i <> 10 then
    begin
     (Findcomponent('Image'+intToStr(x))as TImage).visible:=false;
     (Findcomponent('Image'+intToStr(y))as TImage).visible:=false;
    end;
  end;
                       
                          HIER KOMMT DER FEHLER IRGENDWO (also hier unten)
            
  If Spiela[k].stand = 99 then
   inc(Spiela[k].gefae);
  If (((Spiela[k].stand = 99) and ((x-42) = (y-48)))) or (Spiela[k].stand <> 99) or (Spiela[k].gefae = 4)then
   begin
    If Spiela[k].stand = 99 then
     begin
      Spiela[k].gefae:=0;
      Spiela[k].stand:=12;
     end;
    Spiela[k].stand:=(Spiela[k].stand+(x-42)+(y-48));
    If Spiela[k].stand = 42 then
     Spiela[k].stand:=2;
    If Spiela[k].stand > 41 then
     Spiela[k].stand:=(Spiela[k].stand-40);
    (Findcomponent('Image'+intToStr(Spiela[k].Simage))as TImage).top:=(Findcomponent('Image'+intToStr(Spiela[k].stand))as TImage).top;
    (Findcomponent('Image'+intToStr(Spiela[k].Simage))as TImage).left:=(Findcomponent('Image'+intToStr(Spiela[k].stand))as TImage).left;
    If Spiela[k].stand = 32 then
     begin
      Spiela[k].stand:=99;
      (Findcomponent('Image'+intToStr(Spiela[k].Simage))as TImage).top:=(Findcomponent('Image'+intToStr(Spiela[k].stand))as TImage).top;
      (Findcomponent('Image'+intToStr(Spiela[k].Simage))as TImage).left:=(Findcomponent('Image'+intToStr(Spiela[k].stand))as TImage).left;
     end;
   end;
 inc(k);
end;

end.
  Mit Zitat antworten Zitat