Forum: Sonstige Fragen zu Delphi
Delphi
by Angel4585,
16. Mär 2007
ach.. ist mir garnich aufgefallen :shock:
er überprüft ja auch nur rechts und unten, ich denke links und oben ist klar, weil man da nicht noch zusätzlich was rechnen muss.
Forum: Sonstige Fragen zu Delphi
Delphi
by Angel4585,
16. Mär 2007
ich hatte mal sowas ähnliches, sollte so in etwa funktionieren:
if (Maus.Left+Maus.Width) > Spielfeld.ClientWidth then
Maus.Left := Spielfeld.ClientWidth - Maus.Width;
If (Katze.Left+Katze.Width) > Spielfeld.ClientWidth then
Katze.Left := Spielfeld.ClientWidth-Katze.Width;
If (Maus.Top+Maus.Height) > Spielfeld.ClientHeight then
Maus.Top := Spielfeld.ClientHeight - Maus.Height;