summaryrefslogtreecommitdiffhomepage
path: root/not/Player.lua
diff options
context:
space:
mode:
Diffstat (limited to 'not/Player.lua')
-rw-r--r--not/Player.lua14
1 files changed, 2 insertions, 12 deletions
diff --git a/not/Player.lua b/not/Player.lua
index b0dac75..6996c9d 100644
--- a/not/Player.lua
+++ b/not/Player.lua
@@ -38,20 +38,10 @@ function Player:update (dt)
-- Walking.
if self:isControlDown("left") then
- self.facing = -1
- self:applyForce(-250, 0)
- -- Controlled speed limit
- if x < -self.MAX_VELOCITY then
- self:applyForce(250, 0)
- end
+ self:walkLeft()
end
if self:isControlDown("right") then
- self.facing = 1
- self:applyForce(250, 0)
- -- Controlled speed limit
- if x > self.MAX_VELOCITY then
- self:applyForce(-250, 0)
- end
+ self:walkRight()
end
end