I am making my own game engine on Python and I got stuck with collision between objects. # If we go Right if (collision_rect.right >= object_collision_rect.left) and \ (collision_rect.left <= object_collision_rect.left): if (collision_rect.bottom > object_collision_rect.top) and \ (collision_rect.top < object_collision_rect.bottom): if self.acceleration.x > 0: self.acceleration.x = 0 moving.x = object_collision_rect.left – collision_rect.right # Bottom if (collision_rect.bottom >= object_collision_rect.top) and \ (collision_rect.top <= object_collision_rect.top): if (collision_rect.right > object_collision_rect.left) and \ (collision_rect.left < object_collision_rect.right): if self.acceleration.y > 0: self.acceleration.y = 0 moving.y = object_collision_rect.top – collision_rect.bottom There are two more for left and top. It makes teleporting on corners. And if we change the second conditions from < > to <= >=, we get teleporting on edges, if we have acceleration x and y both != 0
- How this dummy car tests collision detection systems in your car
- Serious collision at Hillsborough causing major disruption
- Roundabout Causes Confusion In Tucson's Elvira Neighborhood
- Depression Causes U.S. 19 Lane Closing
- His Software Solution Aims to Ease the Pain of Running a Dispensary
- Currency Corner: what does Boris mean for sterling?
- Currency Corner: what does Boris Johnson mean for sterling?
- Brexit: DUP insists EU must help find solutions to Ireland border issue
- The Gift of Giving: Top Holiday Cause Marketing Campaigns
- Fight the Winter Blues With These Light-Tech Solutions (Infographic)
Collision detection and solution causes teleportation on corners have 262 words, post on gamedev.stackexchange.com at August 12, 2019. This is cached page on GameMax. If you want remove this page, please contact us.