pygame do you need to use int() for positions code example
Example: pygame do you need to use int() for positions
class Hero(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = load_image('hero.png').convert_alpha()
self.position = [0, 0]
self.rect = self.image.get_rect()
def update(self, dt):
x = round(self.position[0])
y = round(self.position[1])
self.rect.topleft = x, y