Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Walking Figure in pygame
#1
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 += 1
But it walks just in half of the screen. I want it to walk a whole screen. Can you help me? Thank you very much
Reply


Messages In This Thread
Walking Figure in pygame - by adninqasifa - May-05-2020, 11:18 PM
RE: Walking Figure in pygame - by pyzyx3qwerty - May-06-2020, 10:26 AM
RE: Walking Figure in pygame - by michael1789 - May-07-2020, 04:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pygame*import pygame ImportError: No module named pygame CASPERHANISCH 1 9,859 Jun-05-2017, 09:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020