feat: add support for abstract
This commit is contained in:
parent
084d31a13c
commit
303bee4e37
3 changed files with 12 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
local FighterAbstract = Object:extend()
|
||||
|
||||
function FighterAbstract:initAbstract()
|
||||
self.abstract = self:getAbstract()
|
||||
end
|
||||
|
||||
return FighterAbstract
|
|
@ -20,6 +20,10 @@ function Player:new(world, x, y, z, id)
|
|||
self:initTeam()
|
||||
end
|
||||
|
||||
function Player:getAbstract()
|
||||
return game.characters.list[game.characters:getActiveCharacter()]
|
||||
end
|
||||
|
||||
function Player:updateStart(dt)
|
||||
self:applyInputs()
|
||||
end
|
||||
|
|
|
@ -31,6 +31,7 @@ end
|
|||
|
||||
function SpritedPlayer:updateCurrentCharset()
|
||||
self.charName = game.characters:getActiveCharacter()
|
||||
self:initAbstract()
|
||||
self:changeSprite(self.charName)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue