samples/13_path_finding_algorithms/04_early_exit/app/main.rb
# Removes walls in the second grid that are under the cursor
Removes walls in the second grid that are under the cursor
Removes walls in the second grid that are under the cursor
def input_remove_wall2
    if mouse_inside_grid2?
      if state.walls.has_key?(cell_closest_to_mouse2)
        state.walls.delete(cell_closest_to_mouse2)
        reset_search
      end
    end
  end
def input_remove_wall2 if mouse_inside_grid2? if state . walls . has_key? ( cell_closest_to_mouse2 ) state . walls . delete ( cell_closest_to_mouse2 ) reset_search end end end
Removes walls in the second grid that are under the cursor
Removes walls in the second grid that are under the cursor
# The mouse needs to be inside the grid, because we only want to remove walls # the cursor is directly over # Recalculations should only occur when a wall is actually deleted