forked from s464965/WMICraft
odkryłem że istnieje grupa do jednego sprite'a - GroupSingle i zmieniłem grupe z tile'ami na single.
This commit is contained in:
parent
c1d05eb1d1
commit
62e78ce885
@ -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))
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user