# Apply Friction (Resistance) if input_x == 0: # Slower friction for heavier characters simulates "sliding stop" if abs(self.velocity_x) > 0.1: self.velocity_x *= (1.0 - self.friction) else: self.velocity_x = 0