summaryrefslogtreecommitdiffhomepage
path: root/samples/13_path_finding_algorithms/07_heuristic_with_walls
diff options
context:
space:
mode:
author_Tradam <[email protected]>2021-12-16 19:22:26 -0500
committerGitHub <[email protected]>2021-12-16 19:22:26 -0500
commit5954b9beb4d4a3b4f248d72d1851195f030558a8 (patch)
treefecd8aa840a25afdb502915b0fdb4d03b7ed339a /samples/13_path_finding_algorithms/07_heuristic_with_walls
parent2f845281f133849256b57bb08fd3e9ae57600784 (diff)
parenteaa29e72939f5edf61735ccbb73c36ee89369f65 (diff)
downloaddragonruby-game-toolkit-contrib-master.tar.gz
dragonruby-game-toolkit-contrib-master.zip
Merge branch 'DragonRuby:master' into masterHEADmaster
Diffstat (limited to 'samples/13_path_finding_algorithms/07_heuristic_with_walls')
-rw-r--r--samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb218
-rw-r--r--samples/13_path_finding_algorithms/07_heuristic_with_walls/replay.txt352
2 files changed, 461 insertions, 109 deletions
diff --git a/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb b/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
index 5fc0804..2dc3e74 100644
--- a/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
+++ b/samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
@@ -10,13 +10,13 @@ class Heuristic
def tick
defaults
- render
- input
+ render
+ input
# If animation is playing, and max steps have not been reached
# Move the search a step forward
if state.play && state.current_step < state.max_steps
# Variable that tells the program what step to recalculate up to
- state.current_step += 1
+ state.current_step += 1
move_searches_one_step_forward
end
end
@@ -71,7 +71,7 @@ class Heuristic
# We store this value, because we want to remember the value even when
# the user's cursor is no longer over what they're interacting with, but
# they are still clicking down on the mouse.
- state.user_input ||= :none
+ state.user_input ||= :none
# These variables allow the breadth first search to take place
# Came_from is a hash with a key of a cell and a value of the cell that was expanded from to find the key.
@@ -96,7 +96,7 @@ class Heuristic
# Unless the current step has a value
unless state.current_step
# Set the current step to 10
- state.current_step = 10
+ state.current_step = 10
# And calculate the searches up to step 10
recalculate_searches
end
@@ -106,7 +106,7 @@ class Heuristic
# This step is roughly the grid's width * height
# When anim_steps equals max_steps no more calculations will occur
# and the slider will be at the end
- state.max_steps = grid.width * grid.height
+ state.max_steps = grid.width * grid.height
# Whether the animation should play or not
# If true, every tick moves anim_steps forward one
@@ -199,7 +199,7 @@ class Heuristic
# If the mouse was clicked this tick
if inputs.mouse.down
# Determine what the user is editing and appropriately edit the state.user_input variable
- determine_input
+ determine_input
end
# Process user input based on user_input variable and current mouse position
@@ -212,35 +212,35 @@ class Heuristic
if mouse_over_slider?
state.user_input = :slider
# If the mouse is over the star in the first grid
- elsif bfs_mouse_over_star?
+ elsif bfs_mouse_over_star?
# The user is editing the star from the first grid
- state.user_input = :bfs_star
+ state.user_input = :bfs_star
# If the mouse is over the star in the second grid
- elsif heuristic_mouse_over_star?
+ elsif heuristic_mouse_over_star?
# The user is editing the star from the second grid
- state.user_input = :heuristic_star
+ state.user_input = :heuristic_star
# If the mouse is over the target in the first grid
- elsif bfs_mouse_over_target?
+ elsif bfs_mouse_over_target?
# The user is editing the target from the first grid
- state.user_input = :bfs_target
+ state.user_input = :bfs_target
# If the mouse is over the target in the second grid
- elsif heuristic_mouse_over_target?
+ elsif heuristic_mouse_over_target?
# The user is editing the target from the second grid
- state.user_input = :heuristic_target
+ state.user_input = :heuristic_target
# If the mouse is over a wall in the first grid
- elsif bfs_mouse_over_wall?
+ elsif bfs_mouse_over_wall?
# The user is removing a wall from the first grid
- state.user_input = :bfs_remove_wall
+ state.user_input = :bfs_remove_wall
# If the mouse is over a wall in the second grid
- elsif heuristic_mouse_over_wall?
+ elsif heuristic_mouse_over_wall?
# The user is removing a wall from the second grid
state.user_input = :heuristic_remove_wall
# If the mouse is over the first grid
- elsif bfs_mouse_over_grid?
+ elsif bfs_mouse_over_grid?
# The user is adding a wall from the first grid
state.user_input = :bfs_add_wall
# If the mouse is over the second grid
- elsif heuristic_mouse_over_grid?
+ elsif heuristic_mouse_over_grid?
# The user is adding a wall from the second grid
state.user_input = :heuristic_add_wall
end
@@ -250,22 +250,22 @@ class Heuristic
def process_input
if state.user_input == :slider
process_input_slider
- elsif state.user_input == :bfs_star
- process_input_bfs_star
+ elsif state.user_input == :bfs_star
+ process_input_bfs_star
elsif state.user_input == :heuristic_star
- process_input_heuristic_star
- elsif state.user_input == :bfs_target
- process_input_bfs_target
- elsif state.user_input == :heuristic_target
- process_input_heuristic_target
- elsif state.user_input == :bfs_remove_wall
- process_input_bfs_remove_wall
+ process_input_heuristic_star
+ elsif state.user_input == :bfs_target
+ process_input_bfs_target
+ elsif state.user_input == :heuristic_target
+ process_input_heuristic_target
+ elsif state.user_input == :bfs_remove_wall
+ process_input_bfs_remove_wall
elsif state.user_input == :heuristic_remove_wall
- process_input_heuristic_remove_wall
- elsif state.user_input == :bfs_add_wall
- process_input_bfs_add_wall
- elsif state.user_input == :heuristic_add_wall
- process_input_heuristic_add_wall
+ process_input_heuristic_remove_wall
+ elsif state.user_input == :bfs_add_wall
+ process_input_bfs_add_wall
+ elsif state.user_input == :heuristic_add_wall
+ process_input_heuristic_add_wall
end
end
@@ -342,7 +342,7 @@ class Heuristic
# The horizontal grid lines
for y in 0..grid.height
- outputs.lines << bfs_horizontal_line(y)
+ outputs.lines << bfs_horizontal_line(y)
end
end
@@ -357,10 +357,10 @@ class Heuristic
# The horizontal grid lines
for y in 0..grid.height
- outputs.lines << heuristic_horizontal_line(y)
+ outputs.lines << heuristic_horizontal_line(y)
end
end
-
+
# Returns a vertical line for a column of the first grid
def bfs_vertical_line column
bfs_scale_up([column, 0, column, grid.height])
@@ -395,7 +395,7 @@ class Heuristic
def render_bfs_target
outputs.sprites << [bfs_scale_up(grid.target), 'target.png']
end
-
+
# Renders the target on the second grid
def render_heuristic_target
outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']
@@ -403,14 +403,14 @@ class Heuristic
# Renders the walls on the first grid
def render_bfs_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [bfs_scale_up(wall), wall_color]
end
end
# Renders the walls on the second grid
def render_heuristic_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [heuristic_scale_up(wall), wall_color]
end
end
@@ -431,14 +431,14 @@ class Heuristic
# Renders the frontier cells on the first grid
def render_bfs_frontier
- bfs.frontier.each do | frontier_cell |
+ bfs.frontier.each do | frontier_cell |
outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]
end
end
# Renders the frontier cells on the second grid
def render_heuristic_frontier
- heuristic.frontier.each do | frontier_cell |
+ heuristic.frontier.each do | frontier_cell |
outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]
end
end
@@ -522,14 +522,14 @@ class Heuristic
# Checks and handles input for the buttons
# Called when the mouse is lifted
def input_buttons
- input_left_button
- input_center_button
- input_right_button
+ input_left_button
+ input_center_button
+ input_right_button
end
# Checks if the previous step button is clicked
# If it is, it pauses the animation and moves the search one step backward
- def input_left_button
+ def input_left_button
if left_button_clicked?
state.play = false
state.current_step -= 1
@@ -541,7 +541,7 @@ class Heuristic
# Inverses whether the animation is playing or not when clicked
def input_center_button
if center_button_clicked? || inputs.keyboard.key_down.space
- state.play = !state.play
+ state.play = !state.play
end
end
@@ -549,8 +549,8 @@ class Heuristic
# If it is, it pauses the animation and moves the search one step forward
def input_right_button
if right_button_clicked?
- state.play = false
- state.current_step += 1
+ state.play = false
+ state.current_step += 1
move_searches_one_step_forward
end
end
@@ -631,12 +631,12 @@ class Heuristic
# on the slider
# Changes the step of the search to be animated
def process_input_slider
- state.play = false
+ state.play = false
mouse_x = inputs.mouse.point.x
# Bounds the mouse_x to the closest x value on the slider line
- mouse_x = slider.x if mouse_x < slider.x
- mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w
+ mouse_x = slider.x if mouse_x < slider.x
+ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w
# Sets the current search step to the one represented by the mouse x value
# The slider's circle moves due to the render_slider method using anim_steps
@@ -649,12 +649,12 @@ class Heuristic
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def process_input_bfs_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless bfs_cell_closest_to_mouse == grid.target
- grid.star = bfs_cell_closest_to_mouse
+ grid.star = bfs_cell_closest_to_mouse
end
- unless old_star == grid.star
- recalculate_searches
+ unless old_star == grid.star
+ recalculate_searches
end
end
@@ -662,12 +662,12 @@ class Heuristic
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def process_input_heuristic_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless heuristic_cell_closest_to_mouse == grid.target
grid.star = heuristic_cell_closest_to_mouse
end
- unless old_star == grid.star
- recalculate_searches
+ unless old_star == grid.star
+ recalculate_searches
end
end
@@ -675,12 +675,12 @@ class Heuristic
# Only recalculate_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_bfs_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless bfs_cell_closest_to_mouse == grid.star
grid.target = bfs_cell_closest_to_mouse
end
- unless old_target == grid.target
- recalculate_searches
+ unless old_target == grid.target
+ recalculate_searches
end
end
@@ -688,12 +688,12 @@ class Heuristic
# Only recalculate_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_heuristic_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless heuristic_cell_closest_to_mouse == grid.star
grid.target = heuristic_cell_closest_to_mouse
end
- unless old_target == grid.target
- recalculate_searches
+ unless old_target == grid.target
+ recalculate_searches
end
end
@@ -702,10 +702,10 @@ class Heuristic
# 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
- if bfs_mouse_over_grid?
+ if bfs_mouse_over_grid?
if grid.walls.has_key?(bfs_cell_closest_to_mouse)
- grid.walls.delete(bfs_cell_closest_to_mouse)
- recalculate_searches
+ grid.walls.delete(bfs_cell_closest_to_mouse)
+ recalculate_searches
end
end
end
@@ -715,29 +715,29 @@ class Heuristic
# 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
- if heuristic_mouse_over_grid?
+ if heuristic_mouse_over_grid?
if grid.walls.has_key?(heuristic_cell_closest_to_mouse)
- grid.walls.delete(heuristic_cell_closest_to_mouse)
- recalculate_searches
+ grid.walls.delete(heuristic_cell_closest_to_mouse)
+ recalculate_searches
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def process_input_bfs_add_wall
- if bfs_mouse_over_grid?
+ if bfs_mouse_over_grid?
unless grid.walls.has_key?(bfs_cell_closest_to_mouse)
- grid.walls[bfs_cell_closest_to_mouse] = true
- recalculate_searches
+ grid.walls[bfs_cell_closest_to_mouse] = true
+ recalculate_searches
end
end
end
# Adds a wall in the second grid in the cell the mouse is over
def process_input_heuristic_add_wall
- if heuristic_mouse_over_grid?
+ if heuristic_mouse_over_grid?
unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)
- grid.walls[heuristic_cell_closest_to_mouse] = true
- recalculate_searches
+ grid.walls[heuristic_cell_closest_to_mouse] = true
+ recalculate_searches
end
end
end
@@ -747,13 +747,13 @@ class Heuristic
# Finding the cell closest to the mouse helps with this
def bfs_cell_closest_to_mouse
# Closest cell to the mouse in the first grid
- x = (inputs.mouse.point.x / grid.cell_size).to_i
- y = (inputs.mouse.point.y / grid.cell_size).to_i
+ x = (inputs.mouse.point.x / grid.cell_size).to_i
+ y = (inputs.mouse.point.y / grid.cell_size).to_i
# Bound x and y to the grid
- x = grid.width - 1 if x > grid.width - 1
- y = grid.height - 1 if y > grid.height - 1
+ x = grid.width - 1 if x > grid.width - 1
+ y = grid.height - 1 if y > grid.height - 1
# Return closest cell
- [x, y]
+ [x, y]
end
# When the user grabs the star and puts their cursor to the far right
@@ -761,17 +761,17 @@ class Heuristic
# Finding the cell closest to the mouse in the second grid helps with this
def heuristic_cell_closest_to_mouse
# Closest cell grid to the mouse in the second
- x = (inputs.mouse.point.x / grid.cell_size).to_i
- y = (inputs.mouse.point.y / grid.cell_size).to_i
+ x = (inputs.mouse.point.x / grid.cell_size).to_i
+ y = (inputs.mouse.point.y / grid.cell_size).to_i
# Translate the cell to the first grid
x -= grid.width + 1
# Bound x and y to the first grid
x = 0 if x < 0
y = 0 if y < 0
- x = grid.width - 1 if x > grid.width - 1
- y = grid.height - 1 if y > grid.height - 1
+ x = grid.width - 1 if x > grid.width - 1
+ y = grid.height - 1 if y > grid.height - 1
# Return closest cell
- [x, y]
+ [x, y]
end
def recalculate_searches
@@ -796,22 +796,22 @@ class Heuristic
return if bfs.came_from.has_key?(grid.target)
# Only runs at the beginning of the search as setup.
- if bfs.came_from.empty?
- bfs.frontier << grid.star
- bfs.came_from[grid.star] = nil
+ if bfs.came_from.empty?
+ bfs.frontier << grid.star
+ bfs.came_from[grid.star] = nil
end
# A step in the search
- unless bfs.frontier.empty?
+ unless bfs.frontier.empty?
# Takes the next frontier cell
- new_frontier = bfs.frontier.shift
+ new_frontier = bfs.frontier.shift
# For each of its neighbors
- adjacent_neighbors(new_frontier).each do |neighbor|
+ adjacent_neighbors(new_frontier).each do |neighbor|
# That have not been visited and are not walls
- unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- bfs.frontier << neighbor
- bfs.came_from[neighbor] = new_frontier
+ bfs.frontier << neighbor
+ bfs.came_from[neighbor] = new_frontier
end
end
end
@@ -866,12 +866,12 @@ class Heuristic
# Get the next cell to explore from
new_frontier = heuristic.frontier.shift
# For each of its neighbors
- adjacent_neighbors(new_frontier).each do |neighbor|
+ adjacent_neighbors(new_frontier).each do |neighbor|
# That have not been visited and are not walls
- unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- heuristic.frontier << neighbor
- heuristic.came_from[neighbor] = new_frontier
+ heuristic.frontier << neighbor
+ heuristic.came_from[neighbor] = new_frontier
end
end
end
@@ -915,16 +915,16 @@ class Heuristic
# Returns a list of adjacent cells
# Used to determine what the next cells to be added to the frontier are
def adjacent_neighbors(cell)
- neighbors = []
+ neighbors = []
# Gets all the valid neighbors into the array
# From southern neighbor, clockwise
- neighbors << [cell.x , cell.y - 1] unless cell.y == 0
- neighbors << [cell.x - 1, cell.y ] unless cell.x == 0
- neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1
- neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1
+ neighbors << [cell.x , cell.y - 1] unless cell.y == 0
+ neighbors << [cell.x - 1, cell.y ] unless cell.x == 0
+ neighbors << [cell.x , cell.y + 1] unless cell.y == grid.height - 1
+ neighbors << [cell.x + 1, cell.y ] unless cell.x == grid.width - 1
- neighbors
+ neighbors
end
# Finds the vertical and horizontal distance of a cell from the star
@@ -973,7 +973,7 @@ class Heuristic
def wall_color
[134, 134, 120] # Camo Green
end
-
+
def visited_color
[204, 191, 179] # Dark Brown
end
@@ -981,7 +981,7 @@ class Heuristic
def frontier_color
[103, 136, 204] # Blue
end
-
+
def path_color
[231, 230, 228] # Pastel White
end
@@ -1002,7 +1002,7 @@ def tick args
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $heuristic ||= Heuristic.new(args)
+ $heuristic ||= Heuristic.new
$heuristic.args = args
$heuristic.tick
end
diff --git a/samples/13_path_finding_algorithms/07_heuristic_with_walls/replay.txt b/samples/13_path_finding_algorithms/07_heuristic_with_walls/replay.txt
new file mode 100644
index 0000000..4c5a2a6
--- /dev/null
+++ b/samples/13_path_finding_algorithms/07_heuristic_with_walls/replay.txt
@@ -0,0 +1,352 @@
+replay_version 2.0
+stopped_at 637
+seed 100
+recorded_at 2021-11-20 11:23:35 -0600
+[:mouse_button_up, 1, 0, 1, 1, 2]
+[:mouse_move, 777, 81, 2, 2, 5]
+[:mouse_move, 778, 83, 2, 3, 23]
+[:mouse_move, 778, 91, 2, 4, 24]
+[:mouse_move, 778, 97, 2, 5, 25]
+[:mouse_move, 778, 101, 2, 6, 26]
+[:mouse_move, 777, 106, 2, 7, 26]
+[:mouse_move, 774, 112, 2, 8, 27]
+[:mouse_move, 769, 116, 2, 9, 28]
+[:mouse_move, 765, 119, 2, 10, 29]
+[:mouse_move, 763, 120, 2, 11, 29]
+[:mouse_move, 762, 120, 2, 12, 30]
+[:mouse_move, 761, 121, 2, 13, 31]
+[:mouse_move, 761, 122, 2, 14, 32]
+[:mouse_move, 760, 123, 2, 15, 32]
+[:mouse_move, 760, 124, 2, 16, 33]
+[:mouse_move, 759, 125, 2, 17, 34]
+[:mouse_move, 758, 126, 2, 18, 36]
+[:mouse_move, 757, 126, 2, 19, 37]
+[:mouse_move, 754, 127, 2, 20, 38]
+[:mouse_move, 753, 127, 2, 21, 39]
+[:mouse_move, 752, 127, 2, 22, 40]
+[:mouse_move, 753, 127, 2, 23, 56]
+[:mouse_move, 752, 127, 2, 24, 65]
+[:mouse_move, 745, 127, 2, 25, 66]
+[:mouse_move, 737, 127, 2, 26, 67]
+[:mouse_move, 726, 125, 2, 27, 68]
+[:mouse_move, 716, 122, 2, 28, 68]
+[:mouse_move, 709, 120, 2, 29, 69]
+[:mouse_move, 697, 117, 2, 30, 70]
+[:mouse_move, 691, 115, 2, 31, 71]
+[:mouse_move, 689, 114, 2, 32, 72]
+[:mouse_move, 686, 113, 2, 33, 72]
+[:mouse_move, 686, 112, 2, 34, 73]
+[:mouse_move, 685, 112, 2, 35, 74]
+[:mouse_move, 684, 112, 2, 36, 75]
+[:mouse_move, 683, 112, 2, 37, 76]
+[:mouse_move, 682, 111, 2, 38, 77]
+[:mouse_move, 679, 110, 2, 39, 77]
+[:mouse_move, 674, 108, 2, 40, 78]
+[:mouse_move, 665, 104, 2, 41, 79]
+[:mouse_move, 660, 101, 2, 42, 80]
+[:mouse_move, 657, 101, 2, 43, 81]
+[:mouse_move, 657, 100, 2, 44, 89]
+[:mouse_button_pressed, 1, 0, 1, 45, 109]
+[:mouse_button_up, 1, 0, 1, 46, 113]
+[:mouse_button_pressed, 1, 0, 1, 47, 228]
+[:mouse_button_up, 1, 0, 1, 48, 229]
+[:mouse_move, 657, 99, 2, 49, 240]
+[:mouse_move, 656, 96, 2, 50, 240]
+[:mouse_move, 655, 95, 2, 51, 240]
+[:mouse_move, 654, 94, 2, 52, 241]
+[:mouse_move, 654, 87, 2, 53, 242]
+[:mouse_move, 654, 80, 2, 54, 242]
+[:mouse_move, 654, 74, 2, 55, 242]
+[:mouse_move, 654, 69, 2, 56, 242]
+[:mouse_move, 654, 67, 2, 57, 243]
+[:mouse_move, 654, 63, 2, 58, 243]
+[:mouse_move, 654, 62, 2, 59, 244]
+[:mouse_move, 653, 61, 2, 60, 244]
+[:mouse_move, 651, 61, 2, 61, 245]
+[:mouse_move, 648, 60, 2, 62, 246]
+[:mouse_move, 645, 60, 2, 63, 246]
+[:mouse_move, 637, 57, 2, 64, 246]
+[:mouse_move, 633, 55, 2, 65, 246]
+[:mouse_move, 626, 53, 2, 66, 247]
+[:mouse_move, 620, 51, 2, 67, 247]
+[:mouse_move, 593, 47, 2, 68, 247]
+[:mouse_move, 580, 45, 2, 69, 248]
+[:mouse_move, 577, 45, 2, 70, 248]
+[:mouse_move, 576, 45, 2, 71, 248]
+[:mouse_move, 576, 44, 2, 72, 251]
+[:mouse_button_pressed, 1, 0, 1, 73, 251]
+[:mouse_button_up, 1, 0, 1, 74, 253]
+[:mouse_move, 577, 44, 2, 75, 257]
+[:mouse_move, 578, 45, 2, 76, 257]
+[:mouse_move, 584, 45, 2, 77, 258]
+[:mouse_move, 594, 47, 2, 78, 258]
+[:mouse_move, 606, 48, 2, 79, 258]
+[:mouse_move, 619, 50, 2, 80, 259]
+[:mouse_move, 627, 50, 2, 81, 259]
+[:mouse_move, 629, 50, 2, 82, 259]
+[:mouse_move, 630, 50, 2, 83, 259]
+[:mouse_move, 631, 50, 2, 84, 260]
+[:mouse_move, 632, 50, 2, 85, 261]
+[:mouse_button_pressed, 1, 0, 1, 86, 263]
+[:mouse_move, 629, 50, 2, 87, 264]
+[:mouse_move, 624, 50, 2, 88, 264]
+[:mouse_move, 617, 50, 2, 89, 264]
+[:mouse_move, 612, 50, 2, 90, 264]
+[:mouse_move, 609, 50, 2, 91, 264]
+[:mouse_move, 607, 50, 2, 92, 264]
+[:mouse_move, 603, 49, 2, 93, 264]
+[:mouse_move, 600, 49, 2, 94, 264]
+[:mouse_move, 597, 48, 2, 95, 265]
+[:mouse_move, 595, 48, 2, 96, 265]
+[:mouse_move, 594, 48, 2, 97, 265]
+[:mouse_move, 593, 48, 2, 98, 265]
+[:mouse_move, 592, 48, 2, 99, 265]
+[:mouse_move, 590, 48, 2, 100, 265]
+[:mouse_move, 587, 48, 2, 101, 265]
+[:mouse_move, 582, 48, 2, 102, 265]
+[:mouse_move, 575, 48, 2, 103, 265]
+[:mouse_move, 571, 47, 2, 104, 265]
+[:mouse_move, 568, 47, 2, 105, 265]
+[:mouse_move, 567, 47, 2, 106, 266]
+[:mouse_move, 566, 47, 2, 107, 266]
+[:mouse_move, 565, 46, 2, 108, 266]
+[:mouse_move, 564, 46, 2, 109, 266]
+[:mouse_move, 563, 46, 2, 110, 266]
+[:mouse_move, 562, 46, 2, 111, 266]
+[:mouse_move, 561, 46, 2, 112, 266]
+[:mouse_move, 560, 46, 2, 113, 267]
+[:mouse_move, 559, 46, 2, 114, 267]
+[:mouse_move, 558, 46, 2, 115, 267]
+[:mouse_move, 555, 46, 2, 116, 268]
+[:mouse_move, 551, 46, 2, 117, 268]
+[:mouse_move, 549, 46, 2, 118, 268]
+[:mouse_move, 548, 46, 2, 119, 268]
+[:mouse_move, 547, 46, 2, 120, 268]
+[:mouse_move, 546, 46, 2, 121, 269]
+[:mouse_move, 545, 46, 2, 122, 269]
+[:mouse_move, 540, 46, 2, 123, 269]
+[:mouse_move, 534, 46, 2, 124, 269]
+[:mouse_move, 531, 46, 2, 125, 269]
+[:mouse_move, 527, 46, 2, 126, 269]
+[:mouse_move, 525, 46, 2, 127, 269]
+[:mouse_button_up, 1, 0, 1, 128, 276]
+[:mouse_move, 526, 47, 2, 129, 287]
+[:mouse_move, 527, 47, 2, 130, 288]
+[:mouse_move, 528, 48, 2, 131, 290]
+[:mouse_move, 531, 51, 2, 132, 290]
+[:mouse_move, 534, 54, 2, 133, 290]
+[:mouse_move, 539, 61, 2, 134, 291]
+[:mouse_move, 548, 71, 2, 135, 291]
+[:mouse_move, 558, 81, 2, 136, 292]
+[:mouse_move, 570, 94, 2, 137, 292]
+[:mouse_move, 585, 110, 2, 138, 293]
+[:mouse_move, 595, 123, 2, 139, 293]
+[:mouse_move, 607, 136, 2, 140, 293]
+[:mouse_move, 618, 146, 2, 141, 294]
+[:mouse_move, 626, 154, 2, 142, 295]
+[:mouse_move, 632, 161, 2, 143, 295]
+[:mouse_move, 633, 162, 2, 144, 296]
+[:mouse_move, 633, 163, 2, 145, 296]
+[:mouse_move, 634, 164, 2, 146, 296]
+[:mouse_move, 634, 165, 2, 147, 297]
+[:mouse_move, 635, 168, 2, 148, 297]
+[:mouse_move, 635, 172, 2, 149, 298]
+[:mouse_move, 635, 178, 2, 150, 299]
+[:mouse_move, 635, 182, 2, 151, 299]
+[:mouse_move, 635, 183, 2, 152, 299]
+[:mouse_move, 635, 184, 2, 153, 300]
+[:mouse_move, 634, 187, 2, 154, 300]
+[:mouse_move, 632, 191, 2, 155, 301]
+[:mouse_move, 629, 193, 2, 156, 301]
+[:mouse_move, 627, 194, 2, 157, 302]
+[:mouse_move, 625, 194, 2, 158, 302]
+[:mouse_move, 625, 195, 2, 159, 303]
+[:mouse_move, 624, 195, 2, 160, 304]
+[:mouse_move, 619, 195, 2, 161, 305]
+[:mouse_move, 608, 195, 2, 162, 305]
+[:mouse_move, 597, 194, 2, 163, 305]
+[:mouse_move, 584, 188, 2, 164, 306]
+[:mouse_move, 572, 180, 2, 165, 307]
+[:mouse_move, 563, 173, 2, 166, 307]
+[:mouse_move, 556, 166, 2, 167, 308]
+[:mouse_move, 550, 160, 2, 168, 308]
+[:mouse_move, 548, 157, 2, 169, 308]
+[:mouse_move, 547, 154, 2, 170, 309]
+[:mouse_move, 542, 149, 2, 171, 309]
+[:mouse_move, 538, 142, 2, 172, 310]
+[:mouse_move, 533, 134, 2, 173, 310]
+[:mouse_move, 531, 132, 2, 174, 311]
+[:mouse_move, 530, 132, 2, 175, 311]
+[:mouse_move, 530, 131, 2, 176, 312]
+[:mouse_move, 528, 129, 2, 177, 312]
+[:mouse_move, 524, 127, 2, 178, 312]
+[:mouse_move, 523, 126, 2, 179, 313]
+[:mouse_move, 522, 126, 2, 180, 314]
+[:mouse_move, 520, 124, 2, 181, 314]
+[:mouse_move, 512, 118, 2, 182, 315]
+[:mouse_move, 502, 112, 2, 183, 316]
+[:mouse_move, 498, 108, 2, 184, 316]
+[:mouse_move, 495, 107, 2, 185, 317]
+[:mouse_move, 495, 106, 2, 186, 317]
+[:mouse_move, 493, 105, 2, 187, 317]
+[:mouse_move, 493, 104, 2, 188, 318]
+[:mouse_move, 492, 104, 2, 189, 318]
+[:mouse_move, 492, 103, 2, 190, 319]
+[:mouse_button_pressed, 1, 0, 1, 191, 326]
+[:mouse_button_up, 1, 0, 1, 192, 328]
+[:mouse_button_pressed, 1, 0, 1, 193, 339]
+[:mouse_button_up, 1, 0, 1, 194, 342]
+[:mouse_button_pressed, 1, 0, 1, 195, 343]
+[:mouse_button_up, 1, 0, 1, 196, 344]
+[:mouse_button_pressed, 1, 0, 1, 197, 345]
+[:mouse_button_up, 1, 0, 1, 198, 347]
+[:mouse_move, 493, 103, 2, 199, 348]
+[:mouse_move, 497, 103, 2, 200, 348]
+[:mouse_move, 507, 103, 2, 201, 348]
+[:mouse_move, 522, 103, 2, 202, 349]
+[:mouse_move, 542, 103, 2, 203, 349]
+[:mouse_move, 566, 103, 2, 204, 350]
+[:mouse_move, 595, 103, 2, 205, 350]
+[:mouse_move, 627, 103, 2, 206, 351]
+[:mouse_move, 655, 103, 2, 207, 351]
+[:mouse_move, 678, 103, 2, 208, 352]
+[:mouse_move, 693, 103, 2, 209, 352]
+[:mouse_move, 698, 103, 2, 210, 353]
+[:mouse_move, 699, 103, 2, 211, 353]
+[:mouse_move, 702, 103, 2, 212, 354]
+[:mouse_move, 704, 103, 2, 213, 354]
+[:mouse_move, 708, 103, 2, 214, 354]
+[:mouse_move, 709, 103, 2, 215, 355]
+[:mouse_move, 711, 103, 2, 216, 356]
+[:mouse_move, 714, 103, 2, 217, 357]
+[:mouse_move, 715, 103, 2, 218, 357]
+[:mouse_move, 719, 103, 2, 219, 357]
+[:mouse_move, 721, 103, 2, 220, 358]
+[:mouse_move, 723, 103, 2, 221, 359]
+[:mouse_move, 724, 103, 2, 222, 359]
+[:mouse_move, 725, 103, 2, 223, 364]
+[:mouse_move, 729, 101, 2, 224, 365]
+[:mouse_move, 732, 101, 2, 225, 365]
+[:mouse_move, 734, 100, 2, 226, 366]
+[:mouse_move, 735, 99, 2, 227, 367]
+[:mouse_button_pressed, 1, 0, 1, 228, 368]
+[:mouse_button_up, 1, 0, 1, 229, 371]
+[:mouse_button_pressed, 1, 0, 1, 230, 373]
+[:mouse_button_up, 1, 0, 1, 231, 375]
+[:mouse_button_pressed, 1, 0, 1, 232, 378]
+[:mouse_button_up, 1, 0, 1, 233, 380]
+[:mouse_button_pressed, 1, 0, 1, 234, 383]
+[:mouse_button_up, 1, 0, 1, 235, 385]
+[:mouse_button_pressed, 1, 0, 1, 236, 387]
+[:mouse_button_up, 1, 0, 1, 237, 389]
+[:mouse_move, 736, 99, 2, 238, 390]
+[:mouse_button_pressed, 1, 0, 1, 239, 392]
+[:mouse_button_up, 1, 0, 1, 240, 395]
+[:mouse_button_pressed, 1, 0, 1, 241, 432]
+[:mouse_button_up, 1, 0, 1, 242, 434]
+[:mouse_move, 736, 103, 2, 243, 446]
+[:mouse_move, 736, 113, 2, 244, 446]
+[:mouse_move, 734, 125, 2, 245, 447]
+[:mouse_move, 732, 140, 2, 246, 447]
+[:mouse_move, 726, 158, 2, 247, 448]
+[:mouse_move, 718, 174, 2, 248, 448]
+[:mouse_move, 712, 193, 2, 249, 448]
+[:mouse_move, 709, 203, 2, 250, 449]
+[:mouse_move, 709, 208, 2, 251, 449]
+[:mouse_move, 708, 211, 2, 252, 450]
+[:mouse_move, 708, 212, 2, 253, 451]
+[:mouse_move, 708, 213, 2, 254, 451]
+[:mouse_move, 707, 215, 2, 255, 451]
+[:mouse_move, 704, 217, 2, 256, 452]
+[:mouse_move, 700, 221, 2, 257, 452]
+[:mouse_move, 698, 223, 2, 258, 453]
+[:mouse_move, 697, 223, 2, 259, 454]
+[:mouse_move, 699, 223, 2, 260, 455]
+[:mouse_move, 700, 222, 2, 261, 455]
+[:mouse_move, 701, 222, 2, 262, 456]
+[:mouse_move, 702, 222, 2, 263, 456]
+[:mouse_move, 702, 221, 2, 264, 457]
+[:mouse_button_pressed, 1, 0, 1, 265, 458]
+[:mouse_button_up, 1, 0, 1, 266, 459]
+[:mouse_move, 695, 221, 2, 267, 468]
+[:mouse_move, 684, 221, 2, 268, 469]
+[:mouse_move, 673, 221, 2, 269, 469]
+[:mouse_move, 663, 221, 2, 270, 470]
+[:mouse_move, 656, 221, 2, 271, 470]
+[:mouse_move, 655, 221, 2, 272, 471]
+[:mouse_button_pressed, 1, 0, 1, 273, 475]
+[:mouse_button_up, 1, 0, 1, 274, 476]
+[:mouse_move, 657, 218, 2, 275, 479]
+[:mouse_move, 661, 213, 2, 276, 479]
+[:mouse_move, 670, 201, 2, 277, 479]
+[:mouse_move, 679, 190, 2, 278, 479]
+[:mouse_move, 687, 178, 2, 279, 480]
+[:mouse_move, 695, 165, 2, 280, 481]
+[:mouse_move, 703, 151, 2, 281, 481]
+[:mouse_move, 712, 139, 2, 282, 482]
+[:mouse_move, 720, 129, 2, 283, 482]
+[:mouse_move, 727, 121, 2, 284, 482]
+[:mouse_move, 735, 111, 2, 285, 483]
+[:mouse_move, 737, 108, 2, 286, 483]
+[:mouse_move, 739, 105, 2, 287, 484]
+[:mouse_move, 739, 104, 2, 288, 484]
+[:mouse_move, 740, 103, 2, 289, 485]
+[:mouse_move, 740, 102, 2, 290, 485]
+[:mouse_move, 740, 101, 2, 291, 486]
+[:mouse_move, 740, 100, 2, 292, 488]
+[:mouse_button_pressed, 1, 0, 1, 293, 489]
+[:mouse_move, 740, 99, 2, 294, 490]
+[:mouse_button_up, 1, 0, 1, 295, 491]
+[:mouse_button_pressed, 1, 0, 1, 296, 493]
+[:mouse_move, 740, 100, 2, 297, 493]
+[:mouse_button_up, 1, 0, 1, 298, 496]
+[:mouse_button_pressed, 1, 0, 1, 299, 498]
+[:mouse_button_up, 1, 0, 1, 300, 500]
+[:mouse_button_pressed, 1, 0, 1, 301, 502]
+[:mouse_button_up, 1, 0, 1, 302, 505]
+[:mouse_button_pressed, 1, 0, 1, 303, 508]
+[:mouse_button_up, 1, 0, 1, 304, 509]
+[:mouse_button_pressed, 1, 0, 1, 305, 511]
+[:mouse_button_up, 1, 0, 1, 306, 514]
+[:mouse_button_pressed, 1, 0, 1, 307, 516]
+[:mouse_button_up, 1, 0, 1, 308, 518]
+[:mouse_button_pressed, 1, 0, 1, 309, 520]
+[:mouse_button_up, 1, 0, 1, 310, 522]
+[:mouse_button_pressed, 1, 0, 1, 311, 524]
+[:mouse_button_up, 1, 0, 1, 312, 526]
+[:mouse_move, 738, 100, 2, 313, 528]
+[:mouse_move, 732, 101, 2, 314, 528]
+[:mouse_move, 715, 101, 2, 315, 529]
+[:mouse_move, 690, 101, 2, 316, 529]
+[:mouse_move, 677, 101, 2, 317, 530]
+[:mouse_move, 666, 101, 2, 318, 530]
+[:mouse_move, 662, 101, 2, 319, 531]
+[:mouse_move, 661, 101, 2, 320, 531]
+[:mouse_button_pressed, 1, 0, 1, 321, 534]
+[:mouse_button_up, 1, 0, 1, 322, 536]
+[:mouse_move, 660, 100, 2, 323, 550]
+[:mouse_move, 661, 100, 2, 324, 550]
+[:mouse_move, 662, 100, 2, 325, 553]
+[:key_down_raw, 96, 0, 2, 326, 615]
+[:key_up_raw, 96, 0, 2, 327, 616]
+[:mouse_move, 660, 102, 2, 328, 625]
+[:mouse_move, 657, 104, 2, 329, 626]
+[:mouse_move, 655, 107, 2, 330, 626]
+[:mouse_move, 653, 110, 2, 331, 626]
+[:mouse_move, 653, 117, 2, 332, 626]
+[:mouse_move, 655, 122, 2, 333, 626]
+[:mouse_move, 658, 124, 2, 334, 627]
+[:mouse_move, 664, 126, 2, 335, 627]
+[:mouse_move, 671, 128, 2, 336, 627]
+[:mouse_move, 681, 133, 2, 337, 627]
+[:mouse_move, 693, 141, 2, 338, 628]
+[:mouse_move, 710, 154, 2, 339, 628]
+[:mouse_move, 731, 167, 2, 340, 628]
+[:mouse_move, 753, 176, 2, 341, 628]
+[:mouse_move, 772, 181, 2, 342, 629]
+[:mouse_move, 786, 182, 2, 343, 629]
+[:mouse_move, 791, 184, 2, 344, 629]
+[:mouse_move, 790, 185, 2, 345, 629]
+[:mouse_move, 789, 187, 2, 346, 630]
+[:mouse_move, 788, 187, 2, 347, 630]
+[:key_down_raw, 13, 0, 2, 348, 637]