samples/13_path_finding_algorithms/02_detailed_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 clicking and planning on dragging
# Click and drag input is initiated by a click on the appropriate item
# and ended by mouse up
# 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 clicking and planning on dragging
Click and drag input is initiated by a click on the appropriate item
and ended by mouse up
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 clicking and planning on dragging Click and drag input is initiated by a click on the appropriate item and ended by mouse up 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 clicking and planning on dragging
Click and drag input is initiated by a click on the appropriate item
and ended by mouse up
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 clicking and planning on dragging Click and drag input is initiated by a click on the appropriate item and ended by mouse up Storing the value allows the user to continue the same edit as long as the mouse left click is held