Const
DiagnoalWalking = 1 // 1- Ativar diagonal e 0- desativar.
procedure Event_KeyDown(Key:integer);
begin
Updateworld;
case Key of
87:Self.MoveUp; //W
65:Self.MoveLeft; //A
83:self.MoveDown; //S
68:Self.MoveRight; //D
end;
if DiagnoalWalking then
Case Key of
81:Self.MoveUpLeft; //Q
69:Self.MoveUpRight; //E
90:Self.MoveDownLeft; //Z
67:Self.MoveDownRight; //C
end;
end;
while not terminated do
begin
ProcessEvents;
Sleep(100);
end;
DiagnoalWalking = 1 // 1- Ativar diagonal e 0- desativar.
procedure Event_KeyDown(Key:integer);
begin
Updateworld;
case Key of
87:Self.MoveUp; //W
65:Self.MoveLeft; //A
83:self.MoveDown; //S
68:Self.MoveRight; //D
end;
if DiagnoalWalking then
Case Key of
81:Self.MoveUpLeft; //Q
69:Self.MoveUpRight; //E
90:Self.MoveDownLeft; //Z
67:Self.MoveDownRight; //C
end;
end;
while not terminated do
begin
ProcessEvents;
Sleep(100);
end;