development #12
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
self.ui.update()
|
if self.ui.initialized:
|
||||||
self.ui.draw()
|
self.ui.update()
|
||||||
|
self.ui.draw()
|
||||||
|
Loading…
Reference in New Issue
Block a user