我正在为扑动的鸟制作克隆,但是当我想让翅膀拍动时,它们会疯狂地快速拍动,所以有没有办法让它们在一张图像上暂停几秒钟,然后再切换到下一张?这是我的代码
first=1
if first==1:
playern=1
comeback=False
first=2
if obspeed==1 and playern==1:
imagefile="player1"
player=pygame.image.load(imagefile+".png")
screen.blit(player, [x, int(y)])
y+=3
playern=2
pygame.display.update()
if obspeed==1 and playern==2 and comeback==False:
imagefile="player"
player=pygame.image.load(imagefile+".png")
screen.blit(player, [x, int(y)])
y-=2
playern=3
pygame.display.update()
if obspeed==1 and playern==3:
imagefile="player3"
player=pygame.image.load(imagefile+".png")
screen.blit(player, [x, int(y)])
y-=3
playern=2
comeback=True
pygame.display.update()
if obspeed==1 and playern==2 and comeback==True:
imagefile="player"
player=pygame.image.load(imagefile+".png")
screen.blit(player, [x, int(y)])
y+=2
playern=1
comeback=False
pygame.display.update()
if obspeed==0:
imagefile="player2"
player=pygame.image.load(imagefile+".png")
screen.blit(player, [x, int(y)])`