From fe964ceb7e604ae05c5214452872b2132c2d4531 Mon Sep 17 00:00:00 2001 From: XsedoX Date: Thu, 28 Apr 2022 14:23:44 +0200 Subject: [PATCH] ESC chyba naprawiony(ale pewnie i tak zaraz znajdziemy jakiegos buga xd) --- logic/game.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/logic/game.py b/logic/game.py index 0a1b678..c7ad2e6 100644 --- a/logic/game.py +++ b/logic/game.py @@ -20,13 +20,13 @@ class Game: pygame.display.set_icon(pygame.image.load('./resources/icons/sword.png')) self.screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT)) - self.logs = Logs(self.screen) + self.clock = pygame.time.Clock() self.bg = pygame.image.load("./resources/textures/bg.jpg") self.screens = {'credits': Credits(self.screen, self.clock), 'options': Options(self.screen, self.clock)} - self.level = Level(self.screen, self.logs) + def main_menu(self): menu = MainMenu(self.screen, self.clock, self.bg, @@ -36,7 +36,8 @@ class Game: menu.display_screen() def game(self): - health_bar = HealthBar(self.screen, pygame.Rect(150, 150, 100, 15), 100, 100) + logs = Logs(self.screen) + level = Level(self.screen, logs) stats = Stats(self.screen) # setup clock for rounds @@ -44,7 +45,7 @@ class Game: pygame.time.set_timer(NEXT_TURN, TURN_INTERVAL) # create level - self.level.create_map() + level.create_map() print_numbers_flag = False running = True @@ -63,11 +64,11 @@ class Game: if event.key == pygame.K_r: stats.red_team_hp_bar.take_dmg(5) if event.type == NEXT_TURN: # is called every 'TURN_INTERVAL' milliseconds - self.level.handle_turn() + level.handle_turn() stats.update() - self.logs.draw() - self.level.update() + logs.draw() + level.update() if print_numbers_flag: print_numbers() -- 2.20.1