improvement(player): some physics adjusting

This commit is contained in:
Kazhnuz 2019-07-27 23:52:15 +02:00
parent a69a23a177
commit 72d638d163

View file

@ -4,7 +4,7 @@ local Player = Parent:extend()
function Player:new(world, x, y, z, id)
Player.super.new(self, world, "player", x, y, 0, 16, 12, 24, true)
self:setGravity(480)
self:setGravity(480*2)
self:setSprite("sonic", 8, 10)
self:cloneSprite()
@ -18,20 +18,20 @@ function Player:updateStart(dt)
self.xfrc, self.yfrc = 480*3, 480*3
if self.keys["up"].isDown then
self.ysp = -120
self.ysp = -160
end
if self.keys["down"].isDown then
self.ysp = 120
self.ysp = 160
end
if self.keys["left"].isDown then
self.xsp = -120
self.xsp = -160
end
if self.keys["right"].isDown then
self.xsp = 120
self.xsp = 160
end
if self.keys["A"].isDown and (self.onGround) then
self.zsp = 280
self.zsp = 280*1.33
end
end