procedure TForm1.FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
if ((MannY >= 0)
and (Key=Ord('
W')))
then
begin
dec(mannY,7);
Refresh;
Canvas.Rectangle(MannX,MannY,MannX + 50,MannY+50);
Canvas.Rectangle(JagdX,JagdY,JagdX+50,JagdY+50);
end;
if ((Key=Ord('
S'))
and (MannY+50 < form1.ClientHeight))
then
begin
inc(MannY,7);
Refresh;
Canvas.Rectangle(MannX,MannY,MannX + 50,MannY+50);
Canvas.Rectangle(JagdX,JagdY,JagdX+50,JagdY+50);
end;
if ((Key=Ord('
A'))
and (MannX >= 0))
then
begin
Dec(MannX,7);
Refresh;
Canvas.Rectangle(MannX,MannY,MannX + 50,MannY+50);
Canvas.Rectangle(JagdX,JagdY,JagdX+50,JagdY+50);
end;
if ((Key=Ord('
D'))
and (MannX+50 < form1.ClientWidth))
then
begin
inc(MannX,7);
Refresh;
Canvas.Rectangle(MannX,MannY,MannX + 50,MannY+50);
Canvas.Rectangle(JagdX,JagdY,JagdX+50,JagdY+50);
end;
end;