examples/moveplayer: use isDown instead of isPressed on player item
This commit is contained in:
parent
18161313fe
commit
a4aaa28c24
1 changed files with 4 additions and 4 deletions
|
@ -8,16 +8,16 @@ end
|
|||
|
||||
function Player:update(dt)
|
||||
local dx, dy = 0, 0
|
||||
if self.keys["up"].isPressed then
|
||||
if self.keys["up"].isDown then
|
||||
dy = -120 * dt
|
||||
end
|
||||
if self.keys["down"].isPressed then
|
||||
if self.keys["down"].isDown then
|
||||
dy = 120 * dt
|
||||
end
|
||||
if self.keys["left"].isPressed then
|
||||
if self.keys["left"].isDown then
|
||||
dx = -120 * dt
|
||||
end
|
||||
if self.keys["right"].isPressed then
|
||||
if self.keys["right"].isDown then
|
||||
dx = 120 * dt
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue