AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Lageranimation mit einem Stapler als TBitmap
Thema durchsuchen
Ansicht
Themen-Optionen

Lageranimation mit einem Stapler als TBitmap

Ein Thema von DrDelphi · begonnen am 2. Jun 2009 · letzter Beitrag vom 2. Jun 2009
 
DrDelphi

Registriert seit: 2. Jun 2009
4 Beiträge
 
#1

Lageranimation mit einem Stapler als TBitmap

  Alt 2. Jun 2009, 11:41
Servus und schöne Grüße an alle!
Mein Kollege und ich haben zurzeit folgendes Problem.
Wir lassen per rectangle ein Lagerzeichnen und ihn mit per Zufallsgenerator mit Werten füllen.
Anschließend wird per Buttonklick ein Timer aktiviert der immer wieder ein TBitmap zeichnen und wieder löscht.
Diese ist unser Stapler. Das bekommen wir so weit auch hin aber wir haben das Problem das er nur im Kreis fährt und nicht per
Zufallsgenerator die Gänge abfährt und per Zufall einlädt.

Kann uns jemand helfen?

Delphi-Quellcode:
    Procedure Gang1;
           begin
            if (xakt<=640) and (yakt=35) then
          xAkt:=xAkt+5; // 1 Gang

          if (xakt=645) and (yakt<=320) then
           YAkt:=Yakt+5 ; // 1 Gang abwärts
        end;


        Procedure Gang2;
           Begin
              if (xakt<=645)and (yakt=125) then
       xAkt:=xAkt-5; // 2Gang linksherum

     if (xakt=5)and (yakt<=125) then
       yAkt:=yAkt-5; //2Gang aufwärts


        end;

    Procedure Gang3;
   begin
    if (xakt<=645)and (yakt=220) then
       xAkt:=xAkt-5; // 3Gang linksherum

     if (xakt=5)and (yakt<=220) then
       yAkt:=yAkt-5; //3Gang aufwärts
end ;

Procedure Gang4;
      Begin
      if (xakt<=645) and (yakt=320) then
                                                //4Gang linksherum
    xAkt:=xAkt-5;

    if (xakt=5) and (yakt<=320) then
  YAkt:=Yakt-5 ; //4Gang aufwärts


end;


Procedure zufaellig;
var
zufall:integer;

Begin
randomize;

zufall:=random(3) ;
zufall:=zufall+1;

if zufall=1 then
gang1;
if zufall=2 then
gang2;
if zufall=3 then
gang3;
if zufall=4 then
gang4;
End;

procedure TForm1.Timer1Timer(Sender: TObject);

begin
zufaellig;
if True then

Image1.Canvas.Draw(xAkt,yAkt,Stapler);
Timer2.Enabled:=True;

end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
  xAkt:=xAkt;
 Image1.Canvas.Draw(xAkt,yAkt,Staplerloeschen);

end;
[edit=mkinzler]Delphi-Tag gefixt Mfg, mkinzler[/edit]
  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 18:26 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 by Thomas Breitkreuz