samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
# This method is called when the user is dragging the slider
# It moves the current animation step to the point represented by the slider
This method is called when the user is dragging the slider
It moves the current animation step to the point represented by the slider
This method is called when the user is dragging the slider It moves the current animation step to the point represented by the slider
def input_slider
    mouse_x = inputs.mouse.point.x
    mouse_x = slider.x if mouse_x < slider.x 
    mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w 
    state.anim_steps = ((mouse_x - slider.x) / slider.spacing).to_i
    recalculate 
  end
def input_slider mouse_x = inputs . mouse . point . x mouse_x = slider . x if mouse_x < slider . x mouse_x = slider . x + slider . w if mouse_x > slider . x + slider . w state . anim_steps = ( ( mouse_x - slider . x ) / slider . spacing ) . to_i recalculate end
This method is called when the user is dragging the slider
It moves the current animation step to the point represented by the slider
This method is called when the user is dragging the slider It moves the current animation step to the point represented by the slider
# Bounds the mouse_x to the closest x value on the slider line # Sets the current search step to the one represented by the mouse x value # The slider's circle moves due to the render_slider method using anim_steps