Python Forum
[PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite.
#2
Line 18 you assign it to a loaded pygame image, which is a surface. Then you define your World class, and then call the world class. But right after that one line 187 you redefine it to a group. You should have this defined before World class definition.

You shouldn't use the same variable and change it mid program to some other object.
Recommended Tutorials:
Reply


Messages In This Thread
RE: Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite. - by metulburr - Jan-24-2023, 09:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Surface and rectangle in pygame Fabrizio_fg 6 2,527 May-27-2023, 09:15 AM
Last Post: Fabrizio_fg
  [PyGame] Sprites just randomly appear and dissapear in my pygame.sprite.GoupeSingle trueShadoWrr 2 2,066 Feb-13-2023, 09:34 AM
Last Post: Vadanane
  Coloring a surface with transparency Sandor 4 2,395 Jan-02-2022, 08:11 AM
Last Post: Sandor
  Drawn line shift when that surface is copied to another in pygame Leo_Red 4 3,400 Feb-11-2021, 06:33 AM
Last Post: Leo_Red
  FileNotFoundError when I try putting sprite in Pygame zionkozisek 9 16,364 Dec-09-2020, 04:42 AM
Last Post: zionkozisek
  [PyGame] My Pygame Sprite not appearing... noodlespinbot 3 3,909 Oct-30-2020, 06:51 AM
Last Post: robinmurphy
  My Pygame Sprite not appearing... noodlespinbot 1 2,310 Apr-08-2020, 11:25 AM
Last Post: pyzyx3qwerty
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,665 Dec-13-2019, 08:37 PM
Last Post: michael1789
  [PyGame] pygame.Surface.fill help Shemira 3 6,281 Nov-29-2019, 12:01 AM
Last Post: Shemira
  Pygame sprite not moving michael1789 1 2,894 Nov-10-2019, 03:54 AM
Last Post: michael1789

Forum Jump:

User Panel Messages

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