I tried to make snake game but this part
def snakebody():
no=0
while no < length:
snakebodyx=snakex[:no]
snakebodyy=snakey[:no]
pygame.draw.rect(win, Green, (snakebodyx,snakebodyy, size, size))
snakex and y is a list consisting of the memory of the snake head, so it can form its body. it tried extracting the variables of it and use it to get a coordinates of the bodies
However, it does not work it says TypeError: rect argument is invalid
Can anyone explain why?
I tried using win.fill, it failed making the rect become Rect, it still fail