samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
# Method that is called by DragonRuby periodically
# Used for updating animations and calculations
Method that is called by DragonRuby periodically
Used for updating animations and calculations
Method that is called by DragonRuby periodically Used for updating animations and calculations
def tick args
  if args.inputs.keyboard.key_down.r
    args.gtk.reset
    reset
    return
  end
  $breadth_first_search ||= BreadthFirstSearch.new(args)
  $breadth_first_search.args = args
  $breadth_first_search.tick
end
def tick args if args . inputs . keyboard . key_down . r args . gtk . reset reset return end $breadth_first_search ||= BreadthFirstSearch . new ( args ) $breadth_first_search . args = args $breadth_first_search . tick end
Method that is called by DragonRuby periodically
Used for updating animations and calculations
Method that is called by DragonRuby periodically Used for updating animations and calculations
# Pressing r will reset the application # Every tick, new args are passed, and the Breadth First Search tick is called
args