diff --git a/modules/Game.py b/modules/Game.py index b57782a..608fd5f 100644 --- a/modules/Game.py +++ b/modules/Game.py @@ -27,7 +27,7 @@ class Game: if event.type == pg.QUIT: self.running = False if event.type == pg.MOUSEBUTTONDOWN: - self.swamp.get_click(event.pos, self.screen) + self.swamp.get_click(event.pos) self.screen.fill((93, 101, 48)) self.swamp.render(self.screen) pg.display.flip() diff --git a/modules/RewardWindow.py b/modules/RewardWindow.py index d99d18e..900fbd2 100644 --- a/modules/RewardWindow.py +++ b/modules/RewardWindow.py @@ -3,7 +3,7 @@ import pygame as pg class RewardWindow: def open_window(self, event, screen): - pg.draw.rect(screen, (38, 33, 55), (0, 0, 700, 500)) + pg.draw.rect(screen, (38, 33, 55), (0, 100, 700, 400)) font = pg.font.Font(None, 30) text_string = self.event_to_string(event) text = font.render(text_string, True, (255, 255, 255)) diff --git a/modules/Swamp.py b/modules/Swamp.py index c9a6c86..525217e 100644 --- a/modules/Swamp.py +++ b/modules/Swamp.py @@ -49,6 +49,12 @@ class Swamp: pg.draw.rect(screen, (100, 100, 100), (self.x, self.y, self.cell_size, self.cell_size), 1) + font = pg.font.Font(None, 50) + text_string = "Ваш баланс мух составляет: 1000" + text = font.render(text_string, True, (255, 255, 255)) + size = font.size(text_string) + screen.blit(text, (350 - (size[0] / 2.), 50)) + if self.book_use is True: # При нажатии на книгу рисуется небольшой экран с информацией from modules.Mathematics import recalculation_events, get_random_event if not self.test: @@ -78,7 +84,7 @@ class Swamp: self.down_book = down self.left_book = left - def get_cell(self, mouse_pos, screen): + def get_cell(self, mouse_pos): board_width = self.width * self.cell_size board_height = self.height * self.cell_size if self.left_area < mouse_pos[0] < self.left_area + board_width: @@ -98,6 +104,6 @@ class Swamp: def on_click(self, mouse_pos): # Действия после клика на клетчатое поле pass - def get_click(self, mouse_pos, screen): - cell = self.get_cell(mouse_pos, screen) + def get_click(self, mouse_pos): + cell = self.get_cell(mouse_pos) self.on_click(cell) diff --git a/test.py b/test.py index 4ae184f..f36d3c7 100644 --- a/test.py +++ b/test.py @@ -1,3 +1,3 @@ from modules.Mathematics import field_generation -field_generation() +print(field_generation())