Exemplo n.º 1
0
   def try_transform_miner_full(world, entity):
       new_entity = entities.MinerNotFull(
          entities.get_name(entity), entities.get_resource_limit(entity),
          entities.get_position(entity), entities.get_rate(entity),
          entities.get_images(entity), entities.get_animation_rate(entity))

       return new_entity
Exemplo n.º 2
0
    def try_transform_miner_full(world, entity):
        new_entity = entities.MinerNotFull(entities.get_name(entity),
                                           entities.get_resource_limit(entity),
                                           entities.get_position(entity),
                                           entities.get_rate(entity),
                                           entities.get_images(entity),
                                           entities.get_animation_rate(entity))

        return new_entity
Exemplo n.º 3
0
 def try_transform_miner_not_full(world, entity):
     if entity.resource_count < entity.resource_limit:
        return entity
     else:
        new_entity = entities.MinerFull(
           entities.get_name(entity), entities.get_resource_limit(entity),
           entities.get_position(entity), entities.get_rate(entity),
           entities.get_images(entity), entities.get_animation_rate(entity))
        return new_entity
Exemplo n.º 4
0
 def try_transform_miner_not_full(world, entity):
     if entity.resource_count < entity.resource_limit:
         return entity
     else:
         new_entity = entities.MinerFull(
             entities.get_name(entity), entities.get_resource_limit(entity),
             entities.get_position(entity), entities.get_rate(entity),
             entities.get_images(entity),
             entities.get_animation_rate(entity))
         return new_entity
Exemplo n.º 5
0
      def action(current_ticks):
         entities.remove_pending_action(entity, action)

         entities.next_image(entity)

         if repeat_count != 1:
            schedule_action(world, entity,
               entity.create_animation_action(world, entity, max(repeat_count - 1, 0)),
               current_ticks + entities.get_animation_rate(entity))

         return [entities.get_position(entity)]
Exemplo n.º 6
0
        def action(current_ticks):
            entities.remove_pending_action(entity, action)

            entities.next_image(entity)

            if repeat_count != 1:
                schedule_action(
                    world, entity,
                    entity.create_animation_action(world, entity,
                                                   max(repeat_count - 1, 0)),
                    current_ticks + entities.get_animation_rate(entity))

            return [entities.get_position(entity)]
Exemplo n.º 7
0
 def schedule_animation(world, entity, repeat_count=0):
     schedule_action(
         world, entity,
         world.create_animation_action(world, entity, repeat_count),
         entities.get_animation_rate(entity))
Exemplo n.º 8
0
 def schedule_animation(world, entity, repeat_count=0):
     schedule_action(world, entity,
        world.create_animation_action(world, entity, repeat_count),
        entities.get_animation_rate(entity))