Hallo,
ich bin gerade dabei Pacman zu programmieren und verzweifele gerade an folgenem Problem:
Ich habe eine Shape welche ein Coin sein soll, der eingesammelt wird.
Damit ich nicht unnütz viel Speicher verschwende, soll auf dem ganzen Projekt verteilt der coin sein. der Coin muss also verdoppelt werden, darf dabei aber nicht den Namen verändern.
D.H: Ich will dass der Coin verdoppelt wird an eine bestimmte position.
Ich habe folgendes geschrieben:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| a1,b1,cx1,cy1: integer; y: Real; procedure TForm1.Timer1Timer(Sender: TObject); begin a1:=bild1.left+33; b1:=bild1.top+33; cx1:=coin.left+12; cy1:=coin.top+12; if ((coin.Left>bild1.Left) and (coin.Left<a1) and (coin.Top > bild1.Top) and (coin.Top < b1) and (coin.Visible=true)) or ((cx1>bild1.Left) and (cx1<a1) and (cy1 > bild1.Top) and (cy1 < b1) and (coin.Visible=true)) then
begin coin.Visible:=false; y:=y+17; end; |
Mit freundlichen Grüßen
funst3r
Moderiert von Martok: Code- durch Delphi-Tags ersetzt