-- -- Play the animation by pressing a key. -- -- -- @author FIAT80-90DT -- @date 26.05.2011 -- -- Anim = {}; function Anim.prerequisitesPresent(specializations) return true; end; function Anim:load(xmlFile) self.AnimLeftDone = true; self.AnimRightDone = true; end; function Anim:delete() end; function Anim:mouseEvent(posX, posY, isDown, isUp, button) end; function Anim:keyEvent(unicode, sym, modifier, isDown) end; function Anim:update(dt) if self:getIsActiveForInput() then -- Are the animationīs still active? if self:getRealAnimationTime("SA_LEFT") == self:getAnimationDuration("SA_LEFT") or self:getRealAnimationTime("SA_LEFT") == 0 then self.AnimLeftDone = true; else self.AnimLeftDone = false; end; if self:getRealAnimationTime("SA_RIGHT") == self:getAnimationDuration("SA_RIGHT") or self:getRealAnimationTime("SA_RIGHT") == 0 then self.AnimRightDone = true; else self.AnimRightDone = false; end; --Play animations if InputBinding.hasEvent(InputBinding.SA_LEFT) and self.AnimLeftDone then if self:getRealAnimationTime("SA_LEFT") > self:getAnimationDuration("SA_LEFT")/2 then self:playAnimation("SA_LEFT", -1, nil); else self:playAnimation("SA_LEFT", 1, nil); end; end; if InputBinding.hasEvent(InputBinding.SA_RIGHT) and self.AnimRightDone then if self:getRealAnimationTime("SA_RIGHT") > self:getAnimationDuration("SA_RIGHT")/2 then self:playAnimation("SA_RIGHT", -1, nil); else self:playAnimation("SA_RIGHT", 1, nil); end; end; end; end; function Anim:draw() end;