<commit_before>import pygame
from worldmap import *
from game_objects import *
from pygame.locals import *
import sys

isLinux = sys.platform.startswith("linux")
if(isLinux):
    from gi.repository import Gtk

class GolemsGame:
    def __init__(self):
        self.clock = pygame.time.Clock()
        self.movable_characters = []
        self.main_player = MovableCharacter("P1",pygame.image.load, ["res/main_player/up.png", "res/main_player/right.png", "res/main_player/down.png", "res/main_player/left.png"])
        self.main_player.change_direction(self.main_player.current_direction, override_opt = True)
        self.movable_characters.append(self.main_player)
        self.map = Map()

    def doKeys(self,char):
        if char.moving: # Player's currently moving, ignore keypresses
            return;
        keys = pygame.key.get_pressed()
        # Use change_direction instead of just changing the
        # variable since it also changes the sprite image
        if isUpPressed(keys):
            char.change_direction(Direction.UP)
            char.moving = True
        elif isRightPressed(keys):
            char.change_direction(Direction.RIGHT)
            char.moving = True
        elif isDownPressed(keys):
            char.change_direction(Direction.DOWN)
            char.moving = True
        elif isLeftPressed(keys):
            char.change_direction(Direction.LEFT)
            char.moving = True
    # run the game loop
    def game_loop(self):
        FPS = 30
        surface = pygame.display.get_surface()

        while True:
            surface.fill((0,0,0))
            width, height = surface.get_size()
            self.map.render(surface, self.main_player.x, self.main_player.y)
            
            for character in self.movable_characters:
                if character.moving:
                    if character == self.main_player:
                        character.move(5)
                        if not character.moving:
                            keys = pygame.key.get_pressed()
                            if isUpPressed(keys):
                                character.change_direction(Direction.UP)
                                character.moving = True
                            elif isDownPressed(keys):
                                character.change_direction(Direction.DOWN)
                                character.moving = True<commit_msg>Fixed an error with the previous commit<commit_after>import pygame
from worldmap import *
from game_objects import *
from pygame.locals import *
import sys

isLinux = sys.platform.startswith("linux")
if(isLinux):
    from gi.repository import Gtk

class GolemsGame:
    def __init__(self):
        self.clock = pygame.time.Clock()
        self.movable_characters = []
        self.main_player = MovableCharacter("P1",pygame.image.load, ["res/main_player/up.png", "res/main_player/right.png", "res/main_player/down.png", "res/main_player/left.png"])
        self.main_player.change_direction(self.main_player.current_direction, override_opt = True)
        self.movable_characters.append(self.main_player)

    def doKeys(self,char):
        if char.moving: # Player's currently moving, ignore keypresses
            return;
        keys = pygame.key.get_pressed()
        # Use change_direction instead of just changing the
        # variable since it also changes the sprite image
        if isUpPressed(keys):
            char.change_direction(Direction.UP)
            char.moving = True
        elif isRightPressed(keys):
            char.change_direction(Direction.RIGHT)
            char.moving = True
        elif isDownPressed(keys):
            char.change_direction(Direction.DOWN)
            char.moving = True
        elif isLeftPressed(keys):
            char.change_direction(Direction.LEFT)
            char.moving = True
    # run the game loop
    def game_loop(self):
        FPS = 30
        surface = pygame.display.get_surface()
        self.map = Map()

        while True:
            surface.fill((0,0,0))
            width, height = surface.get_size()
            self.map.render(surface, self.main_player.x, self.main_player.y)
            
            for character in self.movable_characters:
                if character.moving:
                    if character == self.main_player:
                        character.move(5)
                        if not character.moving:
                            keys = pygame.key.get_pressed()
                            if isUpPressed(keys):
                                character.change_direction(Direction.UP)
                                character.moving = True
                            elif isDownPressed(keys):
                                character.change_direction(Direction.DOWN)
                                character.moving = True
{'fraction_non_alphanumeric': 0.08533554266777134, 'fraction_numerical': 0.002899751449875725, 'mean_word_length': 1.832258064516129, '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': '1716165', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1258, 'n_words': 265}