samples/13_path_finding_algorithms/05_dijkstra/app/main.rb
def input
    # If the mouse was lifted this tick
    if inputs.mouse.up
      # Set current input to none
      state.user_input = :none
    end

    # If the mouse was clicked this tick
    if inputs.mouse.down
      # Determine what the user is editing and edit the state.user_input variable
      determine_input
    end

    # Process user input based on user_input variable and current mouse position
    process_input
  end
# Handles user input every tick so the grid can be edited
# Separate input detection and processing is needed
# For example: Adding walls is started by clicking down on a hill,
# but the mouse doesn't need to remain over hills to add walls
Handles user input every tick so the grid can be edited
Separate input detection and processing is needed
For example: Adding walls is started by clicking down on a hill,
but the mouse doesn't need to remain over hills to add walls
Handles user input every tick so the grid can be edited Separate input detection and processing is needed For example : Adding walls is started by clicking down on a hill but the mouse doesn ' t need to remain over hills to add walls
def input
    if inputs.mouse.up
      state.user_input = :none
    end
    if inputs.mouse.down
      determine_input
    end
    process_input
  end
def input if inputs . mouse . up state . user_input = :none end if inputs . mouse . down determine_input end process_input end
Handles user input every tick so the grid can be edited
Separate input detection and processing is needed
For example: Adding walls is started by clicking down on a hill,
but the mouse doesn't need to remain over hills to add walls
Handles user input every tick so the grid can be edited Separate input detection and processing is needed For example : Adding walls is started by clicking down on a hill but the mouse doesn ' t need to remain over hills to add walls
# If the mouse was lifted this tick # Set current input to none # If the mouse was clicked this tick # Determine what the user is editing and edit the state.user_input variable # Process user input based on user_input variable and current mouse position