Python Forum
[PyGame] PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int'
#2
gDisplay is an object of type pygame.Surface, you probably meant its width and height
(gDisplay.get_width() - playerStartingx),(gDisplay.get_height() - playerStartingy)
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
RE: PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int' - by volcano63 - Jun-19-2018, 01:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Surface and rectangle in pygame Fabrizio_fg 6 2,206 May-27-2023, 09:15 AM
Last Post: Fabrizio_fg
  [PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite. Swagford 1 1,278 Jan-24-2023, 09:58 PM
Last Post: metulburr
  Coloring a surface with transparency Sandor 4 2,269 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,293 Feb-11-2021, 06:33 AM
Last Post: Leo_Red
  [PyGame] pygame.Surface.fill help Shemira 3 6,134 Nov-29-2019, 12:01 AM
Last Post: Shemira
  pygame.surface Graham 10 8,346 Nov-29-2018, 04:45 PM
Last Post: nilamo
  [PyGame] TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod' SnekLover123 5 13,166 Oct-05-2017, 07:39 PM
Last Post: SnekLover123
  downloading pygame wheel or MSI type DAS 3 5,979 Jun-09-2017, 02:27 PM
Last Post: DAS

Forum Jump:

User Panel Messages

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