Skip to content Skip to sidebar Skip to footer

Receiving ValueError: Invalid Recstyle Object

I am following the instructions of a pygame project on youtube, this is the video, I am on the project called 'Snake', and in the description of the video, you can find what time i

Solution 1:

You have to specify the color by a tuple:

surface.fill(0,0,0)

surface.fill( (0, 0, 0) )

Explanation:

The first argument of fill() is the color (tuple). The other arguments are optional. The 2nd argument is an optional rectangle specifying area to be filled. The 3rd arguments are optional flags.

Hence the instruction surface.fill(0,0,0) can be read as:

surface.fill(0, rect=0, special_flags=0)

The 2nd argument (rect=0) causes the error

ValueError: invalid rectstyle object


Post a Comment for "Receiving ValueError: Invalid Recstyle Object"