diff --git a/sonic-radiance.love/game/modules/subgames/world/actors/fighters/mixins/abstract.lua b/sonic-radiance.love/game/modules/subgames/world/actors/fighters/mixins/abstract.lua new file mode 100644 index 0000000..92c0f91 --- /dev/null +++ b/sonic-radiance.love/game/modules/subgames/world/actors/fighters/mixins/abstract.lua @@ -0,0 +1,7 @@ +local FighterAbstract = Object:extend() + +function FighterAbstract:initAbstract() + self.abstract = self:getAbstract() +end + +return FighterAbstract \ No newline at end of file diff --git a/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/init.lua b/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/init.lua index 9c10773..55e629c 100644 --- a/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/init.lua +++ b/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/init.lua @@ -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 diff --git a/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/sprites.lua b/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/sprites.lua index 41724e7..bc6ab0d 100644 --- a/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/sprites.lua +++ b/sonic-radiance.love/game/modules/subgames/world/actors/fighters/player/sprites.lua @@ -31,6 +31,7 @@ end function SpritedPlayer:updateCurrentCharset() self.charName = game.characters:getActiveCharacter() + self:initAbstract() self:changeSprite(self.charName) end