Example #1
0
def create_item_on_ground(item_id: ItemId, pos: Tuple[int,
                                                      int]) -> ItemOnGround:
    item_type = item_id.item_type
    entity = WorldEntity(pos, ITEM_ENTITY_SIZE,
                         get_item_data_by_type(item_type).entity_sprite)
    entity.view_z = 1  # It should be rendered below all other entities
    return ItemOnGround(entity, item_id)
Example #2
0
def create_consumable_on_ground(consumable_type: ConsumableType,
                                pos: Tuple[int, int]) -> ConsumableOnGround:
    entity = WorldEntity(pos, POTION_ENTITY_SIZE,
                         CONSUMABLES[consumable_type].entity_sprite)
    entity.view_z = 1  # It should be rendered below all other entities
    return ConsumableOnGround(entity, consumable_type)