From d65357a578decb713ba282285ff415f53067d7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Sun, 19 Oct 2014 13:31:01 +0300 Subject: [PATCH] level_state: try to avoid hitting powerups, try #2 --- level_state.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/level_state.lua b/level_state.lua index 6d3bf2f..c1a6169 100644 --- a/level_state.lua +++ b/level_state.lua @@ -206,7 +206,17 @@ function end_contact(a, b, coll) end function pre_solve(a, b, coll) - + if aObj ~= nil and bObj ~= nil then + if aObj:isinstance(Plane) and bObj:isinstance(PowerUp) then + bObj.deleteLater = true + aObj:setPowerUpMode(bObj.mode) + coll:setEnabled(false) + elseif bObj:isinstance(Plane) and aObj:isinstance(PowerUp) then + aObj.deleteLater = true + bObj:setPowerUpMode(bObj.mode) + coll:setEnabled(false) + end + end end function end_solve(a, b, coll)