Einzelnen Beitrag anzeigen

Bjoerk

Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
 
Delphi 10.4 Sydney
 
#16

AW: Tetris mit Canvas funktioniert nicht wie es soll

  Alt 16. Feb 2013, 16:28
Achso. Verstehe. Probier' mal so (ungetestet):

Delphi-Quellcode:
function THaupt.CanMoveLast(const deltaX, deltaY: integer): boolean;
var
  N, I, J: integer;
begin
  Result := true;
  N := High(Block);
  for I := 0 to N - 4 do
    for J := 0 to 3 do
      if (Block[N - J].X + deltaX = Block[I].X)
        and (Block[N - J].Y + deltaY = Block[I].Y) then
          Result := false;
end;
  Mit Zitat antworten Zitat