lib/demiurge/action_item.rb
# Move the agent to a specific position immediately. Don't play a
# walking animation or anything. Just put it where it needs to be.
#
# @param position [String] The position to move to
# @param options [Hash] A Hash of *how* the item moves there; this can be checked by your World Files or display library, though Demiurge won't use it directly.
# @return [void]
# @since 0.0.1
Move the agent to a specific position immediately. Don't play a
walking animation or anything. Just put it where it needs to be.
Move the agent to a specific position immediately . Don ' t play a walking animation or anything . Just put it where it needs to be .
def move_to_instant(position, options = {})
      loc_name = TiledLocation.position_to_loc_coords(position)[0]
      location = @item.engine.item_by_name(loc_name)
      if !location
        cancel_intention_if_present "Location #{loc_name.inspect} doesn't exist.", "position" => position, "mover" => @item.name
      elsif location.can_accomodate_agent?(@item, position)
        @item.move_to_position(position)
      else
        cancel_intention_if_present "That position is blocked.", "position" => position, "message" => "position blocked", "mover" => @item.name
      end
    end
def move_to_instant ( position , options = { } ) loc_name = TiledLocation . position_to_loc_coords ( position ) [ 0 ] location = @item . engine . item_by_name ( loc_name ) if ! location cancel_intention_if_present "Location #{loc_name.inspect} doesn't exist." , "position" => position , "mover" => @item . name elsif location . can_accomodate_agent? ( @item , position ) @item . move_to_position ( position ) else cancel_intention_if_present "That position is blocked." , "position" => position , "message" => "position blocked" , "mover" => @item . name end end
Move the agent to a specific position immediately.
Move the agent to a specific position immediately .
# TODO: We don't have a great way to do this for non-agent entities. How does "accomodate" work for non-agents? # This may be app-specific.
None
void
position
The position to move to
The position to move to
options
A Hash of *how* the item moves there; this can be checked by your World Files or display library, though Demiurge won't use it directly.
A Hash of * how * the item moves there ; this can be checked by your World Files or display library though Demiurge won ' t use it directly .
since
None