From ab08c5744b5e7b5cecfd50fc31376300d62eecb7 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sun, 13 Nov 2011 16:00:08 +0100 Subject: [PATCH] Silly me, Lua doesn't work this way --- init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 4deb025..699b5a7 100644 --- a/init.lua +++ b/init.lua @@ -51,7 +51,14 @@ local HC = Class{name = "HardonCollider", function(self, cell_size, callback_col end} function HC:clear() - self = HC(self.hash.cell_size, self.on_collide, self.on_stop) + self._active_shapes = {} + self._passive_shapes = {} + self._ghost_shapes = {} + self._current_shape_id = 0 + self._shape_ids = setmetatable({}, {__mode = "k"}) -- reverse lookup + self.groups = {} + self._colliding_last_frame = {} + self._hash = Spatialhash(self.hash.cell_size) return self end