development #12

Merged
s452701 merged 9 commits from development into master 2021-06-21 17:12:29 +02:00
3 changed files with 7 additions and 4 deletions
Showing only changes of commit fd0d532350 - Show all commits

View File

@ -25,9 +25,11 @@ class UserInterface:
i += 1 i += 1
self.slot_image = Image('ui.png', self.pos, scale=2) self.slot_image = Image('ui.png', self.pos, scale=2)
self.font = pygame.font.SysFont('Comic Sans MS', 20) self.font = pygame.font.SysFont('Comic Sans MS', 20)
self.initialized = False
def load_inventory(self, inventory: InventoryComponent): def load_inventory(self, inventory: InventoryComponent):
self.inventory = inventory self.inventory = inventory
self.initialized = True
def update(self): def update(self):
pass pass

View File

@ -51,8 +51,8 @@ class WorldGenerator:
self.world.add_processor(VisionSystem(self.camera)) self.world.add_processor(VisionSystem(self.camera))
self.player = PlayerGenerator().create_player(self.world, self.game_map) self.player = PlayerGenerator().create_player(self.world, self.game_map)
self.world.get_processor(DrawSystem).initialize_interface( # self.world.get_processor(DrawSystem).initialize_interface(
self.world.component_for_entity(self.player, InventoryComponent)) # self.world.component_for_entity(self.player, InventoryComponent))
# BuildingGenerator().create_home(self.world, self.game_map) # BuildingGenerator().create_home(self.world, self.game_map)
self.resource_generator.generate_resources(self.player) self.resource_generator.generate_resources(self.player)

View File

@ -17,5 +17,6 @@ class DrawSystem(esper.Processor):
sprite.image.pos = pos.position sprite.image.pos = pos.position
sprite.image.origin = (32 * pos.direction.value, 0) sprite.image.origin = (32 * pos.direction.value, 0)
self.camera.draw(sprite.image) self.camera.draw(sprite.image)
if self.ui.initialized:
self.ui.update() self.ui.update()
self.ui.draw() self.ui.draw()