[map_gen_refactor] added extract mapArray to main for bfs
This commit is contained in:
parent
924e7b46ca
commit
d1f4424e09
4
main.py
4
main.py
@ -39,8 +39,8 @@ class Game():
|
|||||||
def new(self):
|
def new(self):
|
||||||
# initialize all variables and do all the setup for a new game
|
# initialize all variables and do all the setup for a new game
|
||||||
|
|
||||||
# sprite groups
|
# sprite groups and map array
|
||||||
self.roadTiles, self.wallTiles = map_new.getTiles()
|
(self.roadTiles, self.wallTiles), self.mapArray = map_new.getTiles()
|
||||||
|
|
||||||
self.all_sprites = pg.sprite.Group()
|
self.all_sprites = pg.sprite.Group()
|
||||||
self.walls = pg.sprite.Group()
|
self.walls = pg.sprite.Group()
|
||||||
|
@ -7,7 +7,7 @@ def getTiles():
|
|||||||
array = map_utils.generateMap()
|
array = map_utils.generateMap()
|
||||||
pattern = map_pattern.getPattern()
|
pattern = map_pattern.getPattern()
|
||||||
tiles = map_utils.getSprites(array, pattern)
|
tiles = map_utils.getSprites(array, pattern)
|
||||||
return tiles
|
return tiles, array
|
||||||
|
|
||||||
def renderTiles(tiles, screen, camera, debug=False):
|
def renderTiles(tiles, screen, camera, debug=False):
|
||||||
for tile in tiles:
|
for tile in tiles:
|
||||||
|
Loading…
Reference in New Issue
Block a user