user3688448
user3688448

Reputation: 19

Pygame: Sprite won't draw

My issue is plain and simple: my sprite won't draw.
Because there's too much files to all post here, I'll link you to the github page for the project:
https://github.com/kahrkunne/Julia-Longina-Balbina-Error
The main file with the game loop is JLBE.py. The sprite is initialised at line 15 and then supposed to be drawn at line 45.

Upvotes: 0

Views: 130

Answers (1)

Marcus Møller
Marcus Møller

Reputation: 618

You never set the x and y position of the sprite rect. You should use the passed variables to the Player class (xcoord and ycoord) to set the x and y variable of the Player.rect object.

...
self.rect = self.image.get_rect()
self.rect.x = xcoord
self.rect.y = ycoord
...

Upvotes: 0

Related Questions