3rd color,

cleaning
This commit is contained in:
lustlion
2021-10-29 02:17:18 +02:00
parent 538a1f77f8
commit 189579d619
55 changed files with 158 additions and 13 deletions

View File

@@ -11,7 +11,7 @@
x = 0,
y = 0
}
-- constants
o.acc = 45
o.friction = 20
@@ -22,7 +22,7 @@
o.jumpMaxSpeed = 9.5
o.zeroSpeed = 0.001
o.lightRange = 20
-- status
o.isJumping = false
o.isOnGround = 0
@@ -35,11 +35,10 @@
-- sprite
o.sprite_offset = {x = 8, y = 16}
o.target_offset = {x = 0, y = 12}
-- lights
o.light = CreateLight(o.pos.x,o.pos.y,o.lightRange)
setmetatable(o, self)
self.__index = self
@@ -86,10 +85,7 @@ function Player:Smart()
end
function Player:HandleAnimation()
-- move light to position, :D
self.light.pos.x = self.pos.x - self.target_offset.x
self.light.pos.y = self.pos.y - self.target_offset.y
-- flip sprite to look in the direction is moving
if self.vel.x ~= 0 then self.sprite_flip.x = math.sign(self.vel.x) end