Use a ResourceManager to find assets

This commit is contained in:
Yohann D'ANELLO
2020-11-19 02:49:59 +01:00
parent d92a5e1629
commit 00f843754a
5 changed files with 21 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import sys
from .entities.player import Player
from .enums import GameMode, KeyValues, DisplayActions
from .interfaces import Map
from .resources import ResourceManager
from .settings import Settings
from . import menus
from typing import Callable
@ -38,7 +39,7 @@ class Game:
Create a new game on the screen.
"""
# TODO generate a new map procedurally
self.map = Map.load("squirrelbattle/assets/example_map_2.txt")
self.map = Map.load(ResourceManager.get_asset_path("example_map_2.txt"))
self.player = Player()
self.map.add_entity(self.player)
self.player.move(self.map.start_y, self.map.start_x)