I have another Lua question.
I am using kinetic collisions in my top-down grid based game, and I’m not really sure on the best way to tell when a collision has finished.
Each of the solid blocks in my game has four collision shapes, each in a different group. The groups are called up, down, left, and right. If player is colliding with left, it means it is to the left of a wall, and therefore cannot move right.
At the moment I have this:
function on_message(self, message_id, message, sender)
if message_id == hash("contact_point_response") and if message.group == hash("left") then
touchingleft = true
and in my movement code:
elseif direction == "r" and not touchingleft then
pos.x = pos.x + speed
go.set_position(pos)
But the obvious problem is that touchingleft is never set to false again. Any help? (when I change the type to “trigger”, I don’t get any contact_point_response messages, so that’s not worked for me)