level_state: try to avoid hitting powerups, try #2

This commit is contained in:
Erkki Seppälä 2014-10-19 13:31:01 +03:00
parent 7ff61ac171
commit d65357a578

View file

@ -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)