Jun-03-2019, 10:45 PM
Here. I try to explain it better.
Displacement collision. Moving Object hit a Stationary Object.
1. get the clipping rect size
Displacement collision. Moving Object hit a Stationary Object.
1. get the clipping rect size
width, height = object.rect.clip(collision.rect).size2. Determine the Axis.
if width < height: # X Axis else: # Y Axis3. Determine which side. Displace object and Change direction.
# Determine Axis X or Y if width < height: # X Axis # Determine which side if object.rect.centerx > collision.rect.centerx: # Displace object object.rect.left = collision.rect.right else: # Displace object object.rect.right = collision.rect.left # Change direction object.direction.x = -object.direction.x else: # Y Axis # ...
99 percent of computer problems exists between chair and keyboard.