<commit_before>import pygame

SCREEN_SIZE = (640, 480)

class Player(pygame.sprite.Sprite):
    SPEED = 200
    def __init__(self, *groups):
        super().__init__(*groups)
        self.image = pygame.image.load('frog.gif')
        self.rect = pygame.rect.Rect((320, 240), self.image.get_size())
        self.resting = False
        self.dy = 0
        
    def update(self, dt, game):
        # last position
        last = self.rect.copy()
        
        key = pygame.key.get_pressed()
        if key[pygame.K_LEFT]:
            self.rect.x -= self.SPEED * dt - 1
        if key[pygame.K_RIGHT]:
            self.rect.x += self.SPEED * dt
        if key[pygame.K_UP]:
            self.rect.y -= self.SPEED * dt - 1
        if key[pygame.K_DOWN]:
            self.rect.y += self.SPEED * dt

        new = self.rect    
        for cell in pygame.sprite.spritecollide(self, game.walls, False):
            cell = cell.rect<commit_msg>Make left and right speeds go the same by casting the new position as an int rather than subtracting one.<commit_after>import pygame

SCREEN_SIZE = (640, 480)

class Player(pygame.sprite.Sprite):
    SPEED = 200
    def __init__(self, *groups):
        super().__init__(*groups)
        self.image = pygame.image.load('frog.gif')
        self.rect = pygame.rect.Rect((320, 240), self.image.get_size())
        self.resting = False
        self.dy = 0
        
    def update(self, dt, game):
        # last position
        last = self.rect.copy()
        
        key = pygame.key.get_pressed()
        if key[pygame.K_LEFT]:
            self.rect.x -= int(self.SPEED * dt)
        if key[pygame.K_RIGHT]:
            self.rect.x += int(self.SPEED * dt)
        if key[pygame.K_UP]:
            self.rect.y -= int(self.SPEED * dt)
        if key[pygame.K_DOWN]:
            self.rect.y += int(self.SPEED * dt)

        new = self.rect    
        for cell in pygame.sprite.spritecollide(self, game.walls, False):
            cell = cell.rect
{'fraction_non_alphanumeric': 0.12575757575757576, 'fraction_numerical': 0.01717171717171717, 'mean_word_length': 1.8751814223512338, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200764', 'n_tokens_mistral': 686, 'n_tokens_neox': 653, 'n_words': 146}