Hey guys I have some issues while I was making my game.... I want to move my character while the image changes every "step" that it looks like an animation...
I haven been working on this for hours but the only thing I have done so far is to move the char but all images are drawn at once while moving
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
currentimageleft = 1
gamedisplay.blit(background, (0,0))
if currentimageleft == 1:
gamedisplay.blit(temp1, (template_x, template_y), (g1x, g1y, box, box))
template_x -= moveit
currentimageleft += 1
if currentimageleft == 2:
gamedisplay.blit(temp1, (template_x, template_y), (g2x, g2y, box, box))
template_x -= moveit
currentimageleft += 1
if currentimageleft == 3:
gamedisplay.blit(temp1, (template_x, template_y), (g3x, g3y, box, box))
template_x -= moveit
currentimageleft += 1
if currentimageleft == 4:
gamedisplay.blit(temp1, (template_x, template_y), (g4x, g4y, box, box))
template_x -= moveit
currentimageleft = 1
pygame.display.update()