From 62e78ce88522bc91bbbefc55befc2f5b65988045 Mon Sep 17 00:00:00 2001 From: XsedoX Date: Sat, 9 Apr 2022 21:28:31 +0200 Subject: [PATCH] =?UTF-8?q?odkry=C5=82em=20=C5=BCe=20istnieje=20grupa=20do?= =?UTF-8?q?=20jednego=20sprite'a=20-=20GroupSingle=20i=20zmieni=C5=82em=20?= =?UTF-8?q?grupe=20z=20tile'ami=20na=20single.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/game.py | 2 +- logic/grid.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/logic/game.py b/logic/game.py index 436d514..cba84eb 100644 --- a/logic/game.py +++ b/logic/game.py @@ -117,7 +117,7 @@ class Game: castle_spawn.spawn() - #grid.put_on_tile(0, 0, knights_left[0]) + # grid.put_on_tile(0, 0, knights_left[0]) while running: self.screen.blit(self.bg, (0, 0)) diff --git a/logic/grid.py b/logic/grid.py index 8074713..715bbd1 100644 --- a/logic/grid.py +++ b/logic/grid.py @@ -58,7 +58,7 @@ class Grid: else: self.free_fields.append(field) - self.grid[row].append(pygame.sprite.Group(field)) + self.grid[row].append(pygame.sprite.GroupSingle(field)) def update(self, screen): self.draw(screen) @@ -68,7 +68,7 @@ class Grid: return self.textures[texture_index] def get_tile(self, row, column): - return pygame.sprite.Group.sprites(self.grid[row][column])[0] # iteruj kolumny i wiersze od 0 + return self.grid[row][column].sprite # iteruj kolumny i wiersze od 0 def put_on_tile(self, row, column, obj): # iteruj kolumny i wiersze od 0 try: