samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb
def input_click_map
    return unless inputs.mouse.click # return unless the mouse is clicked
    canvas_entry = state.canvas.find do |c| # find element from canvas collection that meets requirements
      inputs.mouse.click.inside_rect? c.border # find border that mouse was clicked inside of
    end
    puts canvas_entry # prints canvas_entry value
  end
# Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element.
Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element.
Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element .
def input_click_map
    return unless inputs.mouse.click 
    canvas_entry = state.canvas.find do |c| 
      inputs.mouse.click.inside_rect? c.border 
    end
    puts canvas_entry 
  end
def input_click_map return unless inputs . mouse . click canvas_entry = state . canvas . find do | c | inputs . mouse . click . inside_rect? c . border end puts canvas_entry end
Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element.
Goes through the canvas collection to find if the mouse was clicked inside of the borders of an element .
# return unless the mouse is clicked # find element from canvas collection that meets requirements # find border that mouse was clicked inside of # prints canvas_entry value