pygame2

Problem with Pygame Animating a Moving Sprite

Problem with Pygame Animating a Moving Sprite Question: I’m trying to make a game and when I want to make a moving sprite, there’s trail that is behind it. When I remove it, then the sprite is not animated. When I try to fix that, it stops moving. As far as I know the problem …

Total answers: 1

How do I prevent the player from moving through the walls in a maze?

How do I prevent the player from moving through the walls in a maze? Question: I have a maze organized in a grid. Each cell of the grid stores the information about the walls to its right and bottom neighboring cell. The player is an object of a certain size whose bounding box is known. …

Total answers: 3

How do I make my Pygame Sprite jump higher and farther?

How do I make my Pygame Sprite jump higher and farther? Question: I am making a game in Pygame and this is my code to jump: keys = pygame.key.get_pressed() if isjump == False: #Up arrow key if keys[pygame.K_UP]: isjump = True v = 5 else: m = 1 if v >= 0 else -1 F …

Total answers: 1

How do I detect collision in pygame?

How do I detect collision in pygame? Question: I have made a list of bullets and a list of sprites using the classes below. How do I detect if a bullet collides with a sprite and then delete that sprite and the bullet? #Define the sprite class class Sprite: def __init__(self,x,y, name): self.x=x self.y=y self.image …

Total answers: 5