samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
# This method is called when the user is editing the slider
# It pauses the animation and moves the white circle to the closest integer point
# on the slider
# Changes the step of the search to be animated
This method is called when the user is editing the slider
It pauses the animation and moves the white circle to the closest integer point
on the slider
Changes the step of the search to be animated
This method is called when the user is editing the slider It pauses the animation and moves the white circle to the closest integer point on the slider Changes the step of the search to be animated
def process_input_slider
    state.play = false
    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.current_step = ((mouse_x - slider.x) / slider.spacing).to_i
    recalculate_searches
  end
def process_input_slider state . play = false 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 . current_step = ( ( mouse_x - slider . x ) / slider . spacing ) . to_i recalculate_searches end
This method is called when the user is editing the slider
It pauses the animation and moves the white circle to the closest integer point
on the slider
Changes the step of the search to be animated
This method is called when the user is editing the slider It pauses the animation and moves the white circle to the closest integer point on the slider Changes the step of the search to be animated
# 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