When I use blit
function, it does not delete the previous loaded sprite to make sprites move until I call the "display.fill(bgcolor)" function. The problem is that I have a multicolored background. so how do I update the image without affecting my background?
NOTE - already tried "pygame.display.update()" and "pygame.display.flip()" - it doesn't help :(
class states():
def __init__(self, goku1,goku2, x, y):
self.image=goku1
keys=pygame.key.get_pressed()
if keys[K_RIGHT]:
self.image=goku2
if keys[K_LEFT]:
self.image=goku2
while True:
pygame.display.flip()
pygame.display.update()
obj=states(goku1, goku2, x, y)
call=position()
DISPLAYSURF.blit(obj.image, (x, y))
am stuck for long :(