improvement(player): some physics adjusting
This commit is contained in:
parent
a69a23a177
commit
72d638d163
1 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ local Player = Parent:extend()
|
||||||
|
|
||||||
function Player:new(world, x, y, z, id)
|
function Player:new(world, x, y, z, id)
|
||||||
Player.super.new(self, world, "player", x, y, 0, 16, 12, 24, true)
|
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:setSprite("sonic", 8, 10)
|
||||||
self:cloneSprite()
|
self:cloneSprite()
|
||||||
|
@ -18,20 +18,20 @@ function Player:updateStart(dt)
|
||||||
self.xfrc, self.yfrc = 480*3, 480*3
|
self.xfrc, self.yfrc = 480*3, 480*3
|
||||||
|
|
||||||
if self.keys["up"].isDown then
|
if self.keys["up"].isDown then
|
||||||
self.ysp = -120
|
self.ysp = -160
|
||||||
end
|
end
|
||||||
if self.keys["down"].isDown then
|
if self.keys["down"].isDown then
|
||||||
self.ysp = 120
|
self.ysp = 160
|
||||||
end
|
end
|
||||||
if self.keys["left"].isDown then
|
if self.keys["left"].isDown then
|
||||||
self.xsp = -120
|
self.xsp = -160
|
||||||
end
|
end
|
||||||
if self.keys["right"].isDown then
|
if self.keys["right"].isDown then
|
||||||
self.xsp = 120
|
self.xsp = 160
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.keys["A"].isDown and (self.onGround) then
|
if self.keys["A"].isDown and (self.onGround) then
|
||||||
self.zsp = 280
|
self.zsp = 280*1.33
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue