feat: add support for abstract

This commit is contained in:
Kazhnuz 2022-05-20 18:25:07 +02:00
parent 084d31a13c
commit 303bee4e37
3 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,7 @@
local FighterAbstract = Object:extend()
function FighterAbstract:initAbstract()
self.abstract = self:getAbstract()
end
return FighterAbstract

View file

@ -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

View file

@ -31,6 +31,7 @@ end
function SpritedPlayer:updateCurrentCharset()
self.charName = game.characters:getActiveCharacter()
self:initAbstract()
self:changeSprite(self.charName)
end