Archived

This topic is now archived and is closed to further replies.

Pushing Objects Halts Everything...

This topic is 5238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys, In my game you can push objects around by moving up to them and continuing to move like this:
o--->O

  o->O

    oO--->

         oO--->
  
You are the little 'o' and the object is the big 'O'. Also, the big 'O' is a moving object. At first, my collision detection would register a time 0.0 while the object was being pushed and the other objects wouldn't move, so I made a special case to prevent that which seems to work fine. But now I have another problem. You can "trap" the moving objects, for example: if a ball is moving left and right you can push a box against it so that the ball gets "trapped" between the box and a wall. The problem is that the balls are self-propelled so it keeps bouncing back between the wall and box, causing a collision at time 0.0 or a time very slightly after that which results in the other objects practically halting. It looks like this: |O| where the O moves left and right a tiny bit or not at all. If you move the box away the ball escapes, which is what it should do. What is a good way to handle this ? Also, in general, what is a good way to handle collisions recurring repetively at time 0.0 ? Any help is appreciated. [edited by - Endemoniada on August 15, 2003 11:04:26 AM]

Share this post


Link to post
Share on other sites
When I met something like this (continuous collision, I called it), I put the object to sleep for a given period of time. On wakeup, if one path was clear, it moved, if not, it went back to sleep for a longer period, and so on.

This way, if something is trapped long enough, it ceases to be an element in the update cycle.

Maybe the idea will work for you?




Stevie

Don''t follow me, I''m lost.

Share this post


Link to post
Share on other sites