I'm doing a game in python and I have one error
integer argument expected, got float
, and I'm not understanding why. The line that give me error is:
pygame.draw.circle(screen, (128, 128, 128),
(self.location[0]-1, self.location[1]-1), self.size+1)
class Player(object):
def __init__(self, name, colour):
self.name = name
self.colour = colour
self.level = 1
self.feed = 0
self.size = 2
self.speed = 6
self.location = (SCREEN_SIZE[0]/2, SCREEN_SIZE[1]/2)
self.destination = self.location
self.stopDis = 5 #Stopping distance
def render(self, screen):
pygame.draw.circle(screen, (128, 128, 128),
(self.location[0]-1, self.location[1]-1), self.size+1) #Error here
pygame.draw.circle(screen, self.colour, self.location, self.size) #Draw circle