From e6f0315a8c07031bf2b344496aa8cb0910d1cf5b Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 7 Sep 2019 20:53:22 +0200 Subject: [PATCH] feat(actors): listen to animationEnded callback from sprite clones Fixes #38 --- gamecore/modules/world/actors/baseactor.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gamecore/modules/world/actors/baseactor.lua b/gamecore/modules/world/actors/baseactor.lua index 190747a..4033f0b 100644 --- a/gamecore/modules/world/actors/baseactor.lua +++ b/gamecore/modules/world/actors/baseactor.lua @@ -378,6 +378,7 @@ end function BaseActor:cloneSprite() if self.sprite.name ~= nil then self.sprite.clone = self.assets.sprites[self.sprite.name]:clone() + self.sprite.clone:setCallbackTarget(self) end end @@ -389,6 +390,10 @@ function BaseActor:changeAnimation(animation, restart) end end +function BaseActor:animationEnded(animation) + -- Empty placeholder function +end + function BaseActor:setCustomSpeed(customSpeed) if (self.sprite.clone == nil) then self.assets.sprites[self.sprite.name]:setCustomSpeed(customSpeed)