I have a small program in python and pygame but when I run my it I get this error:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "main.py", line 31, in <module>
main()
File "main.py", line 25, in main
board.draw(WIN)
File "/home/ether/Desktop/checkersai/checker/board.py", line 42, in draw
piece.draw(win)
File "/home/ether/Desktop/checkersai/checker/piece.py", line 32, in draw
pygame.draw.circle(win, GREY, (self.x, self.y), radius + self.OUTLINE)
TypeError: integer argument expected, got float
and this is the function where the error is:
def draw(self, win):
radius = SQUARE_SIZE//2 - self.PADDING
pygame.draw.circle(win, GREY, (self.x, self.y), radius + self.OUTLINE)
pygame.draw.circle(win, self.color, (self.x, self.y), radius)
and these are the variables I use:
WIDTH, HEIGHT = 800,800
ROWS, COLS = 8,8
SQUARE_SIZE = WIDTH/COLS
So I don't see how I get this error nor do I have any idea where I need to start looking for the error.
Here is the full code to my project https://pastebin.ubuntu.com/p/DHcRNT6948/
SQUARE_SIZE = WIDTH/COLSlooks a bit different from what you used inradius = SQUARE_SIZE//2 - self.PADDING, doesn't it?pygame.draw.circle(win, GREY, (self.x, self.y), radius + self.OUTLINE)