Python Forum
[PyGame] AttributeError while switching between Sprite Animations
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] AttributeError while switching between Sprite Animations
#2
The problem is in the line ...

self.image = pygame.image.load('player.png').convert_alpha
It's missing a set of parentheses in order to actually call the method. Try this:

self.image = pygame.image.load('player.png').convert_alpha ()
Reply


Messages In This Thread
RE: AttributeError while switching between Sprite Animations - by BashBedlam - Jun-09-2021, 09:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,619 Dec-13-2019, 08:37 PM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 2,163 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Need help making a sprite GalaxyCoyote 4 3,260 Aug-11-2019, 09:12 PM
Last Post: metulburr
  moving a sprite pfaber11 3 2,618 May-15-2019, 12:52 PM
Last Post: pfaber11
  [PyGame] Need Help With Sprite ghost0fkarma 2 3,302 Jan-09-2018, 02:14 PM
Last Post: ghost0fkarma

Forum Jump:

User Panel Messages

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