Einzelnen Beitrag anzeigen

htxmlx

Registriert seit: 23. Aug 2008
124 Beiträge
 
Delphi 7 Enterprise
 
#44

Re: Brettspiel-Mühle: Bugreport bitte!

  Alt 24. Dez 2008, 12:18
ich stell das mit einer if abfrage fest es wird geguckt ob 3 shapes die selbe top haben bzw left, außer die mittleren reihen, in denen 6 steine die selbe top oder left haben können, da gibts dan noch ne sonder regelung...Es könnte auch mit unsichtbaren Steinen zu tun haben, die zwar die position haben, jedoch nicht mehr zu sehen sind, weil sie entfernt wurden, das habe ich mal in Version 1.11 entgültig behoben, also wenn in der Version 1.11 nochmal solche Fehler auftauchen, dann kanns eg. nur noch an der if-abfrage liegen...hab die hier mal gepostet.


Stein is die nummer des gesetzen Steins
Delphi-Quellcode:
 for i := 28 to 36 do
    begin
    for s := 28 to 36 do
      begin
      steintop := TShape (FindComponent('Shape'+IntToStr(stein))).top;
      itop := TShape (FindComponent('Shape'+IntToStr(i))).top;
      stop := TShape (FindComponent('Shape'+IntToStr(s))).top;
      steinleft := TShape (FindComponent('Shape'+IntToStr(stein))).left;
      ileft := TShape (FindComponent('Shape'+IntToStr(i))).left;
      sleft := TShape (FindComponent('Shape'+IntToStr(s))).left;
      if (s <> i) and (i <> Stein) and (Stein <> s) and (steintop = itop) and (steintop = stop) and (stop = itop) and (steintop <> (Shape3.top)+(Shape3.Height div 2) - 33) or
      (s <> i) and (i <> Stein) and (Stein <> s) and (steinleft = ileft) and (steinleft = sleft) and (sleft = ileft) and (steinleft <> (Shape1.Left + Shape1.Width div 2) -31) or
      (s <> i) and (i <> Stein) and (Stein <> s) and (steintop = itop) and (steintop = stop) and (stop = itop) and (steinleft < (Shape1.Left + Shape1.Width div 2) -31) and (ileft < (Shape1.Left + Shape1.Width div 2) -31) and (sleft < (Shape1.Left + Shape1.Width div 2) -31) or
      (s <> i) and (i <> Stein) and (Stein <> s) and (steintop = itop) and (steintop = stop) and (stop = itop) and (steinleft > (Shape1.Left + Shape1.Width div 2) -31) and (sleft > (Shape1.Left + Shape1.Width div 2) -31) and (ileft > (Shape1.Left + Shape1.Width div 2) -31) or
      (s <> i) and (i <> Stein) and (Stein <> s) and (steinleft = ileft) and (steinleft = sleft) and (sleft = ileft) and (steintop < (Shape3.top)+(Shape3.Height div 2) - 33) and (itop < (Shape3.top)+(Shape3.Height div 2) - 33) and (stop < (Shape3.top)+(Shape3.Height div 2) - 33) or
      (s <> i) and (i <> Stein) and (Stein <> s) and (steinleft = ileft) and (steinleft = sleft) and (sleft = ileft) and (steintop > (Shape3.top)+(Shape3.Height div 2) - 33) and (itop > (Shape3.top)+(Shape3.Height div 2) - 33)and (stop > (Shape3.top)+(Shape3.Height div 2) - 33) then
        begin
        if warschon = false then
          begin
          spieler1wegnehmen := true;
          warschon := true;
          muleweis := true;
          TShape (FindComponent('Shape'+IntToStr(stein))).Brush.Color := clRed;
          TShape (FindComponent('Shape'+IntToStr(i))).Brush.Color := clRed;
          TShape (FindComponent('Shape'+IntToStr(s))).Brush.Color := clRed;


Gruß und eine paar schöne Weihnachtstage, htxmlx
  Mit Zitat antworten Zitat