fix: dont walk when sliding
This commit is contained in:
parent
28ca276bf5
commit
15bc5ae874
1 changed files with 11 additions and 1 deletions
|
@ -1,8 +1,9 @@
|
|||
local PlayerCharset = Object:extend()
|
||||
|
||||
local ACTIONS_LARGEANIM = {"jump"}
|
||||
local ACTIONS_LARGEANIM = {"jump", "jumpdash"}
|
||||
local ACTIONS_ISFAST = {"jump", "fly", "run", "jumpdash"}
|
||||
local ACTIONS_ALWAYSWALK = {"fly"}
|
||||
local ACTIONS_DONTWALK = {"slide"}
|
||||
|
||||
function PlayerCharset:initPlayerCharset()
|
||||
self.scissorSprite = true
|
||||
|
@ -14,6 +15,7 @@ function PlayerCharset:updateCurrentCharset()
|
|||
self.isFast = self:getIsFast()
|
||||
self.largeAnim = self:getLargeAnim()
|
||||
self.alwaysWalk = self:getAlwaysWalk()
|
||||
self.cantWalk = self:getDontWalk()
|
||||
end
|
||||
|
||||
function PlayerCharset:getCharset()
|
||||
|
@ -40,4 +42,12 @@ function PlayerCharset:getAlwaysWalk()
|
|||
return utils.table.contain(ACTIONS_ALWAYSWALK, self.currentAction)
|
||||
end
|
||||
|
||||
function PlayerCharset:getDontWalk()
|
||||
if (self.forceAction ~= nil) then
|
||||
return utils.table.contain(ACTIONS_DONTWALK, self.forceAction)
|
||||
else
|
||||
return utils.table.contain(ACTIONS_DONTWALK, self.currentAction)
|
||||
end
|
||||
end
|
||||
|
||||
return PlayerCharset
|
||||
|
|
Loading…
Reference in a new issue