Jan-24-2023, 09:59 PM
Once you land on the floor you start doing this:
def handle_collision(self, floor): self.y = floor.y - self.height self.y_velocity = 0 self.jumping = False if ( self.x < floor.x + floor.width and self.x > floor.x ): # Check if collision is occurring on the left edge if self.x < screen.get_width() - self.width: self.x = floor.x + floor.width else: self.x = floor.x + floor.widthThis forces you to go to floor.x + floor.width