From d5dec73e7e74134a0bd9cbcb22d8dd77f48e9fac Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 19 Jul 2021 12:12:45 +0200 Subject: [PATCH] fix: add setAnimSpeed to Parent entity in cbs --- sonic-radiance.love/scenes/battlesystem/actors/parent.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua index 2ecfa32..c6256cb 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua @@ -84,6 +84,14 @@ function Parent:changeAnimation(animation, restart) end end +function Parent:setAnimSpeed(speed) + if (self.sprite.clone == nil) then + self.assets.sprites[self.sprite.name]:setSpeedFactor(speed) + else + self.sprite.clone:setSpeedFactor(speed) + end +end + function Parent:animationEnded(animation) -- Empty placeholder function end