'TypeError: render() takes 3 positional arguments but 4 were given

for sprite in sprites: sprite.render(pen, camera.x, camera.y)

    game.render_border(pen, camera.x, camera.y)

i need some some help I'm fairly new with sprites



Solution 1:[1]

This typically indicates that you did not add the self argument in the instance methods signature. If game is an instance of a class Game, and Game has an instance method render_border(pen, x, y), then you can resolve this error by adding the self variable.

class Game:
    def render_border(self, pen, x, y):
        # render the border...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 award28