examples/moveplayer: use isDown instead of isPressed on player item

This commit is contained in:
Kazhnuz 2019-04-07 22:53:59 +02:00
parent 18161313fe
commit a4aaa28c24
1 changed files with 4 additions and 4 deletions

View File

@ -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