Autor Beitrag
brainkopf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP; Win 7
C# (VS 2005/2008)
BeitragVerfasst: Fr 28.12.07 19:02 
Hi,
ich bin gerade dabei ein kleines Rennspiel zu programmieren.
Allerdings habe ich wohl einen Fehler gemacht, da die if Anweisung nicht funktioniert.
Ich habe ein Auto, das durch einen Timer bewegt wird. Wenn die Autografik Left:=0 erreicht hat, soll es wieder auf Left:=640 springen. Das funktioniert aber nich.
ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm4.Image1Click(Sender: TObject);
begin
 if Image1.Left=0 then
Image1.Left:=640;
end;
Calculon
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 676

Win XP Professional
Delphi 7 PE, Delphi 3 PRO
BeitragVerfasst: Fr 28.12.07 19:08 
Vielleicht erreicht dein Image ja nie die Null. Kannste ja zur Laufzeit schnell überprüfen (form1.caption := inttostr(image1.left);)

Wie wär's mit: if Image1.Left <= 0 ...

Gruß

Calculon
--

_________________
Hallo Mutti
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 28.12.07 19:31 
Timer? Image1Click?
DrRzf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 260

Win XP Prof
D7 Enterprise
BeitragVerfasst: Fr 28.12.07 19:33 
Die abrfage steht im ImageClick.
Wenn dann musst du das auch in der Timerprocedure prüfen.

_________________
rein statistisch gesehen darf man keiner statistik trauen die man nicht selbst gefälscht hat.
brainkopf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP; Win 7
C# (VS 2005/2008)
BeitragVerfasst: Sa 29.12.07 13:13 
danke.
hat funktioniert.
Also ich hab das ganze in den Timer gemacht.