From dfc71eaebdc5b156329aca7c5c51885593f315ce Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 5 May 2019 19:45:57 +0200 Subject: [PATCH] module/world: add a function to destroy actor --- gamecore/modules/world/actors/actor2D.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index 27685f9..c58f759 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -82,6 +82,10 @@ function Actor2D:setBounceFactor(newBounceFactor) self.bounceFactor = newBounceFactor or 0 end +function Actor2D:destroy() + self.world:removeActor(self) +end + -- INPUT FUNCTIONS -- get input from the world object