dodanie małych skał (koszt przejscia)

This commit is contained in:
wojciech goralewski 2023-05-04 14:18:50 +02:00
parent e8bf3725fc
commit 0e183ca1cf
8 changed files with 25 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -36,6 +36,7 @@ class Game:
self.infantry_orks2 = pygame.sprite.LayeredUpdates()
self.sauronL = pygame.sprite.LayeredUpdates()
self.flowers = pygame.sprite.LayeredUpdates()
self.little_rock_sprites = pygame.sprite.LayeredUpdates()
#self.unknown_mobs = pygame.sprite.LayeredUpdates() #unknown mob
self.agent = Agent(self,1,1)
@ -57,6 +58,8 @@ class Game:
y = random.randint(0,11)
self.grass = Grass(self,x,y)
self.grass_cells.append(self.bfs.get_cell_number(self.grass.x,self.grass.y))
for y in range(5,8):
self.little_rocks = Little_Rocks(self,4,y)

View File

@ -80,4 +80,26 @@ class Health_flower(pygame.sprite.Sprite):
self._layer = FLOWER_LAYER
class Little_Rocks(pygame.sprite.Sprite):
def __init__ (self,game,x,y):
self.game = game
self.groups = self.game.all_sprites, self.game.little_rock_sprites
pygame.sprite.Sprite.__init__(self, self.groups)
self.x = x * TILE_SIZE
self.y = y * TILE_SIZE
self.width = TILE_SIZE
self.height = TILE_SIZE
self.LITTLE_ROCKS_PNG = pygame.image.load("./zdjecia/little_rocks.png")
self.LITTLE_ROCKS = pygame.transform.scale(self.LITTLE_ROCKS_PNG,(64,64))
self.image = pygame.Surface([self.width, self.height])
self.image.blit(self.LITTLE_ROCKS,(0,0))
self.image.set_colorkey((0, 0, 0))
self.rect = self.image.get_rect()
self.rect.x = self.x
self.rect.y = self.y

BIN
zdjecia/little_rocks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB