AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Tetris mit Canvas funktioniert nicht wie es soll
Thema durchsuchen
Ansicht
Themen-Optionen

Tetris mit Canvas funktioniert nicht wie es soll

Ein Thema von fox67 · begonnen am 13. Feb 2013 · letzter Beitrag vom 21. Mär 2013
 
fox67

Registriert seit: 6. Okt 2010
Ort: 72661 Grafenberg
181 Beiträge
 
Turbo Delphi für Win32
 
#13

AW: Tetris mit Canvas funktioniert nicht wie es soll

  Alt 16. Feb 2013, 11:22
Hallo
Es ist wieder ein Problem erschienn aber diesmal liegt es an mir ich erkenne den Felher nicht
Delphi-Quellcode:
procedure THaupt.Neufallen;
var
i :integer;
kannbewegen : boolean;
begin


  Form2.Spielfeld.Canvas.Brush.Color := clwhite;
  Form2.Spielfeld.Canvas.Brush.Style := bssolid;
  Form2.Spielfeld.Canvas.Rectangle(0,0,form2.Spielfeld.Width, form2.Spielfeld.Height);
  kannbewegen:= false;
  for i := 0 to high(Block) do
  begin

    if (i<>high(block)-3) and (i<>high(block)-2) and (i<>high(block)-1) and (i<>high(block)-0) then
    begin
    if not (Block[high(Block)-3].fPosition.y +1 = Block[i].fPosition.y) and (Block[high(Block)-3].fPosition.y +1 <>0) then
    begin
      if not (Block[high(Block)-2].fPosition.y +1 = Block[i].fPosition.y) and (Block[high(Block)-2].fPosition.y +1 <>0) then
      begin
        if not (Block[high(Block)-1].fPosition.y +1 = Block[i].fPosition.y) and (Block[high(Block)-1].fPosition.y +1 <>0) then
        begin
          if not (Block[high(Block)-0].fPosition.y +1 = Block[i].fPosition.y) and (Block[high(Block)-0].fPosition.y +1 <>0) then
          begin
            kannbewegen:= true;
          end;
        end;

      end;

    end;

    end;
  end;


  if kannbewegen then
  begin
  Block[high(Block)-3].fPosition.Y := Block[high(Block)-3].fPosition.Y +1 ;
  Block[high(Block)-2].fPosition.Y := Block[high(Block)-2].fPosition.Y +1 ;
  Block[high(Block)-1].fPosition.Y := Block[high(Block)-1].fPosition.Y +1 ;
  Block[high(Block)].fPosition.Y := Block[high(Block)].fPosition.Y +1 ;
  end;


  for i := 0 to high(Block) do
    begin
      Block[i].zeichen;
    end;
  if not kannbewegen then neu;
Die Blöcke fallen nicht sondern werden sofort neu erzeugt?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:44 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz