Pygame Typeerror: Missing 1 Required Positional Argument:
I am programming a game in Pygame. I kept running up on this error and I don't understand how to fix it.It runs the pauseMenu() init and prints what is in it so it can run it but a
Solution 1:
You are calling pauseMenu
on the class itself:
pauseMenu.pauseMenuFunct(DISPLAYSURF,(WINWIDTH,WINHEIGHT))
This is an unbound function, so self
will not be filled in for you.
You also create an instance somewhere:
def start():
pygame.init()
menuScreen = MenuScreen()
pMenu = pauseMenu()
Perhaps you meant to call pMenu.pauseMenuFunct()
instead?
Post a Comment for "Pygame Typeerror: Missing 1 Required Positional Argument:"