我试图使3个图像的精灵动画,我需要的动画播放在一次鼠标点击。
我试着使用这个代码,它适用于站立和行走的动画,但当我使用它进行拍摄时,动画不会发生,因为鼠标点击速度很快(虽然我按住了鼠标按键,它仍然有效)。
if self.standing:
if now - self.last_update > 50:
self.last_update = now
self.current_frame = (self.current_frame + 1) % len(self.game.player_idles)
self.image = pg.transform.scale(self.game.player_idles[self.current_frame], (64, 55))
self.image_copy = pg.transform.rotate(self.image, 270)
https://stackoverflow.com/questions/56243969
复制相似问题