samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
def detect_click_and_drag
    if inputs.mouse.up
      state.click_and_drag = :none
    elsif star_clicked?
      state.click_and_drag = :star
    elsif wall_clicked?
      state.click_and_drag = :remove_wall
    elsif grid_clicked?
      state.click_and_drag = :add_wall
    elsif slider_clicked?
      state.click_and_drag = :slider
    end
  end
# Determines what the user is editing and stores the value
# Storing the value allows the user to continue the same edit as long as the
# mouse left click is held
Determines what the user is editing and stores the value
Storing the value allows the user to continue the same edit as long as the
mouse left click is held
Determines what the user is editing and stores the value Storing the value allows the user to continue the same edit as long as the mouse left click is held
def detect_click_and_drag
    if inputs.mouse.up
      state.click_and_drag = :none
    elsif star_clicked?
      state.click_and_drag = :star
    elsif wall_clicked?
      state.click_and_drag = :remove_wall
    elsif grid_clicked?
      state.click_and_drag = :add_wall
    elsif slider_clicked?
      state.click_and_drag = :slider
    end
  end
def detect_click_and_drag if inputs . mouse . up state . click_and_drag = :none elsif star_clicked? state . click_and_drag = :star elsif wall_clicked? state . click_and_drag = :remove_wall elsif grid_clicked? state . click_and_drag = :add_wall elsif slider_clicked? state . click_and_drag = :slider end end
Determines what the user is editing and stores the value
Storing the value allows the user to continue the same edit as long as the
mouse left click is held
Determines what the user is editing and stores the value Storing the value allows the user to continue the same edit as long as the mouse left click is held