python - How to animate using Itertools.cycle -
egg = digimon(0,2,0,0,0,0, [pygame.image.load("images/egg_1.png"), pygame.image.load("images/egg_2.png"), pygame.image.load("images/egg_3.png") ]) egg_sprites = itertools.cycle(egg.image) # cycles through egg images screen.blit((egg_sprites_next), (x_pos,y_pos))
i've done this, , loops throughout images present.
how able make loop through images? use splicing list? if so, how this?
also, there way limit cycle 1 time? so, it'd cycle through images, stop.
thanks :)
Comments
Post a Comment