dodanie małych skał (koszt przejscia)
This commit is contained in:
parent
e8bf3725fc
commit
0e183ca1cf
Binary file not shown.
BIN
__pycache__/bfs.cpython-39.pyc
Normal file
BIN
__pycache__/bfs.cpython-39.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
__pycache__/mobs.cpython-39.pyc
Normal file
BIN
__pycache__/mobs.cpython-39.pyc
Normal file
Binary file not shown.
3
main.py
3
main.py
@ -36,6 +36,7 @@ class Game:
|
|||||||
self.infantry_orks2 = pygame.sprite.LayeredUpdates()
|
self.infantry_orks2 = pygame.sprite.LayeredUpdates()
|
||||||
self.sauronL = pygame.sprite.LayeredUpdates()
|
self.sauronL = pygame.sprite.LayeredUpdates()
|
||||||
self.flowers = pygame.sprite.LayeredUpdates()
|
self.flowers = pygame.sprite.LayeredUpdates()
|
||||||
|
self.little_rock_sprites = pygame.sprite.LayeredUpdates()
|
||||||
|
|
||||||
#self.unknown_mobs = pygame.sprite.LayeredUpdates() #unknown mob
|
#self.unknown_mobs = pygame.sprite.LayeredUpdates() #unknown mob
|
||||||
self.agent = Agent(self,1,1)
|
self.agent = Agent(self,1,1)
|
||||||
@ -57,6 +58,8 @@ class Game:
|
|||||||
y = random.randint(0,11)
|
y = random.randint(0,11)
|
||||||
self.grass = Grass(self,x,y)
|
self.grass = Grass(self,x,y)
|
||||||
self.grass_cells.append(self.bfs.get_cell_number(self.grass.x,self.grass.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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,4 +80,26 @@ class Health_flower(pygame.sprite.Sprite):
|
|||||||
|
|
||||||
self._layer = FLOWER_LAYER
|
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
BIN
zdjecia/little_rocks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
Loading…
Reference in New Issue
Block a user