From 7cc7ec207d108daa83e9103d2c0fec9b9b45bff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Sun, 19 Oct 2014 04:48:59 +0300 Subject: [PATCH] Animation: remove once the animation is complete --- entities/animation.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entities/animation.lua b/entities/animation.lua index 38f18c6..9ffaa8f 100644 --- a/entities/animation.lua +++ b/entities/animation.lua @@ -41,5 +41,8 @@ Animation = Class{ update = function(self, dt) self.curFrame = self.curFrame + dt * self.frames.fps + if self.curFrame >= self.frames.numFrames then + self:delete() + end end; }