Integrating procedural generation into the game

This commit is contained in:
Charles Peyrat 2020-12-11 01:13:00 +01:00
parent 302017222d
commit 45120d0c2b
1 changed files with 2 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from .enums import GameMode, KeyValues, DisplayActions
from .interfaces import Map from .interfaces import Map
from .settings import Settings from .settings import Settings
from . import menus from . import menus
from .mapgeneration import randomwalk
from typing import Callable from typing import Callable
@ -31,8 +32,7 @@ class Game:
""" """
Create a new game on the screen. Create a new game on the screen.
""" """
# TODO generate a new map procedurally self.map = randomwalk.Generator().run()
self.map = Map.load("resources/example_map_2.txt")
self.player = Player() self.player = Player()
self.map.add_entity(self.player) self.map.add_entity(self.player)
self.player.move(self.map.start_y, self.map.start_x) self.player.move(self.map.start_y, self.map.start_x)