summaryrefslogtreecommitdiffhomepage
path: root/player.lua
diff options
context:
space:
mode:
Diffstat (limited to 'player.lua')
-rw-r--r--player.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/player.lua b/player.lua
index 7a6a035..f7595a1 100644
--- a/player.lua
+++ b/player.lua
@@ -74,6 +74,12 @@ function Player:new (game, world, x, y, name)
return o
end
+-- Destructor of `Player`
+function Player:delete()
+ -- body deletion is handled by world deletion
+ self.sprite = nil
+end
+
function Player:assignController(controller)
self.controller = controller or nil
controller:setParent(self)