def chest():
     entity = create_chest((0, 0)).world_entity
     e = MapEditorWorldEntity(
         entity.sprite,
         (entity.pygame_collision_rect.w, entity.pygame_collision_rect.h))
     e.is_chest = True
     return e
Beispiel #2
0
def _add_chest(game_state: GameState, snapped_mouse_world_position):
    already_has_chest = any([
        x for x in game_state.game_world.chests
        if x.world_entity.get_position() == snapped_mouse_world_position
    ])
    if not already_has_chest:
        chest = create_chest(snapped_mouse_world_position)
        game_state.game_world.chests.append(chest)
Beispiel #3
0
 def deserialize(data) -> Chest:
     return create_chest(data["position"])