Predicting the Collision Ended Phase

I’m trying to visualize the order of the phases of multiple separate collision events during program execution.

I have one object that is colliding with point A and then with point B and I wanted to develop a better understanding of just when the “ended” phase of each collision occurs.

I tracked the “began” and “ended” phases of both collisions using the system timer and I am seeing that:

  1. both collision events have a “began” phase eventually have an “ended” phase…dah

  2. BUT I don’t always know when that “ended” phase will be. The “ended phase” for point A’s collision could come after or before the “began” phase of the collision that this object has with point B.

Remember, these collisions are happening one right after the other. Often without any resulting action. But even so, the order of which comes first, the end of collision A or the start of collision B doesn’t seem to be consistent or predictable

I’m just trying to see if there is some logical way of predicting the order of when the collision “ended” phase happens.

I hope this makes sense. I’m really curious as to the answer. It will help stabilize my code and make it consistent. [import]uid: 50215 topic_id: 21480 reply_id: 321480[/import]

I’m a little confused about exactly what you are trying to achieve.

Are you trying to work out which order the collision events will occur in? Will they always collide in the same order, or is it random?

Have you tried setting flags for the collision events and printing to the terminal so you can see which order the events happen in?

It’s also worth bearing in mind that collision events don’t just trigger the once. You may get multiple began phases as your object hits each point. A way to stop this is to use a switch/flag.

If you provide a little more info on what you need to achieve, I should be able to help, (I hope)

Spider.
[import]uid: 67933 topic_id: 21480 reply_id: 85021[/import]

Thanks for the reply.
“Are you trying to work out which order the collision events will occur in? Will they always collide in the same order, or is it random?”

That’s exactly what I am trying to work out. I have done the terminal tracking to verify my results, and I do use flags to control the events.

I just want to see how well I understand what goes on “under the hood.”

Are these “ended” phases indeed random and unpredictable? [import]uid: 50215 topic_id: 21480 reply_id: 85025[/import]

I can’t give you a definite answer as don’t know enough about the mysteries of Corona myself either!

I have witnessed the same collision event firing multiple times in the terminal. Try setting up a switch to only deal with the first firing of each event and ignore the others if it’s proving problematic.

You’d think it’d only fire each phase once, but unfortunately that isn’t the case.

Spider [import]uid: 67933 topic_id: 21480 reply_id: 85038[/import]

Actually it’s not the multiple firing of the “began” phase that I’m wondering about… what I’m trying to figure out when to effectively use the “ended” phase. [import]uid: 50215 topic_id: 21480 reply_id: 85044[/import]

Again I’m by no means an expert, but I try to think of it that the began phase triggers when a collision between two objects starts happening. The ended phase triggers when they stop colliding or touching each other.

Sorry if that sounds really simplistic. Think of it as the whole collision, not each individual event.

Again, it’d be easier to help you effectively use the end phase if you could be a little more specific about what you’re trying to achieve? What is it you wish to trigger on the end phase? [import]uid: 67933 topic_id: 21480 reply_id: 85132[/import]