Recent posts by LegionnaireX2 on Kongregate

Flag Post

Topic: Game Programming / Effectively finding multiple collisions

The way I resolved that was through recursion. First find the ration for the movement in terms of one. One meaning the amount of travel during a single frame. for example if the object moved six pixels in the current frame and collision happened after traveling 3 pixels then it moved 0.5 of the six pixels. and so will all of the other objects will move 0.5 of their distance to travel during that specific frame. Keep track of the collisions that happen at the same time only and if a collision happens sooner discard the previously stored collisions. Once the first collision/s are figured out. Advance all of the objects to that position in terms of ration where the first collision happened and process the collision response. Subtract the ration from 1.0. Then do the process again until the frame(1.0) is completely used. 99% of the time you will only have 1 collision at a time. but it’s possible to have as may collisions as there are objects. these type of collisions is intense and might limit the amount of stuff you can do with it.

I hope it helps.

Flag Post

Topic: Game Programming / Collisions...

if you have never done vector math or dynamic collision here is a great tutorial to get you started on:

and this is the relevant section for this: