May-05-2020, 11:18 PM
Hey Guys, I make a walking figure with pygame like this:
win = pygame.display.set_mode((852,480)) def __init__(self, x, y, width, height, end): self.x = x# self.y = y self.width = width self.height = height self.path = [x, end] self.vel = 3 def draw(self,win): # almost same with player(object) self.move() if self.walkCount + 1 >= 33: self.walkCount = 0 if self.vel > 0: # If we are moving to the right we will display our walkRight images win.blit(self.walkRight[self.walkCount//3], (self.x,self.y)) self.walkCount += 1 else: # Otherwise we will display the walkLeft images win.blit(self.walkLeft[self.walkCount//3], (self.x,self.y)) self.walkCount += 1But it walks just in half of the screen. I want it to walk a whole screen. Can you help me? Thank you very much