config added constant
This commit is contained in:
parent
44bdfa8ae1
commit
d470601fe1
@ -1,5 +1,7 @@
|
|||||||
[APP]
|
[APP]
|
||||||
cat = False
|
cat = False
|
||||||
movement = robot
|
movement = robot
|
||||||
NumberOfBananas = 20
|
#accept: human, robot
|
||||||
#accept: human, robot
|
|
||||||
|
[CONSTANT]
|
||||||
|
NumberOfBananas = 20
|
2
main.py
2
main.py
@ -145,7 +145,7 @@ class Main:
|
|||||||
|
|
||||||
def generate_world(tiles_x: int, tiles_y: int) -> World:
|
def generate_world(tiles_x: int, tiles_y: int) -> World:
|
||||||
world = World(tiles_x, tiles_y)
|
world = World(tiles_x, tiles_y)
|
||||||
for _ in range(config.getint("APP", "NumberOfBananas")):
|
for _ in range(config.getint("CONSTANT", "NumberOfBananas")):
|
||||||
temp_x = randint(0, tiles_x - 1)
|
temp_x = randint(0, tiles_x - 1)
|
||||||
temp_y = randint(0, tiles_y - 1)
|
temp_y = randint(0, tiles_y - 1)
|
||||||
world.add_entity(Garbage(temp_x, temp_y))
|
world.add_entity(Garbage(temp_x, temp_y))
|
||||||
|
Loading…
Reference in New Issue
Block a user