#### Archived

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

# Collision 'Correction'

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

## Recommended Posts

I''m not exactly sure how to word this.. In my 2D environment (game), there are sprites controlled by the players (k). All players use the same computer at the same time (4 max), and so they are processed in order of ''id'' (1-4). When players collide they can and usually do overlap and to correct this the player w/ the higher id (1-4, 1 being high) corrects the overlap by ~1/2 leaving the rest to the other player involved. This is so the higher player can''t push the lower around. The player sprites are small and square, incase you wanted to know.. Is there a better way to do this? Maybe I''m starting all wrong? ~ me ~

##### Share on other sites
Hello,

Maybe having a way to detect collision for all players first. Like in a matrix
.1234
1-X--
2---X
3X--X
4----

This would mean player 1 & 3 hit each other, 1 & 2 hit each other, 2 & 4 hit each other, and 3 & 4 hit each other. In each of the X's on the chart, you would store the other players original speed, mass, etc. Then when you process them all, you take the original values and apply them to all the collisions. You would have to watch out for overlap still, but you can get around that (I think) by just making sure there are no collisions when you are done with the algorithm. If this made no sense, or you are ready to pull your hair out, let me know.

Jeff

Edited by - JJXtra on February 26, 2002 1:09:21 PM

Edited by - JJXtra on February 26, 2002 1:09:46 PM

##### Share on other sites
I got it.. thx for the idea.

I'm still wondering if there was/is a better way to correct the overlapping than letting each player correct 1/2 of the overlap.

Militant - "Education is that which allows us to get into more intelligent trouble"

Edited by - Militant on February 26, 2002 1:43:31 PM

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632988
• Total Posts
3009736
• ### Who's Online (See full list)

There are no registered users currently online

×