Sliding sprites
问题 I want my sprite to slide like he's on ice. So if he's on ground then he can walk normally, but when he touches ice he will slide until something stops him. Does anyone know how one can do that? Thanks 回答1: Manipulate the friction coefficients like the "Sprite Movement Towards a Target" example (modified below): class Sprite(pygame.sprite.Sprite): ICE = 0.01 LAND = 1. def __init__(self): # ... self.normal_friction = .95 # friction while accelerating self.slowing_friction = .8 # friction while