diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index 3cf95bd..9c36ef7 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -99,6 +99,7 @@ end function Actor2D:update(dt) self:autoMove(dt) + self:updateSprite(dt) end -- MOVEMENT FUNCTIONS @@ -245,6 +246,22 @@ function Actor2D:cloneSprite() end end +function Actor2D:changeAnimation(animation, restart) + if (self.sprite.clone == nil) then + self.assets.sprites[self.sprite.name]:changeAnimation(animation, restart) + else + self.sprite.clone:changeAnimation(animation, restart) + end +end + +function Actor2D:setCustomSpeed(customSpeed) + if (self.sprite.clone == nil) then + self.assets.sprites[self.sprite.name]:setCustomSpeed(customSpeed) + else + self.sprite.clone:setCustomSpeed(customSpeed) + end +end + function Actor2D:updateSprite(dt) if (self.sprite.clone ~= nil) then self.sprite.clone:update(dt)