summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorAmir Rajan <[email protected]>2021-12-10 00:09:48 -0600
committerAmir Rajan <[email protected]>2021-12-10 00:09:48 -0600
commiteaa29e72939f5edf61735ccbb73c36ee89369f65 (patch)
treec310fac2e39bd799bf7fc1f73d35c12bcc5187b7 /docs
parent33dfdde9ae03e3218b4796f3595d3b727f626587 (diff)
downloaddragonruby-game-toolkit-contrib-eaa29e72939f5edf61735ccbb73c36ee89369f65.tar.gz
dragonruby-game-toolkit-contrib-eaa29e72939f5edf61735ccbb73c36ee89369f65.zip
Synced with DragonRuby Game Toolkit v3.2.
Diffstat (limited to 'docs')
-rw-r--r--docs/docs.css12
-rw-r--r--docs/docs.html2838
-rw-r--r--docs/docs.txt3724
-rw-r--r--docs/parse_log.txt15673
-rw-r--r--docs/todo/05-sprites.md20
5 files changed, 17106 insertions, 5161 deletions
diff --git a/docs/docs.css b/docs/docs.css
index 115fd34..84cd977 100644
--- a/docs/docs.css
+++ b/docs/docs.css
@@ -127,30 +127,30 @@ blockquote {
font-style: italic;
}
-#toc {
+#table-of-contents {
font-size: 14px;
}
-#toc ul {
+#table-of-contents ul {
margin-left: 3px;
padding-left: 15px;
}
-#toc .header-1 {
+#table-of-contents .header-1 {
display: inline-block;
margin-top: 10px;
font-weight: 900;
}
-#toc .header-2 {
+#table-of-contents .header-2 {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
margin-top: 10px;
}
-#toc .header-3 {
+#table-of-contents .header-3 {
}
@media only screen and (min-width: 1280px) {
@@ -160,7 +160,7 @@ blockquote {
padding-left: 310px;
}
- #toc {
+ #table-of-contents {
border: solid 1px #f0f0f0;
padding: 10px;
padding-bottom: 30px;
diff --git a/docs/docs.html b/docs/docs.html
index 6967368..67cd054 100644
--- a/docs/docs.html
+++ b/docs/docs.html
@@ -2,10 +2,10 @@
<head>
<meta charset="utf-8">
<title>DragonRuby Game Toolkit Documentation</title>
- <link href="docs.css?ver=1629947615" rel="stylesheet" type="text/css" media="all">
+ <link href="docs.css?ver=1637820563" rel="stylesheet" type="text/css" media="all">
</head>
<body>
- <div id='toc'>
+ <div id='table-of-contents'>
<h1>Table Of Contents</h1>
<ul>
<li><a class='header-1' href='#--dragonruby-game-toolkit-live-docs'>DragonRuby Game Toolkit Live Docs</a></li>
@@ -23,6 +23,7 @@
<ul><li><a class='header-2' href='#----args-state-'><code>args.state</code></a></li></ul><ul><ul><li><a class='header-3' href='#--------entity_id-'><code>.*.entity_id</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#--------entity_type-'><code>.*.entity_type</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#--------created_at-'><code>.*.created_at</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#--------created_at_elapsed-'><code>.*.created_at_elapsed</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#--------global_created_at-'><code>.*.global_created_at</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#--------global_created_at_elapsed-'><code>.*.global_created_at_elapsed</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#--------as_hash-'><code>.*.as_hash</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------new_entity-'><code>.new_entity</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------new_entity_strict-'><code>.new_entity_strict</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------tick_count-'><code>.tick_count</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-inputs-'><code>args.inputs</code></a></li></ul><ul><ul><li><a class='header-3' href='#------up-'><code>.up</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------down-'><code>.down</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------left-'><code>.left</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------right-'><code>.right</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------left_right-'><code>.left_right</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------up_down-'><code>.up_down</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------text--or---history-'><code>.text</code> OR <code>.history</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------mouse-'><code>.mouse</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------controller_one-----controller_two-'><code>.controller_one</code>, <code>.controller_two</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------keyboard-'><code>.keyboard</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-outputs-'><code>args.outputs</code></a></li></ul><ul><ul><li><a class='header-3' href='#------background_color-'><code>.background_color</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------sounds-'><code>.sounds</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------solids-'><code>.solids</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------static_solids-'><code>.static_solids</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------sprites-----static_sprites-'><code>.sprites</code>, <code>.static_sprites</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------primitives-----static_primitives-'><code>.primitives</code>, <code>.static_primitives</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------labels-----static_labels-'><code>.labels</code>, <code>.static_labels</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------lines-----static_lines-'><code>.lines</code>, <code>.static_lines</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------borders-----static_borders-'><code>.borders</code>, <code>.static_borders</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------debug-----static_debug-'><code>.debug</code>, <code>.static_debug</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-geometry-'><code>args.geometry</code></a></li></ul><ul><ul><li><a class='header-3' href='#------inside_rect--rect_1--rect_2-'><code>.inside_rect? rect_1, rect_2</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------intersect_rect--rect_2--rect_2-'><code>.intersect_rect? rect_2, rect_2</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------scale_rect-rect--x_percentage--y_percentage-'><code>.scale_rect rect, x_percentage, y_percentage</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------angle_to-start_point--end_point-'><code>.angle_to start_point, end_point</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------angle_from-start_point--end_point-'><code>.angle_from start_point, end_point</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------point_inside_circle--point--circle_center_point--radius-'><code>.point_inside_circle? point, circle_center_point, radius</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------center_inside_rect-rect--other_rect-'><code>.center_inside_rect rect, other_rect</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------center_inside_rect_x-rect--other_rect-'><code>.center_inside_rect_x rect, other_rect</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------center_inside_rect_y-rect--other_rect-'><code>.center_inside_rect_y rect, other_rect</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------anchor_rect-rect--anchor_x--anchor_y-'><code>.anchor_rect rect, anchor_x, anchor_y</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------shift_line-line--x--y-'><code>.shift_line line, x, y</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------line_y_intercept-line-'><code>.line_y_intercept line</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------angle_between_lines-line_one--line_two--replace_infinity--'><code>.angle_between_lines line_one, line_two, replace_infinity:</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------line_slope-line--replace_infinity--'><code>.line_slope line, replace_infinity:</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------line_rise_run-'><code>.line_rise_run</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------ray_test-point--line-'><code>.ray_test point, line</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------line_rect-line-'><code>.line_rect line</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------line_intersect-line_one--line_two-'><code>.line_intersect line_one, line_two</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------distance-point_one--point_two-'><code>.distance point_one, point_two</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------cubic_bezier-t--a--b--c--d-'><code>.cubic_bezier t, a, b, c, d</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-easing-'><code>args.easing</code></a></li></ul><ul><ul><li><a class='header-3' href='#------ease-start_tick--current_tick--duration--easing_functions-'><code>.ease start_tick, current_tick, duration, easing_functions</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------ease_spline-start_tick--current_tick--duration--spline-'><code>.ease_spline start_tick, current_tick, duration, spline</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-string-'><code>args.string</code></a></li></ul><ul><ul><li><a class='header-3' href='#------wrapped_lines-string--max_character_length-'><code>.wrapped_lines string, max_character_length</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-grid-'><code>args.grid</code></a></li></ul><ul><ul><li><a class='header-3' href='#------name-'><code>.name</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------bottom-'><code>.bottom</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------top-'><code>.top</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------left-'><code>.left</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------right-'><code>.right</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------rect-'><code>.rect</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------origin_bottom_left!-'><code>.origin_bottom_left!</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------origin_center!-'><code>.origin_center!</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------w-'><code>.w</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------h-'><code>.h</code></a></li></ul></ul><ul><li><a class='header-2' href='#----args-gtk-'><code>args.gtk</code></a></li></ul><ul><ul><li><a class='header-3' href='#------argv-'><code>.argv</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------platform-'><code>.platform</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------request_quit-'><code>.request_quit</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------write_file-path--contents-'><code>.write_file path, contents</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------write_file_root-'><code>.write_file_root</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------append_file-path--contents-'><code>.append_file path, contents</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------append_file_root-path--contents-'><code>.append_file_root path, contents</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------read_file-path-'><code>.read_file path</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------parse_xml-string--parse_xml_file-path-'><code>.parse_xml string, parse_xml_file path</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------parse_json-string--parse_json_file-path-'><code>.parse_json string, parse_json_file path</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------http_get-url--extra_headers-=-{}-'><code>.http_get url, extra_headers = {}</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------http_post-url--form_fields-=-{}--extra_headers-=-{}-'><code>.http_post url, form_fields = {}, extra_headers = {}</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------reset-'><code>.reset</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------stop_music-'><code>.stop_music</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------calcstringbox-str--size_enum--font-'><code>.calcstringbox str, size_enum, font</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------slowmo!-factor-'><code>.slowmo! factor</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------notify!-string-'><code>.notify! string</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------system-'><code>.system</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------exec-'><code>.exec</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------save_state-'><code>.save_state</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------load_state-'><code>.load_state</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------serialize_state-file--state-'><code>.serialize_state file, state</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------deserialize_state-file-'><code>.deserialize_state file</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------reset_sprite-path-'><code>.reset_sprite path</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------show_cursor-'><code>.show_cursor</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------hide_cursor-'><code>.hide_cursor</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------cursor_shown--'><code>.cursor_shown?</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------set_window_fullscreen-enabled-'><code>.set_window_fullscreen enabled</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------openurl-url-'><code>.openurl url</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------get_base_dir-'><code>.get_base_dir</code></a></li></ul></ul><ul><ul><li><a class='header-3' href='#------get_game_dir-'><code>.get_game_dir</code></a></li></ul></ul><li><a class='header-1' href='#--docs---gtk--runtime#reset-'>DOCS: <code>GTK::Runtime#reset</code></a></li>
<li><a class='header-1' href='#--docs---gtk--runtime#calcstringbox-'>DOCS: <code>GTK::Runtime#calcstringbox</code></a></li>
<li><a class='header-1' href='#--docs---gtk--runtime#write_file-'>DOCS: <code>GTK::Runtime#write_file</code></a></li>
+<li><a class='header-1' href='#--docs---gtk--runtime#benchmark-'>DOCS: <code>GTK::Runtime#benchmark</code></a></li>
<li><a class='header-1' href='#--docs---array-'>DOCS: <code>Array</code></a></li>
<li><a class='header-1' href='#--docs---array#map-'>DOCS: <code>Array#map</code></a></li>
<li><a class='header-1' href='#--docs---array#each-'>DOCS: <code>Array#each</code></a></li>
@@ -52,7 +53,7 @@
<li><a class='header-1' href='#--docs---geometry-'>DOCS: <code>Geometry</code></a></li>
<li><a class='header-1' href='#--docs---gtk--geometry#scale_rect-'>DOCS: <code>GTK::Geometry#scale_rect</code></a></li>
<li><a class='header-1' href='#--source-code'>Source Code</a></li>
-<ul><li><a class='header-2' href='#---samples'>Samples</a></li></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---beginner-ruby-primer---automation-rb'>Learn Ruby Optional - Beginner Ruby Primer - automation.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---beginner-ruby-primer---main-rb'>Learn Ruby Optional - Beginner Ruby Primer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---printing-txt'>Learn Ruby Optional - Intermediate Ruby Primer - printing.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---strings-txt'>Learn Ruby Optional - Intermediate Ruby Primer - strings.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---numbers-txt'>Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---booleans-txt'>Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---conditionals-txt'>Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---looping-txt'>Learn Ruby Optional - Intermediate Ruby Primer - looping.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---functions-txt'>Learn Ruby Optional - Intermediate Ruby Primer - functions.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---arrays-txt'>Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---main-rb'>Learn Ruby Optional - Intermediate Ruby Primer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---labels---main-rb'>Rendering Basics - Labels - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---lines---main-rb'>Rendering Basics - Lines - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---solids-borders---main-rb'>Rendering Basics - Solids Borders - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---sprites---main-rb'>Rendering Basics - Sprites - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---sounds---main-rb'>Rendering Basics - Sounds - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---keyboard---main-rb'>Input Basics - Keyboard - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---moving-a-sprite---main-rb'>Input Basics - Moving A Sprite - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---mouse---main-rb'>Input Basics - Mouse - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---mouse-point-to-rect---main-rb'>Input Basics - Mouse Point To Rect - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---mouse-rect-to-rect---main-rb'>Input Basics - Mouse Rect To Rect - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---controller---main-rb'>Input Basics - Controller - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---touch---main-rb'>Input Basics - Touch - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---animation-using-separate-pngs---main-rb'>Rendering Sprites - Animation Using Separate Pngs - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---animation-using-sprite-sheet---main-rb'>Rendering Sprites - Animation Using Sprite Sheet - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---animation-states---main-rb'>Rendering Sprites - Animation States - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---color-and-rotation---main-rb'>Rendering Sprites - Color And Rotation - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---simple---main-rb'>Physics And Collisions - Simple - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---moving-objects---main-rb'>Physics And Collisions - Moving Objects - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---entities---main-rb'>Physics And Collisions - Entities - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---box-collision---main-rb'>Physics And Collisions - Box Collision - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---box-collision-2---main-rb'>Physics And Collisions - Box Collision 2 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---box-collision-3---main-rb'>Physics And Collisions - Box Collision 3 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---jump-physics---main-rb'>Physics And Collisions - Jump Physics - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---ball-rb'>Physics And Collisions - Bouncing On Collision - ball.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---block-rb'>Physics And Collisions - Bouncing On Collision - block.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---cannon-rb'>Physics And Collisions - Bouncing On Collision - cannon.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---main-rb'>Physics And Collisions - Bouncing On Collision - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---peg-rb'>Physics And Collisions - Bouncing On Collision - peg.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---vector2d-rb'>Physics And Collisions - Bouncing On Collision - vector2d.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---ball-rb'>Physics And Collisions - Arbitrary Collision - ball.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---blocks-rb'>Physics And Collisions - Arbitrary Collision - blocks.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---linear_collider-rb'>Physics And Collisions - Arbitrary Collision - linear_collider.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---main-rb'>Physics And Collisions - Arbitrary Collision - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---paddle-rb'>Physics And Collisions - Arbitrary Collision - paddle.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---rectangle-rb'>Physics And Collisions - Arbitrary Collision - rectangle.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---square_collider-rb'>Physics And Collisions - Arbitrary Collision - square_collider.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---vector2d-rb'>Physics And Collisions - Arbitrary Collision - vector2d.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---ball-rb'>Physics And Collisions - Collision With Object Removal - ball.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---linear_collider-rb'>Physics And Collisions - Collision With Object Removal - linear_collider.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---main-rb'>Physics And Collisions - Collision With Object Removal - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---paddle-rb'>Physics And Collisions - Collision With Object Removal - paddle.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---tests-rb'>Physics And Collisions - Collision With Object Removal - tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---vector2d-rb'>Physics And Collisions - Collision With Object Removal - vector2d.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---mouse-click---main-rb'>Mouse - Mouse Click - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---mouse-move---main-rb'>Mouse - Mouse Move - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---mouse-move-paint-app---main-rb'>Mouse - Mouse Move Paint App - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---coordinate-systems---main-rb'>Mouse - Coordinate Systems - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----save-load---save-load-game---main-rb'>Save Load - Save Load Game - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---audio-mixer---main-rb'>Advanced Audio - Audio Mixer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---audio-mixer---server_ip_address-txt'>Advanced Audio - Audio Mixer - server_ip_address.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---audio-mixer---metadata---ios_metadata-txt'>Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---sound-synthesis---main-rb'>Advanced Audio - Sound Synthesis - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---simple-render-targets---main-rb'>Advanced Rendering - Simple Render Targets - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-targets-with-tile-manipulation---main-rb'>Advanced Rendering - Render Targets With Tile Manipulation - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-target-viewports---main-rb'>Advanced Rendering - Render Target Viewports - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-primitive-hierarchies---main-rb'>Advanced Rendering - Render Primitive Hierarchies - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-primitives-as-hash---main-rb'>Advanced Rendering - Render Primitives As Hash - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---pixel-arrays---main-rb'>Advanced Rendering - Pixel Arrays - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---simple-camera---main-rb'>Advanced Rendering - Simple Camera - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---splitscreen-camera---main-rb'>Advanced Rendering - Splitscreen Camera - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---z-targeting-camera---main-rb'>Advanced Rendering - Z Targeting Camera - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---blend-modes---main-rb'>Advanced Rendering - Blend Modes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-target-noclear---main-rb'>Advanced Rendering - Render Target Noclear - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---easing-functions---main-rb'>Tweening Lerping Easing Functions - Easing Functions - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---cubic-bezier---main-rb'>Tweening Lerping Easing Functions - Cubic Bezier - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---easing-using-spline---main-rb'>Tweening Lerping Easing Functions - Easing Using Spline - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---parametric-enemy-movement---main-rb'>Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-hash---main-rb'>Performance - Sprites As Hash - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-entities---main-rb'>Performance - Sprites As Entities - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-strict-entities---main-rb'>Performance - Sprites As Strict Entities - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-classes---main-rb'>Performance - Sprites As Classes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---static-sprites-as-classes---main-rb'>Performance - Static Sprites As Classes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---static-sprites-as-classes-with-custom-drawing---main-rb'>Performance - Static Sprites As Classes With Custom Drawing - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---collision-limits---main-rb'>Performance - Collision Limits - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---trace-debugging---main-rb'>Advanced Debugging - Trace Debugging - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---trace-debugging-classes---main-rb'>Advanced Debugging - Trace Debugging Classes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---benchmark_api_tests-rb'>Advanced Debugging - Unit Tests - benchmark_api_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---exception_raising_tests-rb'>Advanced Debugging - Unit Tests - exception_raising_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---fn_tests-rb'>Advanced Debugging - Unit Tests - fn_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---gen_docs-rb'>Advanced Debugging - Unit Tests - gen_docs.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---geometry_tests-rb'>Advanced Debugging - Unit Tests - geometry_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---http_tests-rb'>Advanced Debugging - Unit Tests - http_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---nil_coercion_tests-rb'>Advanced Debugging - Unit Tests - nil_coercion_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---object_to_primitive_tests-rb'>Advanced Debugging - Unit Tests - object_to_primitive_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---parsing_tests-rb'>Advanced Debugging - Unit Tests - parsing_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---pretty_format_tests-rb'>Advanced Debugging - Unit Tests - pretty_format_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---require_tests-rb'>Advanced Debugging - Unit Tests - require_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---serialize_deserialize_tests-rb'>Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---state_serialization_experimental_tests-rb'>Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---suggest_autocompletion_tests-rb'>Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----http---retrieve-images---main-rb'>Http - Retrieve Images - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----http---web-server---main-rb'>Http - Web Server - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----c-extensions---basics---main-rb'>C Extensions - Basics - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----c-extensions---intermediate---main-rb'>C Extensions - Intermediate - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----c-extensions---native-pixel-arrays---main-rb'>C Extensions - Native Pixel Arrays - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---breadth-first-search---main-rb'>Path Finding Algorithms - Breadth First Search - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---detailed-breadth-first-search---main-rb'>Path Finding Algorithms - Detailed Breadth First Search - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---breadcrumbs---main-rb'>Path Finding Algorithms - Breadcrumbs - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---early-exit---main-rb'>Path Finding Algorithms - Early Exit - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---dijkstra---main-rb'>Path Finding Algorithms - Dijkstra - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---heuristic---main-rb'>Path Finding Algorithms - Heuristic - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---heuristic-with-walls---main-rb'>Path Finding Algorithms - Heuristic With Walls - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---a-star---main-rb'>Path Finding Algorithms - A Star - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---tower-defense---main-rb'>Path Finding Algorithms - Tower Defense - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---3d-cube---main-rb'>3d - 3d Cube - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---wireframe---main-rb'>3d - Wireframe - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---wireframe---data---what-is-this-txt'>3d - Wireframe - Data - what-is-this.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---bullet-hell---main-rb'>Arcade - Bullet Hell - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---dueling-starships---main-rb'>Arcade - Dueling Starships - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade/flappy-dragon/credits-txt'>arcade/flappy dragon/credits.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade/flappy-dragon/main-rb'>arcade/flappy dragon/main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---pong---main-rb'>Arcade - Pong - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---snakemoji---main-rb'>Arcade - Snakemoji - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---solar-system---main-rb'>Arcade - Solar System - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---sound-golf---main-rb'>Arcade - Sound Golf - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---twinstick---main-rb'>Arcade - Twinstick - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---craft-game-starting-point---main-rb'>Crafting - Craft Game Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---farming-game-starting-point---main-rb'>Crafting - Farming Game Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---farming-game-starting-point---repl-rb'>Crafting - Farming Game Starting Point - repl.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---farming-game-starting-point---tests-rb'>Crafting - Farming Game Starting Point - tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dev-tools---add-buttons-to-console---main-rb'>Dev Tools - Add Buttons To Console - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dev-tools---animation-creator-starting-point---main-rb'>Dev Tools - Animation Creator Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dev-tools---tile-editor-starting-point---main-rb'>Dev Tools - Tile Editor Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dungeon-crawl---classics-jam---main-rb'>Dungeon Crawl - Classics Jam - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----fighting---special-move-inputs---main-rb'>Fighting - Special Move Inputs - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---nokia-3310---main-rb'>Lowrez - Nokia 3310 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---nokia-3310---nokia-rb'>Lowrez - Nokia 3310 - nokia.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---resolution-64x64---lowrez-rb'>Lowrez - Resolution 64x64 - lowrez.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---resolution-64x64---main-rb'>Lowrez - Resolution 64x64 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---clepto-frog---main-rb'>Platformer - Clepto Frog - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---clepto-frog---map-rb'>Platformer - Clepto Frog - map.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---credits-txt'>Platformer - Gorillas Basic - credits.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---main-rb'>Platformer - Gorillas Basic - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---tests-rb'>Platformer - Gorillas Basic - tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---tests---building_generation_tests-rb'>Platformer - Gorillas Basic - Tests - building_generation_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---the-little-probe---main-rb'>Platformer - The Little Probe - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---the-little-probe---data---level-txt'>Platformer - The Little Probe - Data - level.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---the-little-probe---data---level_lava-txt'>Platformer - The Little Probe - Data - level_lava.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---choose-your-own-adventure---decision-rb'>Rpg Narrative - Choose Your Own Adventure - decision.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---choose-your-own-adventure---main-rb'>Rpg Narrative - Choose Your Own Adventure - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---lowrez_simulator-rb'>Rpg Narrative - Return Of Serenity - lowrez_simulator.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---main-rb'>Rpg Narrative - Return Of Serenity - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---require-rb'>Rpg Narrative - Return Of Serenity - require.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline-rb'>Rpg Narrative - Return Of Serenity - storyline.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_anka-rb'>Rpg Narrative - Return Of Serenity - storyline_anka.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_blinking_light-rb'>Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_day_one-rb'>Rpg Narrative - Return Of Serenity - storyline_day_one.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_final_decision-rb'>Rpg Narrative - Return Of Serenity - storyline_final_decision.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_final_message-rb'>Rpg Narrative - Return Of Serenity - storyline_final_message.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_serenity_alive-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_serenity_bio-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_serenity_introduction-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_speed_of_light-rb'>Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---constants-rb'>Rpg Roguelike - Roguelike Starting Point - constants.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---legend-rb'>Rpg Roguelike - Roguelike Starting Point - legend.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---main-rb'>Rpg Roguelike - Roguelike Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---sprite_lookup-rb'>Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-line-of-sight---main-rb'>Rpg Roguelike - Roguelike Line Of Sight - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-tactical---hexagonal-grid---main-rb'>Rpg Tactical - Hexagonal Grid - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-tactical---isometric-grid---main-rb'>Rpg Tactical - Isometric Grid - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-topdown---topdown-starting-point---main-rb'>Rpg Topdown - Topdown Starting Point - main.rb</a></li></ul></ul><ul><li><a class='header-2' href='#---oss'>OSS</a></li></ul><ul><ul><li><a class='header-3' href='#----args-rb'>args.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----assert-rb'>assert.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----attr_gtk-rb'>attr_gtk.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----attr_sprite-rb'>attr_sprite.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console-rb'>console.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_color-rb'>console_color.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_font_style-rb'>console_font_style.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_menu-rb'>console_menu.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_prompt-rb'>console_prompt.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----controller-rb'>controller.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----controller/config-rb'>controller/config.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----controller/keys-rb'>controller/keys.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----directional_input_helper_methods-rb'>directional_input_helper_methods.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----easing-rb'>easing.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----entity-rb'>entity.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----geometry-rb'>geometry.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----grid-rb'>grid.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----inputs-rb'>inputs.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----ios_wizard-rb'>ios_wizard.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----itch_wizard-rb'>itch_wizard.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----layout-rb'>layout.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----log-rb'>log.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----metadata-rb'>metadata.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----numeric-rb'>numeric.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----remote_hotload_client-rb'>remote_hotload_client.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/autocomplete-rb'>runtime/autocomplete.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/benchmark-rb'>runtime/benchmark.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/draw-rb'>runtime/draw.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/framerate-rb'>runtime/framerate.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/framerate_diagnostics-rb'>runtime/framerate_diagnostics.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/hotload-rb'>runtime/hotload.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----string-rb'>string.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tests-rb'>tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----trace-rb'>trace.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----wizards-rb'>wizards.rb</a></li></ul></ul></ul> </div>
+<ul><li><a class='header-2' href='#---samples'>Samples</a></li></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---beginner-ruby-primer---automation-rb'>Learn Ruby Optional - Beginner Ruby Primer - automation.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---beginner-ruby-primer---main-rb'>Learn Ruby Optional - Beginner Ruby Primer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---printing-txt'>Learn Ruby Optional - Intermediate Ruby Primer - printing.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---strings-txt'>Learn Ruby Optional - Intermediate Ruby Primer - strings.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---numbers-txt'>Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---booleans-txt'>Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---conditionals-txt'>Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---looping-txt'>Learn Ruby Optional - Intermediate Ruby Primer - looping.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---functions-txt'>Learn Ruby Optional - Intermediate Ruby Primer - functions.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---arrays-txt'>Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----learn-ruby-optional---intermediate-ruby-primer---main-rb'>Learn Ruby Optional - Intermediate Ruby Primer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---labels---main-rb'>Rendering Basics - Labels - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---lines---main-rb'>Rendering Basics - Lines - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---solids-borders---main-rb'>Rendering Basics - Solids Borders - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---sprites---main-rb'>Rendering Basics - Sprites - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---sounds---main-rb'>Rendering Basics - Sounds - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---keyboard---main-rb'>Input Basics - Keyboard - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---moving-a-sprite---main-rb'>Input Basics - Moving A Sprite - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---mouse---main-rb'>Input Basics - Mouse - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---mouse-point-to-rect---main-rb'>Input Basics - Mouse Point To Rect - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---mouse-rect-to-rect---main-rb'>Input Basics - Mouse Rect To Rect - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---controller---main-rb'>Input Basics - Controller - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----input-basics---touch---main-rb'>Input Basics - Touch - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---animation-using-separate-pngs---main-rb'>Rendering Sprites - Animation Using Separate Pngs - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---animation-using-sprite-sheet---main-rb'>Rendering Sprites - Animation Using Sprite Sheet - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---animation-states---main-rb'>Rendering Sprites - Animation States - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-sprites---color-and-rotation---main-rb'>Rendering Sprites - Color And Rotation - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---simple---main-rb'>Physics And Collisions - Simple - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---moving-objects---main-rb'>Physics And Collisions - Moving Objects - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---entities---main-rb'>Physics And Collisions - Entities - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---box-collision---main-rb'>Physics And Collisions - Box Collision - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---box-collision-2---main-rb'>Physics And Collisions - Box Collision 2 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---box-collision-3---main-rb'>Physics And Collisions - Box Collision 3 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---jump-physics---main-rb'>Physics And Collisions - Jump Physics - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---ball-rb'>Physics And Collisions - Bouncing On Collision - ball.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---block-rb'>Physics And Collisions - Bouncing On Collision - block.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---cannon-rb'>Physics And Collisions - Bouncing On Collision - cannon.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---main-rb'>Physics And Collisions - Bouncing On Collision - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---peg-rb'>Physics And Collisions - Bouncing On Collision - peg.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---bouncing-on-collision---vector2d-rb'>Physics And Collisions - Bouncing On Collision - vector2d.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---ball-rb'>Physics And Collisions - Arbitrary Collision - ball.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---blocks-rb'>Physics And Collisions - Arbitrary Collision - blocks.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---linear_collider-rb'>Physics And Collisions - Arbitrary Collision - linear_collider.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---main-rb'>Physics And Collisions - Arbitrary Collision - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---paddle-rb'>Physics And Collisions - Arbitrary Collision - paddle.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---rectangle-rb'>Physics And Collisions - Arbitrary Collision - rectangle.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---square_collider-rb'>Physics And Collisions - Arbitrary Collision - square_collider.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---arbitrary-collision---vector2d-rb'>Physics And Collisions - Arbitrary Collision - vector2d.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---ball-rb'>Physics And Collisions - Collision With Object Removal - ball.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---linear_collider-rb'>Physics And Collisions - Collision With Object Removal - linear_collider.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---main-rb'>Physics And Collisions - Collision With Object Removal - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---paddle-rb'>Physics And Collisions - Collision With Object Removal - paddle.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---tests-rb'>Physics And Collisions - Collision With Object Removal - tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----physics-and-collisions---collision-with-object-removal---vector2d-rb'>Physics And Collisions - Collision With Object Removal - vector2d.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---mouse-click---main-rb'>Mouse - Mouse Click - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---mouse-move---main-rb'>Mouse - Mouse Move - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---mouse-move-paint-app---main-rb'>Mouse - Mouse Move Paint App - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mouse---coordinate-systems---main-rb'>Mouse - Coordinate Systems - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----save-load---save-load-game---main-rb'>Save Load - Save Load Game - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---audio-mixer---main-rb'>Advanced Audio - Audio Mixer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---audio-mixer---server_ip_address-txt'>Advanced Audio - Audio Mixer - server_ip_address.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-audio---sound-synthesis---main-rb'>Advanced Audio - Sound Synthesis - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---labels-with-wrapped-text---main-rb'>Advanced Rendering - Labels With Wrapped Text - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---rotating-label---main-rb'>Advanced Rendering - Rotating Label - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---simple-render-targets---main-rb'>Advanced Rendering - Simple Render Targets - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-targets-with-tile-manipulation---main-rb'>Advanced Rendering - Render Targets With Tile Manipulation - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-target-viewports---main-rb'>Advanced Rendering - Render Target Viewports - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-primitive-hierarchies---main-rb'>Advanced Rendering - Render Primitive Hierarchies - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-primitives-as-hash---main-rb'>Advanced Rendering - Render Primitives As Hash - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---pixel-arrays---main-rb'>Advanced Rendering - Pixel Arrays - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---simple-camera---main-rb'>Advanced Rendering - Simple Camera - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---splitscreen-camera---main-rb'>Advanced Rendering - Splitscreen Camera - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---z-targeting-camera---main-rb'>Advanced Rendering - Z Targeting Camera - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---blend-modes---main-rb'>Advanced Rendering - Blend Modes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-rendering---render-target-noclear---main-rb'>Advanced Rendering - Render Target Noclear - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---easing-functions---main-rb'>Tweening Lerping Easing Functions - Easing Functions - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---cubic-bezier---main-rb'>Tweening Lerping Easing Functions - Cubic Bezier - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---easing-using-spline---main-rb'>Tweening Lerping Easing Functions - Easing Using Spline - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweening-lerping-easing-functions---parametric-enemy-movement---main-rb'>Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-hash---main-rb'>Performance - Sprites As Hash - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-entities---main-rb'>Performance - Sprites As Entities - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-struct---main-rb'>Performance - Sprites As Struct - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-strict-entities---main-rb'>Performance - Sprites As Strict Entities - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---sprites-as-classes---main-rb'>Performance - Sprites As Classes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---static-sprites-as-classes---main-rb'>Performance - Static Sprites As Classes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---static-sprites-as-classes-with-custom-drawing---main-rb'>Performance - Static Sprites As Classes With Custom Drawing - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----performance---collision-limits---main-rb'>Performance - Collision Limits - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---logging---main-rb'>Advanced Debugging - Logging - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---trace-debugging---main-rb'>Advanced Debugging - Trace Debugging - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---trace-debugging-classes---main-rb'>Advanced Debugging - Trace Debugging Classes - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---benchmark_api_tests-rb'>Advanced Debugging - Unit Tests - benchmark_api_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---exception_raising_tests-rb'>Advanced Debugging - Unit Tests - exception_raising_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---fn_tests-rb'>Advanced Debugging - Unit Tests - fn_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---gen_docs-rb'>Advanced Debugging - Unit Tests - gen_docs.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---geometry_tests-rb'>Advanced Debugging - Unit Tests - geometry_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---http_tests-rb'>Advanced Debugging - Unit Tests - http_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---nil_coercion_tests-rb'>Advanced Debugging - Unit Tests - nil_coercion_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---object_to_primitive_tests-rb'>Advanced Debugging - Unit Tests - object_to_primitive_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---parsing_tests-rb'>Advanced Debugging - Unit Tests - parsing_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---pretty_format_tests-rb'>Advanced Debugging - Unit Tests - pretty_format_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---require_tests-rb'>Advanced Debugging - Unit Tests - require_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---serialize_deserialize_tests-rb'>Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---state_serialization_experimental_tests-rb'>Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----advanced-debugging---unit-tests---suggest_autocompletion_tests-rb'>Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----http---retrieve-images---main-rb'>Http - Retrieve Images - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----http---in-game-web-server-http-get---main-rb'>Http - In Game Web Server Http Get - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----http---in-game-web-server-http-post---main-rb'>Http - In Game Web Server Http Post - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----c-extensions---basics---main-rb'>C Extensions - Basics - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----c-extensions---intermediate---main-rb'>C Extensions - Intermediate - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----c-extensions---native-pixel-arrays---main-rb'>C Extensions - Native Pixel Arrays - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---breadth-first-search---main-rb'>Path Finding Algorithms - Breadth First Search - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---detailed-breadth-first-search---main-rb'>Path Finding Algorithms - Detailed Breadth First Search - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---breadcrumbs---main-rb'>Path Finding Algorithms - Breadcrumbs - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---early-exit---main-rb'>Path Finding Algorithms - Early Exit - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---dijkstra---main-rb'>Path Finding Algorithms - Dijkstra - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---heuristic---main-rb'>Path Finding Algorithms - Heuristic - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---heuristic-with-walls---main-rb'>Path Finding Algorithms - Heuristic With Walls - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---a-star---main-rb'>Path Finding Algorithms - A Star - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----path-finding-algorithms---tower-defense---main-rb'>Path Finding Algorithms - Tower Defense - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---3d-cube---main-rb'>3d - 3d Cube - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---wireframe---main-rb'>3d - Wireframe - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---wireframe---data---what-is-this-txt'>3d - Wireframe - Data - what-is-this.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----3d---yaw-pitch-roll---main-rb'>3d - Yaw Pitch Roll - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---bullet-hell---main-rb'>Arcade - Bullet Hell - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---dueling-starships---main-rb'>Arcade - Dueling Starships - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade/flappy-dragon/credits-txt'>arcade/flappy dragon/credits.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade/flappy-dragon/main-rb'>arcade/flappy dragon/main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---pong---main-rb'>Arcade - Pong - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---snakemoji---main-rb'>Arcade - Snakemoji - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---solar-system---main-rb'>Arcade - Solar System - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---sound-golf---main-rb'>Arcade - Sound Golf - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----arcade---twinstick---main-rb'>Arcade - Twinstick - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---craft-game-starting-point---main-rb'>Crafting - Craft Game Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---farming-game-starting-point---main-rb'>Crafting - Farming Game Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----crafting---farming-game-starting-point---tests-rb'>Crafting - Farming Game Starting Point - tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dev-tools---add-buttons-to-console---main-rb'>Dev Tools - Add Buttons To Console - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dev-tools---animation-creator-starting-point---main-rb'>Dev Tools - Animation Creator Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dev-tools---tile-editor-starting-point---main-rb'>Dev Tools - Tile Editor Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dungeon-crawl---classics-jam---main-rb'>Dungeon Crawl - Classics Jam - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----fighting---special-move-inputs---main-rb'>Fighting - Special Move Inputs - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---nokia-3310---main-rb'>Lowrez - Nokia 3310 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---nokia-3310---nokia-rb'>Lowrez - Nokia 3310 - nokia.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---resolution-64x64---lowrez-rb'>Lowrez - Resolution 64x64 - lowrez.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----lowrez---resolution-64x64---main-rb'>Lowrez - Resolution 64x64 - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mario---jumping---main-rb'>Mario - Jumping - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----mario---jumping-and-collisions---main-rb'>Mario - Jumping And Collisions - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---clepto-frog---main-rb'>Platformer - Clepto Frog - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---clepto-frog---map-rb'>Platformer - Clepto Frog - map.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---credits-txt'>Platformer - Gorillas Basic - credits.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---main-rb'>Platformer - Gorillas Basic - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---tests-rb'>Platformer - Gorillas Basic - tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---gorillas-basic---tests---building_generation_tests-rb'>Platformer - Gorillas Basic - Tests - building_generation_tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---the-little-probe---main-rb'>Platformer - The Little Probe - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---the-little-probe---data---level-txt'>Platformer - The Little Probe - Data - level.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----platformer---the-little-probe---data---level_lava-txt'>Platformer - The Little Probe - Data - level_lava.txt</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---choose-your-own-adventure---decision-rb'>Rpg Narrative - Choose Your Own Adventure - decision.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---choose-your-own-adventure---main-rb'>Rpg Narrative - Choose Your Own Adventure - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---lowrez_simulator-rb'>Rpg Narrative - Return Of Serenity - lowrez_simulator.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---main-rb'>Rpg Narrative - Return Of Serenity - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---require-rb'>Rpg Narrative - Return Of Serenity - require.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline-rb'>Rpg Narrative - Return Of Serenity - storyline.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_anka-rb'>Rpg Narrative - Return Of Serenity - storyline_anka.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_blinking_light-rb'>Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_day_one-rb'>Rpg Narrative - Return Of Serenity - storyline_day_one.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_final_decision-rb'>Rpg Narrative - Return Of Serenity - storyline_final_decision.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_final_message-rb'>Rpg Narrative - Return Of Serenity - storyline_final_message.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_serenity_alive-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_serenity_bio-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_serenity_introduction-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-narrative---return-of-serenity---storyline_speed_of_light-rb'>Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---constants-rb'>Rpg Roguelike - Roguelike Starting Point - constants.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---legend-rb'>Rpg Roguelike - Roguelike Starting Point - legend.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---main-rb'>Rpg Roguelike - Roguelike Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-starting-point---sprite_lookup-rb'>Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-roguelike---roguelike-line-of-sight---main-rb'>Rpg Roguelike - Roguelike Line Of Sight - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-tactical---hexagonal-grid---main-rb'>Rpg Tactical - Hexagonal Grid - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-tactical---isometric-grid---main-rb'>Rpg Tactical - Isometric Grid - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-topdown---topdown-casino---main-rb'>Rpg Topdown - Topdown Casino - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rpg-topdown---topdown-starting-point---main-rb'>Rpg Topdown - Topdown Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----teenytiny---teenytiny-starting-point---main-rb'>Teenytiny - Teenytiny Starting Point - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----teenytiny---teenytiny-starting-point---license-txt'>Teenytiny - Teenytiny Starting Point - license.txt</a></li></ul></ul><ul><li><a class='header-2' href='#---oss'>OSS</a></li></ul><ul><ul><li><a class='header-3' href='#----args-rb'>args.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----assert-rb'>assert.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----attr_gtk-rb'>attr_gtk.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----attr_sprite-rb'>attr_sprite.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console-rb'>console.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_color-rb'>console_color.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_font_style-rb'>console_font_style.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_menu-rb'>console_menu.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----console_prompt-rb'>console_prompt.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----controller-rb'>controller.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----controller/config-rb'>controller/config.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----controller/keys-rb'>controller/keys.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----directional_input_helper_methods-rb'>directional_input_helper_methods.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----easing-rb'>easing.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----entity-rb'>entity.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----geometry-rb'>geometry.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----grid-rb'>grid.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----inputs-rb'>inputs.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----ios_wizard-rb'>ios_wizard.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----itch_wizard-rb'>itch_wizard.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----layout-rb'>layout.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----log-rb'>log.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----metadata-rb'>metadata.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----numeric-rb'>numeric.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----recording-rb'>recording.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----remote_hotload_client-rb'>remote_hotload_client.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/autocomplete-rb'>runtime/autocomplete.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/benchmark-rb'>runtime/benchmark.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/draw-rb'>runtime/draw.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/framerate-rb'>runtime/framerate.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/framerate_diagnostics-rb'>runtime/framerate_diagnostics.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----runtime/hotload-rb'>runtime/hotload.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----string-rb'>string.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tests-rb'>tests.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----trace-rb'>trace.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----tweetcart-rb'>tweetcart.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----wizards-rb'>wizards.rb</a></li></ul></ul></ul> </div>
<div id='content'>
<h1 id='--dragonruby-game-toolkit-live-docs'>DragonRuby Game Toolkit Live Docs</h1>
<p>
@@ -1765,6 +1766,33 @@ This function takes in two parameters. The first parameter is the file path and
end
end
</code></pre>
+<h1 id='--docs---gtk--runtime#benchmark-'>DOCS: <code>GTK::Runtime#benchmark</code></h1>
+<p>
+You can use this function to compare the relative performance of methods.
+</p>
+<pre><code class="language-ruby">def tick args
+ # press r to run benchmark
+ if args.inputs.keyboard.key_down.r
+ args.gtk.console.show
+ args.gtk.benchmark iterations: 1000, # number of iterations
+ # label for experiment
+ using_numeric_map: -> () {
+ # experiment body
+ v = 100.map do |i|
+ i * 100
+ end
+ },
+ # label for experiment
+ using_numeric_times: -> () {
+ # experiment body
+ v = []
+ 100.times do |i|
+ v << i * 100
+ end
+ }
+ end
+end
+</code></pre>
<h1 id='--docs---array-'>DOCS: <code>Array</code></h1>
<p>
The Array class has been extend to provide methods that will help in common game development tasks. Array is one of the most powerful classes in Ruby and a very fundamental component of Game Toolkit.
@@ -4163,7 +4191,7 @@ Reminder:
# Use args.inputs.mouse.click.created_at
# To see how many frames its been since the click occurred
-# Use args.inputs.mouse.click.creat_at_elapsed
+# Use args.inputs.mouse.click.created_at_elapsed
# Saving the click in args.state can be quite useful
@@ -6776,17 +6804,17 @@ class Game
end
def calc_player_dx
- player.y += player.dy
- player.dy += state.gravity
- player.dy += player.dy * state.drag ** 2 * -1
- end
-
- def calc_player_dy
player.dx = player.dx.clamp(-5, 5)
player.dx *= 0.9
player.x += player.dx
end
+ def calc_player_dy
+ player.y += player.dy
+ player.dy += state.gravity
+ player.dy += player.dy * state.drag ** 2 * -1
+ end
+
def reset_player
player.x = 100
player.y = 720
@@ -6928,8 +6956,7 @@ class VerticalPlatformer
input
end
- # Sets default values
- def defaults
+ def init_game
s.platforms ||= [ # initializes platforms collection with two platforms using hashes
new_platform(x: 0, y: 0, w: 700, h: 32, dx: 1, speed: 0, rect: nil),
new_platform(x: 0, y: 300, w: 700, h: 32, dx: 1, speed: 0, rect: nil), # 300 pixels higher
@@ -6952,6 +6979,11 @@ class VerticalPlatformer
s.camera ||= { y: -100 } # shows view on screen (as the player moves upward, the camera does too)
end
+ # Sets default values
+ def defaults
+ init_game
+ end
+
# Outputs objects onto the screen
def render
outputs.solids << s.platforms.map do |p| # outputs platforms onto screen
@@ -7039,7 +7071,9 @@ class VerticalPlatformer
rect: nil)
end
else
+ # game over
s.as_hash.clear # otherwise clear the hash (no new platform is necessary)
+ init_game
end
end
@@ -9698,12 +9732,23 @@ class TicTacToe
# Starts the game with player x's turn and creates an array (to_a) for space combinations.
# Calls methods necessary for the game to run properly.
def tick
- state.current_turn ||= :x
- state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a
+ init_new_game
render_board
input_board
end
+ def init_new_game
+ state.current_turn ||= :x
+ state.space_combinations ||= [-1, 0, 1].product([-1, 0, 1]).to_a
+
+ state.spaces ||= {}
+
+ state.space_combinations.each do |x, y|
+ state.spaces[x] ||= {}
+ state.spaces[x][y] ||= state.new_entity(:space)
+ end
+ end
+
# Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.
def render_board
square_size = 80
@@ -9779,6 +9824,7 @@ class TicTacToe
def input_restart_game
return unless state.game_over
gtk.reset
+ init_new_game
end
# Checks if x or o won the game.
@@ -10093,7 +10139,7 @@ class ProtectThePuppiesFromTheZombies
def calc_kill_zombie
# Find all zombies that intersect with the player. They are considered killed.
- killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }
+ killed_this_frame = state.zombies.find_all { |z| z.sprite && (z.sprite.intersect_rect? state.player_sprite) }
state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection
state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies
@@ -10989,6 +11035,7 @@ def render_sources args
end
def playtime_str t
+ return "" unless t
minutes = (t / 60.0).floor
seconds = t - (minutes * 60.0).to_f
return minutes.to_s + ':' + seconds.floor.to_s + ((seconds - seconds.floor).to_s + "000")[1..3]
@@ -11101,7 +11148,7 @@ def panel_primitives args, audio_entry
results.playtime_slider_rect = progress_bar(args: args,
row: 2.5,
col: 2,
- percentage: audio_entry.playtime / audio_entry.length_,
+ percentage: (audio_entry.playtime || 1) / (audio_entry.length_ || 1),
text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")
results.primitives << results.playtime_slider_rect.primitives
@@ -11298,19 +11345,6 @@ end
<pre><code class="language-ruby"># ./samples/07_advanced_audio/01_audio_mixer/app/server_ip_address.txt
192.168.1.65
</code></pre>
-<h3 id='----advanced-audio---audio-mixer---metadata---ios_metadata-txt'>Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt</h3>
-<pre><code class="language-ruby"># ./samples/07_advanced_audio/01_audio_mixer/metadata/ios_metadata.txt
-# ios_metadata.txt is used by the Pro version of DragonRuby Game Toolkit to create iOS apps.
-# Information about the Pro version can be found at: http://dragonruby.org/toolkit/game#purchase
-
-# teamid needs to be set to your assigned Team Id which can be found at https://developer.apple.com/account/#/membership/
-teamid=
-# appid needs to be set to your application identifier which can be found at https://developer.apple.com/account/resources/identifiers/list
-appid=
-# appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.
-appname=
-
-</code></pre>
<h3 id='----advanced-audio---sound-synthesis---main-rb'>Advanced Audio - Sound Synthesis - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_audio/02_sound_synthesis/app/main.rb
begin # region: top level tick methods
@@ -11908,6 +11942,134 @@ end
$gtk.reset
</code></pre>
+<h3 id='----advanced-rendering---labels-with-wrapped-text---main-rb'>Advanced Rendering - Labels With Wrapped Text - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_rendering/00_labels_with_wrapped_text/app/main.rb
+def tick args
+ # defaults
+ args.state.scroll_location ||= 0
+ args.state.textbox.messages ||= []
+ args.state.textbox.scroll ||= 0
+
+ # render
+ args.outputs.background_color = [0, 0, 0, 255]
+ render_messages args
+ render_instructions args
+
+ # inputs
+ if args.inputs.keyboard.key_down.one
+ queue_message args, "Hello there neighbour! my name is mark, how is your day today?"
+ end
+
+ if args.inputs.keyboard.key_down.two
+ queue_message args, "I'm doing great sir, actually I'm having a picnic today"
+ end
+
+ if args.inputs.keyboard.key_down.three
+ queue_message args, "Well that sounds wonderful!"
+ end
+
+ if args.inputs.keyboard.key_down.home
+ args.state.scroll_location = 1
+ end
+
+ if args.inputs.keyboard.key_down.delete
+ clear_message_queue args
+ end
+end
+
+def queue_message args, msg
+ args.state.textbox.messages.concat msg.wrapped_lines 50
+end
+
+def clear_message_queue args
+ args.state.textbox.messages = nil
+ args.state.textbox.scroll = 0
+end
+
+def render_messages args
+ args.outputs[:textbox].w = 400
+ args.outputs[:textbox].h = 720
+
+ args.outputs.primitives << args.state.textbox.messages.each_with_index.map do |s, idx|
+ {
+ x: 0,
+ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,
+ text: s,
+ size_enum: -3,
+ alignment_enum: 0,
+ r: 255, g:255, b: 255, a: 255
+ }
+ end
+
+ args.outputs[:textbox].labels << args.state.textbox.messages.each_with_index.map do |s, idx|
+ {
+ x: 0,
+ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,
+ text: s,
+ size_enum: -3,
+ alignment_enum: 0,
+ r: 255, g:255, b: 255, a: 255
+ }
+ end
+
+ args.outputs[:textbox].borders << [0, 0, args.outputs[:textbox].w, 720]
+
+ args.state.textbox.scroll += args.inputs.mouse.wheel.y unless args.inputs.mouse.wheel.nil?
+
+ if args.state.scroll_location > 0
+ args.state.textbox.scroll = 0
+ args.state.scroll_location = 0
+ end
+
+ args.outputs.sprites << [900, 0, args.outputs[:textbox].w, 720, :textbox]
+end
+
+def render_instructions args
+ args.outputs.labels << [30,
+ 30.from_top,
+ "press 1, 2, 3 to display messages, MOUSE WHEEL to scroll, HOME to go to top, BACKSPACE to delete.",
+ 0, 255, 255]
+
+ args.outputs.primitives << [0, 55.from_top, 1280, 30, :pixel, 0, 255, 0, 0, 0].sprite
+end
+
+</code></pre>
+<h3 id='----advanced-rendering---rotating-label---main-rb'>Advanced Rendering - Rotating Label - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_rendering/00_rotating_label/app/main.rb
+def tick args
+ # set the render target width and height to match the label
+ args.outputs[:scene].w = 220
+ args.outputs[:scene].h = 30
+
+
+ # make the background transparent
+ args.outputs[:scene].background_color = [255, 255, 255, 0]
+
+ # set the blendmode of the label to 0 (no blending)
+ # center it inside of the scene
+ # set the vertical_alignment_enum to 1 (center)
+ args.outputs[:scene].labels << { x: 0,
+ y: 15,
+ text: "label in render target",
+ blendmode_enum: 0,
+ vertical_alignment_enum: 1 }
+
+ # add a border to the render target
+ args.outputs[:scene].borders << { x: 0,
+ y: 0,
+ w: args.outputs[:scene].w,
+ h: args.outputs[:scene].h }
+
+ # add the rendertarget to the main output as a sprite
+ args.outputs.sprites << { x: 640 - args.outputs[:scene].w.half,
+ y: 360 - args.outputs[:scene].h.half,
+ w: args.outputs[:scene].w,
+ h: args.outputs[:scene].h,
+ angle: args.state.tick_count,
+ path: :scene }
+end
+
+</code></pre>
<h3 id='----advanced-rendering---simple-render-targets---main-rb'>Advanced Rendering - Simple Render Targets - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb
def tick args
@@ -13146,6 +13308,7 @@ class CameraMovement
default_camera(0,0,1280,720)
end
+
def new_room
default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png')
end
@@ -14245,8 +14408,94 @@ def reset_with count: count
end
</code></pre>
+<h3 id='----performance---sprites-as-struct---main-rb'>Performance - Sprites As Struct - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/09_performance/03_sprites_as_struct/app/main.rb
+# create a Struct variant that allows for named parameters on construction.
+class NamedStruct < Struct
+ def initialize **opts
+ super(*members.map { |k| opts[k] })
+ end
+end
+
+# create a Star NamedStruct
+Star = NamedStruct.new(:x, :y, :w, :h, :path, :s,
+ :angle, :angle_anchor_x, :angle_anchor_y,
+ :r, :g, :b, :a,
+ :tile_x, :tile_y,
+ :tile_w, :tile_h,
+ :source_x, :source_y,
+ :source_w, :source_h,
+ :flip_horizontally, :flip_vertically,
+ :blendmode_enum)
+
+# Sprites represented as Structs. They require a little bit more code than Hashes,
+# but are the a little faster to render too.
+def random_x args
+ (args.grid.w.randomize :ratio) * -1
+end
+
+def random_y args
+ (args.grid.h.randomize :ratio) * -1
+end
+
+def random_speed
+ 1 + (4.randomize :ratio)
+end
+
+def new_star args
+ Star.new x: (random_x args),
+ y: (random_y args),
+ w: 4, h: 4,
+ path: 'sprites/tiny-star.png',
+ s: random_speed
+end
+
+def move_star args, star
+ star.x += star[:s]
+ star.y += star[:s]
+ if star.x > args.grid.w || star.y > args.grid.h
+ star.x = (random_x args)
+ star.y = (random_y args)
+ star[:s] = random_speed
+ end
+end
+
+def tick args
+ args.state.star_count ||= 0
+
+ # sets console command when sample app initially opens
+ if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Structs"
+ puts "* INFO: Please specify the number of sprites to render."
+ args.gtk.console.set_command "reset_with count: 100"
+ end
+
+ # init
+ if args.state.tick_count == 0
+ args.state.stars = args.state.star_count.map { |i| new_star args }
+ end
+
+ # update
+ args.state.stars.each { |s| move_star args, s }
+
+ # render
+ args.outputs.sprites << args.state.stars
+ args.outputs.background_color = [0, 0, 0]
+ args.outputs.primitives << args.gtk.current_framerate_primitives
+end
+
+# resets game, and assigns star count given by user
+def reset_with count: count
+ $gtk.reset
+ $gtk.args.state.star_count = count
+end
+
+</code></pre>
<h3 id='----performance---sprites-as-strict-entities---main-rb'>Performance - Sprites As Strict Entities - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb
+<pre><code class="language-ruby"># ./samples/09_performance/04_sprites_as_strict_entities/app/main.rb
# Sprites represented as StrictEntities using the queue ~args.outputs.sprites~
# yields apis access similar to Entities, but all properties that can be set on the
# entity must be predefined with a default value. Strict entities do not support the
@@ -14322,7 +14571,7 @@ end
</code></pre>
<h3 id='----performance---sprites-as-classes---main-rb'>Performance - Sprites As Classes - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/09_performance/04_sprites_as_classes/app/main.rb
+<pre><code class="language-ruby"># ./samples/09_performance/05_sprites_as_classes/app/main.rb
# Sprites represented as Classes using the queue ~args.outputs.sprites~.
# gives you full control of property declaration and method invocation.
# They are more performant than OpenEntities and StrictEntities, but more code upfront.
@@ -14381,7 +14630,7 @@ end
</code></pre>
<h3 id='----performance---static-sprites-as-classes---main-rb'>Performance - Static Sprites As Classes - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/09_performance/05_static_sprites_as_classes/app/main.rb
+<pre><code class="language-ruby"># ./samples/09_performance/06_static_sprites_as_classes/app/main.rb
# Sprites represented as Classes using the queue ~args.outputs.static_sprites~.
# bypasses the queue behavior of ~args.outputs.sprites~. All instances are held
# by reference. You get better performance, but you are mutating state of held objects
@@ -14441,7 +14690,7 @@ end
</code></pre>
<h3 id='----performance---static-sprites-as-classes-with-custom-drawing---main-rb'>Performance - Static Sprites As Classes With Custom Drawing - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb
+<pre><code class="language-ruby"># ./samples/09_performance/07_static_sprites_as_classes_with_custom_drawing/app/main.rb
# Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.
# is the fastest approach. This is comparable to what other game engines set as the default behavior.
# There are tradeoffs for all this speed if the creation of a full blown class, and bypassing
@@ -14533,7 +14782,7 @@ end
</code></pre>
<h3 id='----performance---collision-limits---main-rb'>Performance - Collision Limits - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/09_performance/07_collision_limits/app/main.rb
+<pre><code class="language-ruby"># ./samples/09_performance/08_collision_limits/app/main.rb
=begin
Reminders:
@@ -14591,6 +14840,29 @@ end
$gtk.reset
</code></pre>
+<h3 id='----advanced-debugging---logging---main-rb'>Advanced Debugging - Logging - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/10_advanced_debugging/00_logging/app/main.rb
+def tick args
+ args.outputs.background_color = [255, 255, 255, 0]
+ if args.state.tick_count == 0
+ args.gtk.log_spam "log level spam"
+ args.gtk.log_debug "log level debug"
+ args.gtk.log_info "log level info"
+ args.gtk.log_warn "log level warn"
+ args.gtk.log_error "log level error"
+ args.gtk.log_unfiltered "log level unfiltered"
+ puts "This is a puts call"
+ args.gtk.console.show
+ end
+
+ if args.state.tick_count == 60
+ puts "This is a puts call on tick 60"
+ elsif args.state.tick_count == 120
+ puts "This is a puts call on tick 120"
+ end
+end
+
+</code></pre>
<h3 id='----advanced-debugging---trace-debugging---main-rb'>Advanced Debugging - Trace Debugging - main.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb
class Game
@@ -15407,12 +15679,12 @@ def test_serialize args, assert
GTK::Entity.__reset_id__!
args.state.player_one = "test"
result = args.gtk.serialize_state args.state
- assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
+ assert.equal! result, "{:entity_id=>4, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
GTK::Entity.__reset_id__!
args.gtk.write_file 'state.txt', ''
result = args.gtk.serialize_state 'state.txt', args.state
- assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
+ assert.equal! result, "{:entity_id=>4, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
end
def test_deserialize args, assert
@@ -15461,7 +15733,7 @@ def test_strict_entity_serialization_with_nil args, assert
args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil)
serialized_state = args.gtk.serialize_state args.state
- assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'
+ assert.equal! serialized_state, '{:entity_id=>7, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'
GTK::Entity.__reset_id__!
deserialized_state = args.gtk.deserialize_state serialized_state
@@ -15519,6 +15791,18 @@ def test_by_reference_state_strict_entities args, assert
assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two
end
+def test_serialization_excludes_thrash_count args, assert
+ GTK::Entity.__reset_id__!
+ args.state.player.name = "Ryu"
+ # force a nil pun
+ if args.state.player.age > 30
+ end
+ assert.equal! args.state.player.as_hash[:__thrash_count__][:>], 1
+ result = args.gtk.serialize_state args.state
+ assert.false! (result.include? "__thrash_count__"),
+ "The __thrash_count__ key exists in state when it shouldn't have."
+end
+
</code></pre>
<h3 id='----advanced-debugging---unit-tests---state_serialization_experimental_tests-rb'>Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/state_serialization_experimental_tests.rb
@@ -15674,11 +15958,13 @@ end
</code></pre>
<h3 id='----http---retrieve-images---main-rb'>Http - Retrieve Images - main.rb</h3>
<pre><code class="language-ruby"># ./samples/11_http/01_retrieve_images/app/main.rb
+$gtk.register_cvar 'app.warn_seconds', "seconds to wait before starting", :uint, 11
+
def tick args
args.outputs.background_color = [0, 0, 0]
# Show a warning at the start.
- args.state.warning_debounce ||= 11 * 60
+ args.state.warning_debounce ||= args.cvars['app.warn_seconds'].value * 60
if args.state.warning_debounce > 0
args.state.warning_debounce -= 1
args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]
@@ -15729,10 +16015,11 @@ def tick args
end
</code></pre>
-<h3 id='----http---web-server---main-rb'>Http - Web Server - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/11_http/02_web_server/app/main.rb
+<h3 id='----http---in-game-web-server-http-get---main-rb'>Http - In Game Web Server Http Get - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/11_http/02_in_game_web_server_http_get/app/main.rb
def tick args
args.state.port ||= 3000
+ args.state.reqnum ||= 0
# by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build
# to enable the http server in a production build, you need to manually start
# the server up:
@@ -15760,6 +16047,82 @@ def tick args
end
</code></pre>
+<h3 id='----http---in-game-web-server-http-post---main-rb'>Http - In Game Web Server Http Post - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/11_http/03_in_game_web_server_http_post/app/main.rb
+def tick args
+ # defaults
+ args.state.post_button = args.layout.rect(row: 0, col: 0, w: 5, h: 1).merge(text: "execute http_post")
+ args.state.post_body_button = args.layout.rect(row: 1, col: 0, w: 5, h: 1).merge(text: "execute http_post_body")
+ args.state.request_to_s ||= ""
+ args.state.request_body ||= ""
+
+ # render
+ args.state.post_button.yield_self do |b|
+ args.outputs.borders << b
+ args.outputs.labels << b.merge(text: b.text,
+ y: b.y + 30,
+ x: b.x + 10)
+ end
+
+ args.state.post_body_button.yield_self do |b|
+ args.outputs.borders << b
+ args.outputs.labels << b.merge(text: b.text,
+ y: b.y + 30,
+ x: b.x + 10)
+ end
+
+ draw_label args, 0, 6, "Request:", args.state.request_to_s
+ draw_label args, 0, 14, "Request Body Unaltered:", args.state.request_body
+
+ # input
+ if args.inputs.mouse.click
+ # ============= HTTP_POST =============
+ if (args.inputs.mouse.inside_rect? args.state.post_button)
+ # ========= DATA TO SEND ===========
+ form_fields = { "userId" => "#{Time.now.to_i}" }
+ # ==================================
+
+ args.gtk.http_post "http://localhost:9001/testing",
+ form_fields,
+ ["Content-Type: application/x-www-form-urlencoded"]
+
+ args.gtk.notify! "http_post"
+ end
+
+ # ============= HTTP_POST_BODY =============
+ if (args.inputs.mouse.inside_rect? args.state.post_body_button)
+ # =========== DATA TO SEND ==============
+ json = "{ \"userId\": \"#{Time.now.to_i}\"}"
+ # ==================================
+
+ args.gtk.http_post_body "http://localhost:9001/testing",
+ json,
+ ["Content-Type: application/json", "Content-Length: #{json.length}"]
+
+ args.gtk.notify! "http_post_body"
+ end
+ end
+
+ # calc
+ args.inputs.http_requests.each do |r|
+ puts "#{r}"
+ if r.uri == "/testing"
+ puts r
+ args.state.request_to_s = "#{r}"
+ args.state.request_body = r.raw_body
+ r.respond 200, "ok"
+ end
+ end
+end
+
+def draw_label args, row, col, header, text
+ label_pos = args.layout.rect(row: row, col: col, w: 0, h: 0)
+ args.outputs.labels << "#{header}\n\n#{text}".wrapped_lines(80).map_with_index do |l, i|
+ { x: label_pos.x, y: label_pos.y - (i * 15), text: l, size_enum: -2 }
+ end
+end
+
+</code></pre>
<h3 id='----c-extensions---basics---main-rb'>C Extensions - Basics - main.rb</h3>
<pre><code class="language-ruby"># ./samples/12_c_extensions/01_basics/app/main.rb
$gtk.ffi_misc.gtk_dlopen("ext")
@@ -17693,7 +18056,7 @@ def tick args
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $breadcrumbs ||= Breadcrumbs.new(args)
+ $breadcrumbs ||= Breadcrumbs.new
$breadcrumbs.args = args
$breadcrumbs.tick
end
@@ -18342,7 +18705,7 @@ def tick args
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)
+ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new
$early_exit_breadth_first_search.args = args
$early_exit_breadth_first_search.tick
end
@@ -19190,7 +19553,7 @@ def tick args
end
# Every tick, new args are passed, and the Dijkstra tick method is called
- $movement_costs ||= Movement_Costs.new(args)
+ $movement_costs ||= Movement_Costs.new
$movement_costs.args = args
$movement_costs.tick
end
@@ -20174,7 +20537,7 @@ def tick args
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $heuristic_with_walls ||= Heuristic_With_Walls.new(args)
+ $heuristic_with_walls ||= Heuristic_With_Walls.new
$heuristic_with_walls.args = args
$heuristic_with_walls.tick
end
@@ -21191,7 +21554,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
@@ -22224,7 +22587,7 @@ def tick args
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $a_star_algorithm ||= A_Star_Algorithm.new(args)
+ $a_star_algorithm ||= A_Star_Algorithm.new
$a_star_algorithm.args = args
$a_star_algorithm.tick
end
@@ -22751,6 +23114,361 @@ end
<pre><code class="language-ruby"># ./samples/99_genre_3d/02_wireframe/data/what-is-this.txt
https://en.wikipedia.org/wiki/OFF_(file_format)
</code></pre>
+<h3 id='----3d---yaw-pitch-roll---main-rb'>3d - Yaw Pitch Roll - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_3d/03_yaw_pitch_roll/app/main.rb
+class Game
+ attr_gtk
+
+ def tick
+ defaults
+ render
+ input
+ end
+
+ def matrix_mul m, v
+ (hmap x: ((m.x.x * v.x) + (m.x.y * v.y) + (m.x.z * v.z) + (m.x.w * v.w)),
+ y: ((m.y.x * v.x) + (m.y.y * v.y) + (m.y.z * v.z) + (m.y.w * v.w)),
+ z: ((m.z.x * v.x) + (m.z.y * v.y) + (m.z.z * v.z) + (m.z.w * v.w)),
+ w: ((m.w.x * v.x) + (m.w.y * v.y) + (m.w.z * v.z) + (m.w.w * v.w)))
+ end
+
+ def player_ship
+ [
+ # engine back
+ { x: -1, y: -1, z: 1, w: 0 },
+ { x: -1, y: 1, z: 1, w: 0 },
+
+ { x: -1, y: 1, z: 1, w: 0 },
+ { x: 1, y: 1, z: 1, w: 0 },
+
+ { x: 1, y: 1, z: 1, w: 0 },
+ { x: 1, y: -1, z: 1, w: 0 },
+
+ { x: 1, y: -1, z: 1, w: 0 },
+ { x: -1, y: -1, z: 1, w: 0 },
+
+ # engine front
+ { x: -1, y: -1, z: -1, w: 0 },
+ { x: -1, y: 1, z: -1, w: 0 },
+
+ { x: -1, y: 1, z: -1, w: 0 },
+ { x: 1, y: 1, z: -1, w: 0 },
+
+ { x: 1, y: 1, z: -1, w: 0 },
+ { x: 1, y: -1, z: -1, w: 0 },
+
+ { x: 1, y: -1, z: -1, w: 0 },
+ { x: -1, y: -1, z: -1, w: 0 },
+
+ # engine left
+ { x: -1, z: -1, y: -1, w: 0 },
+ { x: -1, z: -1, y: 1, w: 0 },
+
+ { x: -1, z: -1, y: 1, w: 0 },
+ { x: -1, z: 1, y: 1, w: 0 },
+
+ { x: -1, z: 1, y: 1, w: 0 },
+ { x: -1, z: 1, y: -1, w: 0 },
+
+ { x: -1, z: 1, y: -1, w: 0 },
+ { x: -1, z: -1, y: -1, w: 0 },
+
+ # engine right
+ { x: 1, z: -1, y: -1, w: 0 },
+ { x: 1, z: -1, y: 1, w: 0 },
+
+ { x: 1, z: -1, y: 1, w: 0 },
+ { x: 1, z: 1, y: 1, w: 0 },
+
+ { x: 1, z: 1, y: 1, w: 0 },
+ { x: 1, z: 1, y: -1, w: 0 },
+
+ { x: 1, z: 1, y: -1, w: 0 },
+ { x: 1, z: -1, y: -1, w: 0 },
+
+ # top front of engine to front of ship
+ { x: 1, y: 1, z: 1, w: 0 },
+ { x: 0, y: -1, z: 9, w: 0 },
+
+ { x: 0, y: -1, z: 9, w: 0 },
+ { x: -1, y: 1, z: 1, w: 0 },
+
+ # bottom front of engine
+ { x: 1, y: -1, z: 1, w: 0 },
+ { x: 0, y: -1, z: 9, w: 0 },
+
+ { x: -1, y: -1, z: 1, w: 0 },
+ { x: 0, y: -1, z: 9, w: 0 },
+
+ # right wing
+ # front of wing
+ { x: 1, y: 0.10, z: 1, w: 0 },
+ { x: 9, y: 0.10, z: -1, w: 0 },
+
+ { x: 9, y: 0.10, z: -1, w: 0 },
+ { x: 10, y: 0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: 1, y: 0.10, z: -1, w: 0 },
+ { x: 9, y: 0.10, z: -1, w: 0 },
+
+ { x: 10, y: 0.10, z: -2, w: 0 },
+ { x: 8, y: 0.10, z: -1, w: 0 },
+
+ # front of wing
+ { x: 1, y: -0.10, z: 1, w: 0 },
+ { x: 9, y: -0.10, z: -1, w: 0 },
+
+ { x: 9, y: -0.10, z: -1, w: 0 },
+ { x: 10, y: -0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: 1, y: -0.10, z: -1, w: 0 },
+ { x: 9, y: -0.10, z: -1, w: 0 },
+
+ { x: 10, y: -0.10, z: -2, w: 0 },
+ { x: 8, y: -0.10, z: -1, w: 0 },
+
+ # left wing
+ # front of wing
+ { x: -1, y: 0.10, z: 1, w: 0 },
+ { x: -9, y: 0.10, z: -1, w: 0 },
+
+ { x: -9, y: 0.10, z: -1, w: 0 },
+ { x: -10, y: 0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: -1, y: 0.10, z: -1, w: 0 },
+ { x: -9, y: 0.10, z: -1, w: 0 },
+
+ { x: -10, y: 0.10, z: -2, w: 0 },
+ { x: -8, y: 0.10, z: -1, w: 0 },
+
+ # front of wing
+ { x: -1, y: -0.10, z: 1, w: 0 },
+ { x: -9, y: -0.10, z: -1, w: 0 },
+
+ { x: -9, y: -0.10, z: -1, w: 0 },
+ { x: -10, y: -0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: -1, y: -0.10, z: -1, w: 0 },
+ { x: -9, y: -0.10, z: -1, w: 0 },
+
+ { x: -10, y: -0.10, z: -2, w: 0 },
+ { x: -8, y: -0.10, z: -1, w: 0 },
+
+ # left fin
+ # top
+ { x: -1, y: 0.10, z: 1, w: 0 },
+ { x: -1, y: 3, z: -3, w: 0 },
+
+ { x: -1, y: 0.10, z: -1, w: 0 },
+ { x: -1, y: 3, z: -3, w: 0 },
+
+ { x: -1.1, y: 0.10, z: 1, w: 0 },
+ { x: -1.1, y: 3, z: -3, w: 0 },
+
+ { x: -1.1, y: 0.10, z: -1, w: 0 },
+ { x: -1.1, y: 3, z: -3, w: 0 },
+
+ # bottom
+ { x: -1, y: -0.10, z: 1, w: 0 },
+ { x: -1, y: -2, z: -2, w: 0 },
+
+ { x: -1, y: -0.10, z: -1, w: 0 },
+ { x: -1, y: -2, z: -2, w: 0 },
+
+ { x: -1.1, y: -0.10, z: 1, w: 0 },
+ { x: -1.1, y: -2, z: -2, w: 0 },
+
+ { x: -1.1, y: -0.10, z: -1, w: 0 },
+ { x: -1.1, y: -2, z: -2, w: 0 },
+
+ # right fin
+ { x: 1, y: 0.10, z: 1, w: 0 },
+ { x: 1, y: 3, z: -3, w: 0 },
+
+ { x: 1, y: 0.10, z: -1, w: 0 },
+ { x: 1, y: 3, z: -3, w: 0 },
+
+ { x: 1.1, y: 0.10, z: 1, w: 0 },
+ { x: 1.1, y: 3, z: -3, w: 0 },
+
+ { x: 1.1, y: 0.10, z: -1, w: 0 },
+ { x: 1.1, y: 3, z: -3, w: 0 },
+
+ # bottom
+ { x: 1, y: -0.10, z: 1, w: 0 },
+ { x: 1, y: -2, z: -2, w: 0 },
+
+ { x: 1, y: -0.10, z: -1, w: 0 },
+ { x: 1, y: -2, z: -2, w: 0 },
+
+ { x: 1.1, y: -0.10, z: 1, w: 0 },
+ { x: 1.1, y: -2, z: -2, w: 0 },
+
+ { x: 1.1, y: -0.10, z: -1, w: 0 },
+ { x: 1.1, y: -2, z: -2, w: 0 },
+ ]
+ end
+
+ def defaults
+ state.points ||= player_ship
+ state.shifted_points ||= state.points.map { |point| point }
+
+ state.scale ||= 1
+ state.angle_x ||= 0
+ state.angle_y ||= 0
+ state.angle_z ||= 0
+ end
+
+ def matrix_new x0, y0, z0, w0, x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3
+ (hmap x: (hmap x: x0, y: y0, z: z0, w: w0),
+ y: (hmap x: x1, y: y1, z: z1, w: w1),
+ z: (hmap x: x2, y: y2, z: z2, w: w2),
+ w: (hmap x: x3, y: y3, z: z3, w: w3))
+ end
+
+ def angle_z_matrix degrees
+ cos_t = Math.cos degrees.to_radians
+ sin_t = Math.sin degrees.to_radians
+ (matrix_new cos_t, -sin_t, 0, 0,
+ sin_t, cos_t, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1)
+ end
+
+ def angle_y_matrix degrees
+ cos_t = Math.cos degrees.to_radians
+ sin_t = Math.sin degrees.to_radians
+ (matrix_new cos_t, 0, sin_t, 0,
+ 0, 1, 0, 0,
+ -sin_t, 0, cos_t, 0,
+ 0, 0, 0, 1)
+ end
+
+ def angle_x_matrix degrees
+ cos_t = Math.cos degrees.to_radians
+ sin_t = Math.sin degrees.to_radians
+ (matrix_new 1, 0, 0, 0,
+ 0, cos_t, -sin_t, 0,
+ 0, sin_t, cos_t, 0,
+ 0, 0, 0, 1)
+ end
+
+ def scale_matrix factor
+ (matrix_new factor, 0, 0, 0,
+ 0, factor, 0, 0,
+ 0, 0, factor, 0,
+ 0, 0, 0, 1)
+ end
+
+ def input
+ if (inputs.keyboard.shift && inputs.keyboard.p)
+ state.scale -= 0.1
+ elsif inputs.keyboard.p
+ state.scale += 0.1
+ end
+
+ if inputs.mouse.wheel
+ state.scale += inputs.mouse.wheel.y
+ end
+
+ state.scale = state.scale.clamp(0.1, 1000)
+
+ if (inputs.keyboard.shift && inputs.keyboard.y) || inputs.keyboard.right
+ state.angle_y += 1
+ elsif (inputs.keyboard.y) || inputs.keyboard.left
+ state.angle_y -= 1
+ end
+
+ if (inputs.keyboard.shift && inputs.keyboard.x) || inputs.keyboard.down
+ state.angle_x -= 1
+ elsif (inputs.keyboard.x || inputs.keyboard.up)
+ state.angle_x += 1
+ end
+
+ if inputs.keyboard.shift && inputs.keyboard.z
+ state.angle_z += 1
+ elsif inputs.keyboard.z
+ state.angle_z -= 1
+ end
+
+ if inputs.keyboard.zero
+ state.angle_x = 0
+ state.angle_y = 0
+ state.angle_z = 0
+ end
+
+ angle_x = state.angle_x
+ angle_y = state.angle_y
+ angle_z = state.angle_z
+ scale = state.scale
+
+ s_matrix = scale_matrix state.scale
+ x_matrix = angle_z_matrix angle_z
+ y_matrix = angle_y_matrix angle_y
+ z_matrix = angle_x_matrix angle_x
+
+ state.shifted_points = state.points.map do |point|
+ (matrix_mul s_matrix,
+ (matrix_mul z_matrix,
+ (matrix_mul x_matrix,
+ (matrix_mul y_matrix, point)))).merge(original: point)
+ end
+ end
+
+ def thick_line line
+ [
+ line.merge(y: line.y - 1, y2: line.y2 - 1, r: 0, g: 0, b: 0),
+ line.merge(x: line.x - 1, x2: line.x2 - 1, r: 0, g: 0, b: 0),
+ line.merge(x: line.x - 0, x2: line.x2 - 0, r: 0, g: 0, b: 0),
+ line.merge(y: line.y + 1, y2: line.y2 + 1, r: 0, g: 0, b: 0),
+ line.merge(x: line.x + 1, x2: line.x2 + 1, r: 0, g: 0, b: 0)
+ ]
+ end
+
+ def render
+ outputs.lines << state.shifted_points.each_slice(2).map do |(p1, p2)|
+ perc = 0
+ thick_line({ x: p1.x.*(10) + 640, y: p1.y.*(10) + 320,
+ x2: p2.x.*(10) + 640, y2: p2.y.*(10) + 320,
+ r: 255 * perc,
+ g: 255 * perc,
+ b: 255 * perc })
+ end
+
+ outputs.labels << [ 10, 700, "angle_x: #{state.angle_x.to_sf}", 0]
+ outputs.labels << [ 10, 670, "x, shift+x", 0]
+
+ outputs.labels << [210, 700, "angle_y: #{state.angle_y.to_sf}", 0]
+ outputs.labels << [210, 670, "y, shift+y", 0]
+
+ outputs.labels << [410, 700, "angle_z: #{state.angle_z.to_sf}", 0]
+ outputs.labels << [410, 670, "z, shift+z", 0]
+
+ outputs.labels << [610, 700, "scale: #{state.scale.to_sf}", 0]
+ outputs.labels << [610, 670, "p, shift+p", 0]
+ end
+end
+
+$game = Game.new
+
+def tick args
+ $game.args = args
+ $game.tick
+end
+
+def set_angles x, y, z
+ $game.state.angle_x = x
+ $game.state.angle_y = y
+ $game.state.angle_z = z
+end
+
+$gtk.reset
+
+</code></pre>
<h3 id='----arcade---bullet-hell---main-rb'>Arcade - Bullet Hell - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/bullet_hell/app/main.rb
def tick args
@@ -23362,31 +24080,36 @@ class FlappyDragon
end
def render_score
- outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label
- outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label
- outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label
+ outputs.primitives << { x: 10, y: 710, text: "HI SCORE: #{state.hi_score}", **large_white_typeset }
+ outputs.primitives << { x: 10, y: 680, text: "SCORE: #{state.score}", **large_white_typeset }
+ outputs.primitives << { x: 10, y: 650, text: "DIFFICULTY: #{state.difficulty.upcase}", **large_white_typeset }
end
def render_menu
return unless state.scene == :menu
render_overlay
- outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]
- outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]
- outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]
- outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]
- outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]
- outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]
- outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]
+ outputs.labels << { x: 640, y: 700, text: "Flappy Dragon", size_enum: 50, alignment_enum: 1, **white }
+ outputs.labels << { x: 640, y: 500, text: "Instructions: Press Spacebar to flap. Don't die.", size_enum: 4, alignment_enum: 1, **white }
+ outputs.labels << { x: 430, y: 430, text: "[Tab] Change difficulty", size_enum: 4, alignment_enum: 0, **white }
+ outputs.labels << { x: 430, y: 400, text: "[Enter] Start at New Difficulty ", size_enum: 4, alignment_enum: 0, **white }
+ outputs.labels << { x: 430, y: 370, text: "[Escape] Cancel/Resume ", size_enum: 4, alignment_enum: 0, **white }
+ outputs.labels << { x: 640, y: 300, text: "(mouse, touch, and game controllers work, too!) ", size_enum: 4, alignment_enum: 1, **white }
+ outputs.labels << { x: 640, y: 200, text: "Difficulty: #{state.new_difficulty.capitalize}", size_enum: 4, alignment_enum: 1, **white }
- outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]
- outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]
- outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]
- outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]
+ outputs.labels << { x: 10, y: 100, text: "Code: @amirrajan", **white }
+ outputs.labels << { x: 10, y: 80, text: "Art: @mobypixel", **white }
+ outputs.labels << { x: 10, y: 60, text: "Music: @mobypixel", **white }
+ outputs.labels << { x: 10, y: 40, text: "Engine: DragonRuby GTK", **white }
end
def render_overlay
- outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid
+ overlay_rect = grid.rect.scale_rect(1.1, 0, 0)
+ outputs.primitives << { x: overlay_rect.x,
+ y: overlay_rect.y,
+ w: overlay_rect.w,
+ h: overlay_rect.h,
+ r: 0, g: 0, b: 0, a: 230 }.solid!
end
def render_game
@@ -23399,14 +24122,14 @@ class FlappyDragon
def render_game_over
return unless state.scene == :game
- outputs.labels << [638, 358, score_text, 20, 1]
- outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]
- outputs.labels << [638, 428, countdown_text, 20, 1]
- outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]
+ outputs.labels << { x: 638, y: 358, text: score_text, size_enum: 20, alignment_enum: 1 }
+ outputs.labels << { x: 635, y: 360, text: score_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }
+ outputs.labels << { x: 638, y: 428, text: countdown_text, size_enum: 20, alignment_enum: 1 }
+ outputs.labels << { x: 635, y: 430, text: countdown_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }
end
def render_background
- outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']
+ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: 'sprites/background.png' }
scroll_point_at = state.tick_count
scroll_point_at = state.scene_at if state.scene == :menu
@@ -23418,11 +24141,18 @@ class FlappyDragon
outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80)
end
+ def scrolling_background at, path, rate, y = 0
+ [
+ { x: 0 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path },
+ { x: 1440 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path }
+ ]
+ end
+
def render_walls
state.walls.each do |w|
w.sprites = [
- [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],
- [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]
+ { x: w.x, y: w.bottom_height - 720, w: 100, h: 720, path: 'sprites/wall.png', angle: 180 },
+ { x: w.x, y: w.top_y, w: 100, h: 720, path: 'sprites/wallbottom.png', angle: 0 }
]
end
outputs.sprites << state.walls.map(&:sprites)
@@ -23431,15 +24161,13 @@ class FlappyDragon
def render_dragon
state.show_death = true if state.countdown == 3.seconds
- render_debug_hitbox false
-
if state.show_death == false || !state.death_at
animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at
sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png"
- state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]
+ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }
else
sprite_name = "sprites/dragon_die.png"
- state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]
+ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }
sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds
state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1
state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction
@@ -23449,20 +24177,12 @@ class FlappyDragon
outputs.sprites << state.dragon_sprite
end
- def render_debug_hitbox show
- return unless show
- outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite
- outputs.borders << state.walls.flat_map do |w|
- w.sprites.map { |s| [s.rect, 255, 0, 0] }
- end
- end
-
def render_flash
return unless state.flash_at
- outputs.primitives << [grid.rect,
- white,
- 255 * state.flash_at.ease(20, :flip)].solid
+ outputs.primitives << { **grid.rect.to_hash,
+ **white,
+ a: 255 * state.flash_at.ease(20, :flip) }.solid!
state.flash_at = 0 if state.flash_at.elapsed_time > 20
end
@@ -23582,19 +24302,12 @@ class FlappyDragon
end
end
- def scrolling_background at, path, rate, y = 0
- [
- [ 0 - at.*(rate) % 1440, y, 1440, 720, path],
- [1440 - at.*(rate) % 1440, y, 1440, 720, path]
- ]
- end
-
def white
- [255, 255, 255]
+ { r: 255, g: 255, b: 255 }
end
def large_white_typeset
- [5, 0, 255, 255, 255]
+ { size_enum: 5, alignment_enum: 0, r: 255, g: 255, b: 255 }
end
def at_beginning?
@@ -23603,9 +24316,9 @@ class FlappyDragon
def dragon_collision_box
state.dragon_sprite
- .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)
- .rect_shift_right(10)
- .rect_shift_up(state.dy * 2)
+ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)
+ .rect_shift_right(10)
+ .rect_shift_up(state.dy * 2)
end
def game_over?
@@ -23614,7 +24327,7 @@ class FlappyDragon
state.walls
.flat_map { |w| w.sprites }
.any? do |s|
- s.intersect_rect?(dragon_collision_box)
+ s && s.intersect_rect?(dragon_collision_box)
end
end
@@ -24991,317 +25704,6 @@ def move_player args, *vector
end
</code></pre>
-<h3 id='----crafting---farming-game-starting-point---repl-rb'>Crafting - Farming Game Starting Point - repl.rb</h3>
-<pre><code class="language-ruby"># ./samples/99_genre_crafting/farming_game_starting_point/app/repl.rb
-# ===============================================================
-# Welcome to repl.rb
-# ===============================================================
-# You can experiement with code within this file. Code in this
-# file is only executed when you save (and only excecuted ONCE).
-# ===============================================================
-
-# ===============================================================
-# REMOVE the "x" from the word "xrepl" and save the file to RUN
-# the code in between the do/end block delimiters.
-# ===============================================================
-
-# ===============================================================
-# ADD the "x" to the word "repl" (make it xrepl) and save the
-# file to IGNORE the code in between the do/end block delimiters.
-# ===============================================================
-
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- puts "The result of 1 + 2 is: #{1 + 2}"
-end
-
-# ====================================================================================
-# Ruby Crash Course:
-# Strings, Numeric, Booleans, Conditionals, Looping, Enumerables, Arrays
-# ====================================================================================
-
-# ====================================================================================
-# Strings
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- message = "Hello World"
- puts "The value of message is: " + message
- puts "Any value can be interpolated within a string using \#{}."
- puts "Interpolated message: #{message}."
- puts 'This #{message} is not interpolated because the string uses single quotes.'
-end
-
-# ====================================================================================
-# Numerics
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- a = 10
- puts "The value of a is: #{a}"
- puts "a + 1 is: #{a + 1}"
- puts "a / 3 is: #{a / 3}"
-end
-
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- b = 10.12
- puts "The value of b is: #{b}"
- puts "b + 1 is: #{b + 1}"
- puts "b as an integer is: #{b.to_i}"
- puts ''
-end
-
-# ====================================================================================
-# Booleans
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- c = 30
- puts "The value of c is #{c}."
-
- if c
- puts "This if statement ran because c is truthy."
- end
-end
-
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- d = false
- puts "The value of d is #{d}."
-
- if !d
- puts "This if statement ran because d is falsey, using the not operator (!) makes d evaluate to true."
- end
-
- e = nil
- puts "Nil is also considered falsey. The value of e is: #{e}."
-
- if !e
- puts "This if statement ran because e is nil (a falsey value)."
- end
-end
-
-# ====================================================================================
-# Conditionals
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- i_am_true = true
- i_am_nil = nil
- i_am_false = false
- i_am_hi = "hi"
-
- puts "======== if statement"
- i_am_one = 1
- if i_am_one
- puts "This was printed because i_am_one is truthy."
- end
-
- puts "======== if/else statement"
- if i_am_false
- puts "This will NOT get printed because i_am_false is false."
- else
- puts "This was printed because i_am_false is false."
- end
-
- puts "======== if/elsif/else statement"
- if i_am_false
- puts "This will NOT get printed because i_am_false is false."
- elsif i_am_true
- puts "This was printed because i_am_true is true."
- else
- puts "This will NOT get printed i_am_true was true."
- end
-
- puts "======== case statement "
- i_am_one = 1
- case i_am_one
- when 10
- puts "case equaled: 10"
- when 9
- puts "case equaled: 9"
- when 5
- puts "case equaled: 5"
- when 1
- puts "case equaled: 1"
- else
- puts "Value wasn't cased."
- end
-
- puts "======== different types of comparisons"
- if 4 == 4
- puts "equal (4 == 4)"
- end
-
- if 4 != 3
- puts "not equal (4 != 3)"
- end
-
- if 3 < 4
- puts "less than (3 < 4)"
- end
-
- if 4 > 3
- puts "greater than (4 > 3)"
- end
-
- if ((4 > 3) || (3 < 4) || false)
- puts "or statement ((4 > 3) || (3 < 4) || false)"
- end
-
- if ((4 > 3) && (3 < 4))
- puts "and statement ((4 > 3) && (3 < 4))"
- end
-end
-
-# ====================================================================================
-# Looping
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- puts "======== times block"
- 3.times do |i|
- puts i
- end
- puts "======== range block exclusive"
- (0...3).each do |i|
- puts i
- end
- puts "======== range block inclusive"
- (0..3).each do |i|
- puts i
- end
-end
-
-# ====================================================================================
-# Enumerables
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- puts "======== array each"
- colors = ["red", "blue", "yellow"]
- colors.each do |color|
- puts color
- end
-
- puts '======== array each_with_index'
- colors = ["red", "blue", "yellow"]
- colors.each_with_index do |color, i|
- puts "#{color} at index #{i}"
- end
-end
-
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- puts "======== single parameter function"
- def add_one_to n
- n + 5
- end
-
- puts add_one_to(3)
-
- puts "======== function with default value"
- def function_with_default_value v = 10
- v * 10
- end
-
- puts "passing three: #{function_with_default_value(3)}"
- puts "passing nil: #{function_with_default_value}"
-
- puts "======== Or Equal (||=) operator for nil values"
- def function_with_nil_default_with_local a = nil
- result = a
- result ||= "or equal operator was exected and set a default value"
- end
-
- puts "passing 'hi': #{function_with_nil_default_with_local 'hi'}"
- puts "passing nil: #{function_with_nil_default_with_local}"
-end
-
-# ====================================================================================
-# Arrays
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- puts "======== Create an array with the numbers 1 to 10."
- one_to_ten = (1..10).to_a
- puts one_to_ten
-
- puts "======== Create a new array that only contains even numbers from the previous array."
- one_to_ten = (1..10).to_a
- evens = one_to_ten.find_all do |number|
- number % 2 == 0
- end
- puts evens
-
- puts "======== Create a new array that rejects odd numbers."
- one_to_ten = (1..10).to_a
- also_even = one_to_ten.reject do |number|
- number % 2 != 0
- end
- puts also_even
-
- puts "======== Create an array that doubles every number."
- one_to_ten = (1..10).to_a
- doubled = one_to_ten.map do |number|
- number * 2
- end
- puts doubled
-
- puts "======== Create an array that selects only odd numbers and then multiply those by 10."
- one_to_ten = (1..10).to_a
- odd_doubled = one_to_ten.find_all do |number|
- number % 2 != 0
- end.map do |odd_number|
- odd_number * 10
- end
- puts odd_doubled
-
- puts "======== All combination of numbers 1 to 10."
- one_to_ten = (1..10).to_a
- all_combinations = one_to_ten.product(one_to_ten)
- puts all_combinations
-
- puts "======== All uniq combinations of numbers. For example: [1, 2] is the same as [2, 1]."
- one_to_ten = (1..10).to_a
- uniq_combinations =
- one_to_ten.product(one_to_ten)
- .map do |unsorted_number|
- unsorted_number.sort
- end.uniq
- puts uniq_combinations
-end
-
-# ====================================================================================
-# Advanced Arrays
-# ====================================================================================
-# Remove the x from xrepl to run the code. Add the x back to ignore to code.
-xrepl do
- puts "======== All unique Pythagorean Triples between 1 and 40 sorted by area of the triangle."
-
- one_to_hundred = (1..40).to_a
- triples =
- one_to_hundred.product(one_to_hundred).map do |width, height|
- [width, height, Math.sqrt(width ** 2 + height ** 2)]
- end.find_all do |_, _, hypotenuse|
- hypotenuse.to_i == hypotenuse
- end.map do |triangle|
- triangle.map(&:to_i)
- end.uniq do |triangle|
- triangle.sort
- end.map do |width, height, hypotenuse|
- [width, height, hypotenuse, (width * height) / 2]
- end.sort_by do |_, _, _, area|
- area
- end
-
- triples.each do |width, height, hypotenuse, area|
- puts "(#{width}, #{height}, #{hypotenuse}) = #{area}"
- end
-end
-
-</code></pre>
<h3 id='----crafting---farming-game-starting-point---tests-rb'>Crafting - Farming Game Starting Point - tests.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
# For advanced users:
@@ -28442,9 +28844,376 @@ end
$gtk.reset
</code></pre>
+<h3 id='----mario---jumping---main-rb'>Mario - Jumping - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_mario/01_jumping/app/main.rb
+def tick args
+ defaults args
+ render args
+ input args
+ calc args
+end
+
+def defaults args
+ args.state.player.x ||= args.grid.w.half
+ args.state.player.y ||= 0
+ args.state.player.size ||= 100
+ args.state.player.dy ||= 0
+ args.state.player.action ||= :jumping
+ args.state.jump.power = 20
+ args.state.jump.increase_frames = 10
+ args.state.jump.increase_power = 1
+ args.state.gravity = -1
+end
+
+def render args
+ args.outputs.sprites << {
+ x: args.state.player.x -
+ args.state.player.size.half,
+ y: args.state.player.y,
+ w: args.state.player.size,
+ h: args.state.player.size,
+ path: 'sprites/square/red.png'
+ }
+end
+
+def input args
+ if args.inputs.keyboard.key_down.space
+ if args.state.player.action == :standing
+ args.state.player.action = :jumping
+ args.state.player.dy = args.state.jump.power
+
+ # record when the action took place
+ current_frame = args.state.tick_count
+ args.state.player.action_at = current_frame
+ end
+ end
+
+ # if the space bar is being held
+ if args.inputs.keyboard.key_held.space
+ # is the player jumping
+ is_jumping = args.state.player.action == :jumping
+
+ # when was the jump performed
+ time_of_jump = args.state.player.action_at
+
+ # how much time has passed since the jump
+ jump_elapsed_time = time_of_jump.elapsed_time
+
+ # how much time is allowed for increasing power
+ time_allowed = args.state.jump.increase_frames
+
+ # if the player is jumping
+ # and the elapsed time is less than
+ # the allowed time
+ if is_jumping && jump_elapsed_time < time_allowed
+ # increase the dy by the increase power
+ power_to_add = args.state.jump.increase_power
+ args.state.player.dy += power_to_add
+ end
+ end
+end
+
+def calc args
+ if args.state.player.action == :jumping
+ args.state.player.y += args.state.player.dy
+ args.state.player.dy += args.state.gravity
+ end
+
+ if args.state.player.y < 0
+ args.state.player.y = 0
+ args.state.player.action = :standing
+ end
+end
+
+</code></pre>
+<h3 id='----mario---jumping-and-collisions---main-rb'>Mario - Jumping And Collisions - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_mario/02_jumping_and_collisions/app/main.rb
+class Game
+ attr_gtk
+
+ def tick
+ defaults
+ render
+ input
+ calc
+ end
+
+ def defaults
+ return if state.tick_count != 0
+
+ player.x = 64
+ player.y = 800
+ player.size = 50
+ player.dx = 0
+ player.dy = 0
+ player.action = :falling
+
+ player.max_speed = 20
+ player.jump_power = 15
+ player.jump_air_time = 15
+ player.jump_increase_power = 1
+
+ state.gravity = -1
+ state.drag = 0.001
+ state.tile_size = 64
+ state.tiles ||= [
+ { ordinal_x: 0, ordinal_y: 0 },
+ { ordinal_x: 1, ordinal_y: 0 },
+ { ordinal_x: 2, ordinal_y: 0 },
+ { ordinal_x: 3, ordinal_y: 0 },
+ { ordinal_x: 4, ordinal_y: 0 },
+ { ordinal_x: 5, ordinal_y: 0 },
+ { ordinal_x: 6, ordinal_y: 0 },
+ { ordinal_x: 7, ordinal_y: 0 },
+ { ordinal_x: 8, ordinal_y: 0 },
+ { ordinal_x: 9, ordinal_y: 0 },
+ { ordinal_x: 10, ordinal_y: 0 },
+ { ordinal_x: 11, ordinal_y: 0 },
+ { ordinal_x: 12, ordinal_y: 0 },
+
+ { ordinal_x: 9, ordinal_y: 3 },
+ { ordinal_x: 10, ordinal_y: 3 },
+ { ordinal_x: 11, ordinal_y: 3 },
+ ]
+
+ tiles.each do |t|
+ t.rect = { x: t.ordinal_x * 64,
+ y: t.ordinal_y * 64,
+ w: 64,
+ h: 64 }
+ end
+ end
+
+ def render
+ render_player
+ render_tiles
+ # render_grid
+ end
+
+ def input
+ input_jump
+ input_move
+ end
+
+ def calc
+ calc_player_rect
+ calc_left
+ calc_right
+ calc_below
+ calc_above
+ calc_player_dy
+ calc_player_dx
+ calc_game_over
+ end
+
+ def render_player
+ outputs.sprites << {
+ x: player.x,
+ y: player.y,
+ w: player.size,
+ h: player.size,
+ path: 'sprites/square/red.png'
+ }
+ end
+
+ def render_tiles
+ outputs.sprites << state.tiles.map do |t|
+ t.merge path: 'sprites/square/white.png',
+ x: t.ordinal_x * 64,
+ y: t.ordinal_y * 64,
+ w: 64,
+ h: 64
+ end
+ end
+
+ def render_grid
+ if state.tick_count == 0
+ outputs[:grid].background_color = [0, 0, 0, 0]
+ outputs[:grid].borders << available_brick_locations
+ outputs[:grid].labels << available_brick_locations.map do |b|
+ [
+ b.merge(text: "#{b.ordinal_x},#{b.ordinal_y}",
+ x: b.x + 2,
+ y: b.y + 2,
+ size_enum: -3,
+ vertical_alignment_enum: 0,
+ blendmode_enum: 0),
+ b.merge(text: "#{b.x},#{b.y}",
+ x: b.x + 2,
+ y: b.y + 2 + 20,
+ size_enum: -3,
+ vertical_alignment_enum: 0,
+ blendmode_enum: 0)
+ ]
+ end
+ end
+
+ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :grid }
+ end
+
+ def input_jump
+ if inputs.keyboard.key_down.space
+ player_jump
+ end
+
+ if inputs.keyboard.key_held.space
+ player_jump_increase_air_time
+ end
+ end
+
+ def input_move
+ if player.dx.abs < 20
+ if inputs.keyboard.left
+ player.dx -= 2
+ elsif inputs.keyboard.right
+ player.dx += 2
+ end
+ end
+ end
+
+ def calc_game_over
+ if player.y < -64
+ player.x = 64
+ player.y = 800
+ player.dx = 0
+ player.dy = 0
+ end
+ end
+
+ def calc_player_rect
+ player.rect = player_current_rect
+ player.next_rect = player_next_rect
+ player.prev_rect = player_prev_rect
+ end
+
+ def calc_player_dx
+ player.dx = player_next_dx
+ player.x += player.dx
+ end
+
+ def calc_player_dy
+ player.y += player.dy
+ player.dy = player_next_dy
+ end
+
+ def calc_below
+ return unless player.dy < 0
+ tiles_below = tiles_find { |t| t.rect.top <= player.prev_rect.y }
+ collision = tiles_find_colliding tiles_below, (player.rect.merge y: player.next_rect.y)
+ if collision
+ player.y = collision.rect.y + state.tile_size
+ player.dy = 0
+ player.action = :standing
+ else
+ player.action = :falling
+ end
+ end
+
+ def calc_left
+ return unless player.dx < 0 && player_next_dx < 0
+ tiles_left = tiles_find { |t| t.rect.right <= player.prev_rect.left }
+ collision = tiles_find_colliding tiles_left, (player.rect.merge x: player.next_rect.x)
+ return unless collision
+ player.x = collision.rect.right
+ player.dx = 0
+ end
+
+ def calc_right
+ return unless player.dx > 0 && player_next_dx > 0
+ tiles_right = tiles_find { |t| t.rect.left >= player.prev_rect.right }
+ collision = tiles_find_colliding tiles_right, (player.rect.merge x: player.next_rect.x)
+ return unless collision
+ player.x = collision.rect.left - player.rect.w
+ player.dx = 0
+ end
+
+ def calc_above
+ return unless player.dy > 0
+ tiles_above = tiles_find { |t| t.rect.y >= player.prev_rect.y }
+ collision = tiles_find_colliding tiles_above, (player.rect.merge y: player.next_rect.y)
+ return unless collision
+ player.dy = 0
+ player.y = collision.rect.bottom - player.rect.h
+ end
+
+ def player_current_rect
+ { x: player.x, y: player.y, w: player.size, h: player.size }
+ end
+
+ def available_brick_locations
+ (0..19).to_a
+ .product(0..11)
+ .map do |(ordinal_x, ordinal_y)|
+ { ordinal_x: ordinal_x,
+ ordinal_y: ordinal_y,
+ x: ordinal_x * 64,
+ y: ordinal_y * 64,
+ w: 64,
+ h: 64 }
+ end
+ end
+
+ def player
+ state.player ||= args.state.new_entity :player
+ end
+
+ def player_next_dy
+ player.dy + state.gravity + state.drag ** 2 * -1
+ end
+
+ def player_next_dx
+ player.dx * 0.8
+ end
+
+ def player_next_rect
+ player.rect.merge x: player.x + player_next_dx,
+ y: player.y + player_next_dy
+ end
+
+ def player_prev_rect
+ player.rect.merge x: player.x - player.dx,
+ y: player.y - player.dy
+ end
+
+ def player_jump
+ return if player.action != :standing
+ player.action = :jumping
+ player.dy = state.player.jump_power
+ current_frame = state.tick_count
+ player.action_at = current_frame
+ end
+
+ def player_jump_increase_air_time
+ return if player.action != :jumping
+ return if player.action_at.elapsed_time >= player.jump_air_time
+ player.dy += player.jump_increase_power
+ end
+
+ def tiles
+ state.tiles
+ end
+
+ def tiles_find_colliding tiles, target
+ tiles.find { |t| t.rect.intersect_rect? target }
+ end
+
+ def tiles_find &block
+ tiles.find_all(&block)
+ end
+end
+
+def tick args
+ $game ||= Game.new
+ $game.args = args
+ $game.tick
+end
+
+$gtk.reset
+
+</code></pre>
<h3 id='----platformer---clepto-frog---main-rb'>Platformer - Clepto Frog - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/clepto_frog/app/main.rb
-MAP_FILE_PATH = 'app/map.txt'
+MAP_FILE_PATH = 'map.txt'
require 'app/map.rb'
@@ -28499,35 +29268,7 @@ class CleptoFrog
def render_intro
outputs.labels << [640, 700, "Clepto Frog", 4, 1]
- if state.tick_count >= 120
- outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",
- 4, 1, 0, 0, 0, 255 * 120.ease(60)]
- end
-
- if state.tick_count >= 240
- outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",
- 4, 1, 0, 0, 0, 255 * 240.ease(60)]
- end
-
- if state.tick_count >= 360
- outputs.labels << [640, 540, "\"Uh...\" - New Guy",
- 4, 1, 0, 0, 0, 255 * 360.ease(60)]
- end
-
- if state.tick_count >= 480
- outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",
- 4, 1, 0, 0, 0, 255 * 480.ease(60)]
- end
-
- if state.tick_count >= 600
- outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",
- 4, 1, 0, 0, 0, 255 * 600.ease(60)]
- end
-
- outputs.sprites << [640 - 50, 360 - 50, 100, 100,
- "sprites/square-green.png"]
-
- if state.tick_count == 800
+ if state.tick_count == 120
state.scene = :game
state.game_start_at = state.tick_count
end
@@ -28535,7 +29276,7 @@ class CleptoFrog
def tick
defaults
- if state.scene == :intro && state.tick_count <= 800
+ if state.scene == :intro && state.tick_count <= 120
render_intro
elsif state.scene == :ending
render_ending
@@ -28638,15 +29379,15 @@ class CleptoFrog
if state.god_mode
# SHOW HIDE COLLISIONS
- outputs.sprites << state.world.map do |x, y, w, h|
- x = vx(x)
- y = vy(y)
+ outputs.sprites << state.world.map do |rect|
+ x = vx(rect.x)
+ y = vy(rect.y)
if x > -80 && x < 1280 && y > -80 && y < 720
{
x: x,
y: y,
- w: vw(w || state.tile_size),
- h: vh(h || state.tile_size),
+ w: vw(rect.w || state.tile_size),
+ h: vh(rect.h || state.tile_size),
path: 'sprites/square-gray.png',
a: 128
}
@@ -28669,8 +29410,10 @@ class CleptoFrog
# Creates sprite following mouse to help indicate which sprite you have selected
- outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,
- state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite
+ outputs.primitives << [inputs.mouse.position.x - 32 * state.camera_scale,
+ inputs.mouse.position.y - 32 * state.camera_scale,
+ state.tile_size * state.camera_scale,
+ state.tile_size * state.camera_scale, 'sprites/square-indigo.png', 0, 100].sprite
end
render_mini_map
@@ -28751,6 +29494,29 @@ class CleptoFrog
set_camera_scale 1
end
+ if inputs.mouse.click
+ state.id_seed += 1
+ id = state.id_seed
+ x = state.camera_x + (inputs.mouse.click.x.fdiv(state.camera_scale) - 32)
+ y = state.camera_y + (inputs.mouse.click.y.fdiv(state.camera_scale) - 32)
+ x = ((x + 2).idiv 4) * 4
+ y = ((y + 2).idiv 4) * 4
+ w = 64
+ h = 64
+ candidate_rect = { id: id, x: x, y: y, w: w, h: h }
+ scaled_candidate_rect = { x: x + 30, y: y + 30, w: w - 60, h: h - 60 }
+ to_remove = state.world.find { |r| r.intersect_rect? scaled_candidate_rect }
+ if to_remove && args.inputs.keyboard.x
+ state.world.reject! { |r| r.id == to_remove.id }
+ else
+ state.world << candidate_rect
+ end
+ export_map
+ state.world_lookup = {}
+ state.world_collision_rects = nil
+ calc_world_lookup
+ end
+
if input_up?
state.y += 10
state.dy = 0
@@ -28772,12 +29538,6 @@ class CleptoFrog
if state.scene == :game
process_inputs_player_movement
process_inputs_god_mode
- elsif state.scene == :intro
- if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space
- if Kernel.tick_count < 600
- Kernel.tick_count = 600
- end
- end
end
end
@@ -28875,17 +29635,6 @@ class CleptoFrog
end
end
- def add_floors
- # floors
- state.world += [
- [0, 0, 10000, 40],
- [0, 1670, 3250, 60],
- [6691, 1653, 3290, 60],
- [1521, 3792, 7370, 60],
- [0, 5137, 3290, 60]
- ]
- end
-
def attempt_load_world_from_file
return if state.world
# exported_world = gtk.read_file(MAP_FILE_PATH)
@@ -28893,26 +29642,11 @@ class CleptoFrog
state.objects = []
if $collisions
- $collisions.map do |x, y, w, h|
- state.world << [x, y, w, h]
+ state.id_seed ||= 0
+ $collisions.each do |x, y, w, h|
+ state.id_seed += 1
+ state.world << { id: state.id_seed, x: x, y: y, w: w, h: h }
end
-
- add_floors
- # elsif exported_world
- # exported_world.each_line.map do |l|
- # tokens = l.strip.split(',')
- # x = tokens[0].to_i
- # y = tokens[1].to_i
- # type = tokens[2].to_i
- # if type == 1
- # state.world << [x, y, state.tile_size, state.tile_size]
- # elsif type == 2
- # w, h, path = tokens[3..-1]
- # state.objects << [x, y, w.to_i, h.to_i, path]
- # end
- # end
-
- # add_floors
end
if $mugs
@@ -28933,23 +29667,24 @@ class CleptoFrog
# Searches through the world and finds the cordinates that exist
state.world_lookup = {}
- state.world.each do |x, y, w, h|
- state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true
+ state.world.each do |rect|
+ state.world_lookup[rect.id] = rect
end
# Assigns collision rects for every sprite drawn
state.world_collision_rects =
state.world_lookup
.keys
- .map do |x, y, w, h|
+ .map do |key|
+ rect = state.world_lookup[key]
s = state.tile_size
- w ||= s
- h ||= s
+ rect.w ||= s
+ rect.h ||= s
{
- args: [x, y, w, h],
- left_right: [x, y + 4, w, h - 6],
- top: [x + 4, y + 6, w - 8, h - 6],
- bottom: [x + 1, y - 1, w - 2, h - 8],
+ args: rect,
+ left_right: { x: rect.x, y: rect.y + 4, w: rect.w, h: rect.h - 6 },
+ top: { x: rect.x + 4, y: rect.y + 6, w: rect.w - 8, h: rect.h - 6 },
+ bottom: { x: rect.x + 1, y: rect.y - 1, w: rect.w - 2, h: rect.h - 8 },
}
end
@@ -29005,12 +29740,21 @@ class CleptoFrog
def end_of_tongue
p = state.tongue_angle.vector(state.tongue_length)
- [start_of_tongue.x + p.x, start_of_tongue.y + p.y]
+ { x: start_of_tongue.x + p.x, y: start_of_tongue.y + p.y }
end
def calc_shooting
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ end
+
+ def calc_shooting_increment
return unless state.action == :shooting
- state.tongue_length += 30
+ state.tongue_length += 5
potential_anchor = end_of_tongue
if potential_anchor.x <= 0
state.anchor_point = potential_anchor
@@ -29029,9 +29773,9 @@ class CleptoFrog
state.action = :anchored
outputs.sounds << 'sounds/attached.wav'
else
- anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]
+ anchor_rect = { x: potential_anchor.x - 5, y: potential_anchor.y - 5, w: 10, h: 10 }
collision = state.world_collision_rects.find_all do |v|
- [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)
+ v[:args].intersect_rect?(anchor_rect)
end.first
if collision
state.anchor_point = potential_anchor
@@ -29127,7 +29871,7 @@ class CleptoFrog
.first
return unless left_side_collisions
- state.x = left_side_collisions[:left_right].right
+ state.x = left_side_collisions[:left_right].right + 1
state.dx = state.dy.abs * 0.8
state.collision_on_x = true
end
@@ -29142,7 +29886,7 @@ class CleptoFrog
.first
return unless right_side_collisions
- state.x = right_side_collisions[:left_right].left - state.tile_size
+ state.x = right_side_collisions[:left_right].left - state.tile_size - 1
state.dx = state.dx.abs * 0.8 * -1
state.collision_on_x = true
end
@@ -29158,7 +29902,7 @@ class CleptoFrog
.first
return unless ceil_collisions
- state.y = ceil_collisions[:bottom].y - state.tile_size
+ state.y = ceil_collisions[:bottom].y - state.tile_size - 1
state.dy = state.dy.abs * 0.8 * -1
state.collision_on_y = true
end
@@ -29171,13 +29915,17 @@ class CleptoFrog
end
def export_map
- export_string = state.world.map do |x, y|
- "#{x},#{y},1"
- end
+ export_string = "$collisions = [\n"
+ export_string += state.world.map do |rect|
+ "[#{rect.x},#{rect.y},#{rect.w},#{rect.h}],"
+ end.join "\n"
+ export_string += "\n]\n\n"
+ export_string += "$mugs = [\n"
export_string += state.objects.map do |x, y, w, h, path|
- "#{x},#{y},2,#{w},#{h},#{path}"
- end
- gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))
+ "[#{x},#{y},#{w},#{h},'#{path}'],"
+ end.join "\n"
+ export_string += "\n]\n\n"
+ gtk.write_file(MAP_FILE_PATH, export_string)
state.map_saved_at = state.tick_count
end
@@ -30303,6 +31051,11 @@ $collisions = [
[4459, 3997, 64, 64],
[76, 5215, 64, 64],
[39, 5217, 64, 64],
+ [0, 0, 10000, 40],
+ [0, 1670, 3250, 60],
+ [6691, 1653, 3290, 60],
+ [1521, 3792, 7370, 60],
+ [0, 5137, 3290, 60]
]
$mugs = [
@@ -31148,6 +31901,7 @@ class FallingCircle
end
def load_lines file
+ return unless state.snaps
data = gtk.read_file(file) || ""
data.each_line
.reject { |l| l.strip.length == 0 }
@@ -31206,10 +31960,10 @@ class FallingCircle
results[:point] = { x: x, y: y }
results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 }
results[:trajectory] = trajectory(results)
- results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|
+ results[:impacts] = terrain.find_all { |t| t && (line_near_rect? results[:rect], t) }.map do |t|
{
terrain: t,
- point: geometry.line_intersect(results[:trajectory], t),
+ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),
type: :terrain
}
end.reject { |t| !point_within_line? t[:point], t[:terrain] }
@@ -31217,10 +31971,10 @@ class FallingCircle
results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t|
{
terrain: t,
- point: geometry.line_intersect(results[:trajectory], t),
+ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),
type: :lava
}
- end.reject { |t| !point_within_line? t[:point], t[:terrain] }
+ end.reject { |t| !t || (!point_within_line? t[:point], t[:terrain]) }
results
end
@@ -31233,6 +31987,7 @@ class FallingCircle
end
def calc_terrains_to_monitor
+ return unless circle.impacts
circle.impact = nil
circle.impacts.each do |i|
circle.terrains_to_monitor[i[:terrain]] ||= {
@@ -36733,6 +37488,149 @@ def tick args
end
</code></pre>
+<h3 id='----rpg-topdown---topdown-casino---main-rb'>Rpg Topdown - Topdown Casino - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_rpg_topdown/topdown_casino/app/main.rb
+$gtk.reset
+
+def coinflip
+ rand < 0.5
+end
+
+class Game
+ attr_accessor :args
+
+ def text_font
+ return nil #"rpg.ttf"
+ end
+
+ def text_color
+ [ 255, 255, 255, 255 ]
+ end
+
+ def set_gem_values
+ @args.state.gem0 = ((coinflip) ? 100 : 20)
+ @args.state.gem1 = ((coinflip) ? -10 : -50)
+ @args.state.gem2 = ((coinflip) ? -10 : -30)
+ if coinflip
+ tmp = @args.state.gem0
+ @args.state.gem0 = @args.state.gem1
+ @args.state.gem1 = tmp
+ end
+ if coinflip
+ tmp = @args.state.gem1
+ @args.state.gem1 = @args.state.gem2
+ @args.state.gem2 = tmp
+ end
+ if coinflip
+ tmp = @args.state.gem0
+ @args.state.gem0 = @args.state.gem2
+ @args.state.gem2 = tmp
+ end
+ end
+
+ def initialize args
+ @args = args
+ @args.state.animticks = 0
+ @args.state.score = 0
+ @args.state.gem_chosen = false
+ @args.state.round_finished = false
+ @args.state.gem0_x = 197
+ @args.state.gem0_y = 720-274
+ @args.state.gem1_x = 623
+ @args.state.gem1_y = 720-274
+ @args.state.gem2_x = 1049
+ @args.state.gem2_y = 720-274
+ @args.state.hero_sprite = "sprites/herodown100.png"
+ @args.state.hero_x = 608
+ @args.state.hero_y = 720-656
+ set_gem_values
+ end
+
+ def render_gem_value x, y, gem
+ if @args.state.gem_chosen
+ @args.outputs.labels << [ x, y + 96, gem.to_s, 1, 1, *text_color, text_font ]
+ end
+ end
+
+ def render
+ gemsprite = ((@args.state.animticks % 400) < 200) ? 'sprites/gem200.png' : 'sprites/gem400.png'
+ @args.outputs.background_color = [ 0, 0, 0, 255 ]
+ @args.outputs.sprites << [608, 720-150, 64, 64, 'sprites/oldman.png']
+ @args.outputs.sprites << [300, 720-150, 64, 64, 'sprites/fire.png']
+ @args.outputs.sprites << [900, 720-150, 64, 64, 'sprites/fire.png']
+ @args.outputs.sprites << [@args.state.gem0_x, @args.state.gem0_y, 32, 64, gemsprite]
+ @args.outputs.sprites << [@args.state.gem1_x, @args.state.gem1_y, 32, 64, gemsprite]
+ @args.outputs.sprites << [@args.state.gem2_x, @args.state.gem2_y, 32, 64, gemsprite]
+ @args.outputs.sprites << [@args.state.hero_x, @args.state.hero_y, 64, 64, @args.state.hero_sprite]
+
+ @args.outputs.labels << [ 630, 720-30, "IT'S A SECRET TO EVERYONE.", 1, 1, *text_color, text_font ]
+ @args.outputs.labels << [ 50, 720-85, @args.state.score.to_s, 1, 1, *text_color, text_font ]
+ render_gem_value @args.state.gem0_x, @args.state.gem0_y, @args.state.gem0
+ render_gem_value @args.state.gem1_x, @args.state.gem1_y, @args.state.gem1
+ render_gem_value @args.state.gem2_x, @args.state.gem2_y, @args.state.gem2
+ end
+
+ def calc
+ @args.state.animticks += 16
+
+ return unless @args.state.gem_chosen
+ @args.state.round_finished_debounce ||= 60 * 3
+ @args.state.round_finished_debounce -= 1
+ return if @args.state.round_finished_debounce > 0
+
+ @args.state.gem_chosen = false
+ @args.state.hero.sprite[0] = 'sprites/herodown100.png'
+ @args.state.hero.sprite[1] = 608
+ @args.state.hero.sprite[2] = 656
+ @args.state.round_finished_debounce = nil
+ set_gem_values
+ end
+
+ def walk xdir, ydir, anim
+ @args.state.hero_sprite = "sprites/#{anim}#{(((@args.state.animticks % 200) < 100) ? '100' : '200')}.png"
+ @args.state.hero_x += 5 * xdir
+ @args.state.hero_y += 5 * ydir
+ end
+
+ def check_gem_touching gem_x, gem_y, gem
+ return if @args.state.gem_chosen
+ herorect = [ @args.state.hero_x, @args.state.hero_y, 64, 64 ]
+ return if !herorect.intersect_rect?([gem_x, gem_y, 32, 64])
+ @args.state.gem_chosen = true
+ @args.state.score += gem
+ @args.outputs.sounds << ((gem < 0) ? 'sounds/lose.wav' : 'sounds/win.wav')
+ end
+
+ def input
+ if @args.inputs.keyboard.key_held.left
+ walk(-1.0, 0.0, 'heroleft')
+ elsif @args.inputs.keyboard.key_held.right
+ walk(1.0, 0.0, 'heroright')
+ elsif @args.inputs.keyboard.key_held.up
+ walk(0.0, 1.0, 'heroup')
+ elsif @args.inputs.keyboard.key_held.down
+ walk(0.0, -1.0, 'herodown')
+ end
+
+ check_gem_touching(@args.state.gem0_x, @args.state.gem0_y, @args.state.gem0)
+ check_gem_touching(@args.state.gem1_x, @args.state.gem1_y, @args.state.gem1)
+ check_gem_touching(@args.state.gem2_x, @args.state.gem2_y, @args.state.gem2)
+ end
+
+ def tick
+ input
+ calc
+ render
+ end
+end
+
+def tick args
+ args.state.game ||= Game.new args
+ args.state.game.args = args
+ args.state.game.tick
+end
+
+</code></pre>
<h3 id='----rpg-topdown---topdown-starting-point---main-rb'>Rpg Topdown - Topdown Starting Point - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_topdown/topdown_starting_point/app/main.rb
=begin
@@ -36845,6 +37743,185 @@ def move_player args, *vector
end
</code></pre>
+<h3 id='----teenytiny---teenytiny-starting-point---main-rb'>Teenytiny - Teenytiny Starting Point - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_teenytiny/teenytiny_starting_point/app/main.rb
+# full documenation is at http://docs.dragonruby.org
+# be sure to come to the discord if you hit any snags: http://discord.dragonruby.org
+def tick args
+ # ====================================================
+ # initialize default variables
+ # ====================================================
+
+ # ruby has an operator called ||= which means "only initialize this if it's nil"
+ args.state.count_down ||= 20 * 60 # set the count down to 20 seconds
+ # set the initial position of the target
+ args.state.target ||= { x: args.grid.w.half,
+ y: args.grid.h.half,
+ w: 20,
+ h: 20 }
+
+ # set the initial position of the player
+ args.state.player ||= { x: 50,
+ y: 50,
+ w: 20,
+ h: 20 }
+
+ # set the player movement speed
+ args.state.player_speed ||= 5
+
+ # set the score
+ args.state.score ||= 0
+ args.state.teleports ||= 3
+
+ # set the instructions
+ args.state.instructions ||= "Get to the red goal! Use arrow keys to move. Spacebar to teleport (use them carefully)!"
+
+ # ====================================================
+ # render the game
+ # ====================================================
+ args.outputs.labels << { x: args.grid.w.half, y: args.grid.h - 10,
+ text: args.state.instructions,
+ alignment_enum: 1 }
+
+ # check if it's game over. if so, then render game over
+ # otherwise render the current time left
+ if game_over? args
+ args.outputs.labels << { x: args.grid.w.half,
+ y: args.grid.h - 40,
+ text: "game over! (press r to start over)",
+ alignment_enum: 1 }
+ else
+ args.outputs.labels << { x: args.grid.w.half,
+ y: args.grid.h - 40,
+ text: "time left: #{(args.state.count_down.idiv 60) + 1}",
+ alignment_enum: 1 }
+ end
+
+ # render the score
+ args.outputs.labels << { x: args.grid.w.half,
+ y: args.grid.h - 70,
+ text: "score: #{args.state.score}",
+ alignment_enum: 1 }
+
+ # render the player with teleport count
+ args.outputs.sprites << { x: args.state.player.x,
+ y: args.state.player.y,
+ w: args.state.player.w,
+ h: args.state.player.h,
+ path: 'sprites/square-green.png' }
+
+ args.outputs.labels << { x: args.state.player.x + 10,
+ y: args.state.player.y + 40,
+ text: "teleports: #{args.state.teleports}",
+ alignment_enum: 1, size_enum: -2 }
+
+ # render the target
+ args.outputs.sprites << { x: args.state.target.x,
+ y: args.state.target.y,
+ w: args.state.target.w,
+ h: args.state.target.h,
+ path: 'sprites/square-red.png' }
+
+ # ====================================================
+ # run simulation
+ # ====================================================
+
+ # count down calculation
+ args.state.count_down -= 1
+ args.state.count_down = -1 if args.state.count_down < -1
+
+ # ====================================================
+ # process player input
+ # ====================================================
+ # if it isn't game over let them move
+ if !game_over? args
+ dir_y = 0
+ dir_x = 0
+
+ # determine the change horizontally
+ if args.inputs.keyboard.up
+ dir_y += args.state.player_speed
+ elsif args.inputs.keyboard.down
+ dir_y -= args.state.player_speed
+ end
+
+ # determine the change vertically
+ if args.inputs.keyboard.left
+ dir_x -= args.state.player_speed
+ elsif args.inputs.keyboard.right
+ dir_x += args.state.player_speed
+ end
+
+ # determine if teleport can be used
+ if args.inputs.keyboard.key_down.space && args.state.teleports > 0
+ args.state.teleports -= 1
+ dir_x *= 20
+ dir_y *= 20
+ end
+
+ # apply change to player
+ args.state.player.x += dir_x
+ args.state.player.y += dir_y
+ else
+ # if r is pressed, reset the game
+ if args.inputs.keyboard.key_down.r
+ $gtk.reset
+ return
+ end
+ end
+
+ # ====================================================
+ # determine score
+ # ====================================================
+
+ # calculate new score if the player is at goal
+ if !game_over? args
+
+ # if the player is at the goal, then move the goal
+ if args.state.player.intersect_rect? args.state.target
+ # increment the goal
+ args.state.score += 1
+
+ # move the goal to a random location
+ args.state.target = { x: (rand args.grid.w), y: (rand args.grid.h), w: 20, h: 20 }
+
+ # make sure the goal is inside the view area
+ if args.state.target.x < 0
+ args.state.target.x += 20
+ elsif args.state.target.x > 1280
+ args.state.target.x -= 20
+ end
+
+ # make sure the goal is inside the view area
+ if args.state.target.y < 0
+ args.state.target.y += 20
+ elsif args.state.target.y > 720
+ args.state.target.y -= 20
+ end
+ end
+ end
+end
+
+def game_over? args
+ args.state.count_down < 0
+end
+
+$gtk.reset
+
+</code></pre>
+<h3 id='----teenytiny---teenytiny-starting-point---license-txt'>Teenytiny - Teenytiny Starting Point - license.txt</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_teenytiny/teenytiny_starting_point/license.txt
+Copyright 2019 DragonRuby LLC
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+</code></pre>
<h2 id='---oss'>OSS</h2>
<p>
Follows is a source code listing for all files that have been open sourced. This code can be found online at <a href='https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/'>https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/</a>.
@@ -36863,6 +37940,7 @@ module GTK
class Args
include ArgsDeprecated
include Serialize
+ attr_accessor :cvars
attr_accessor :inputs
attr_accessor :outputs
attr_accessor :audio
@@ -36883,6 +37961,7 @@ module GTK
def initialize runtime, recording
@inputs = Inputs.new
@outputs = Outputs.new args: self
+ @cvars = {}
@audio = {}
@passes = []
@state = OpenEntity.new
@@ -37053,6 +38132,23 @@ module GTK
def autocomplete_methods
[:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn]
end
+
+ def method_missing name, *args, &block
+ if (args.length <= 1) && (@state.as_hash.key? name)
+ raise <<-S
+* ERROR - :#{name} method missing on ~#{self.class.name}~.
+The method
+ :#{name}
+with args
+ #{args}
+doesn't exist on #{inspect}.
+** POSSIBLE SOLUTION - ~args.state.#{name}~ exists.
+Did you forget ~.state~ before ~.#{name}~?
+S
+ end
+
+ super
+ end
end
end
@@ -37340,14 +38436,17 @@ module GTK
class Console
include ConsoleDeprecated
- attr_accessor :show_reason, :log, :logo, :background_color,
- :text_color, :animation_duration,
+ attr_accessor :show_reason, :log, :logo,
+ :animation_duration,
:max_log_lines, :max_history, :log,
- :last_command_errored, :last_command, :error_color, :shown_at,
- :header_color, :archived_log, :last_log_lines, :last_log_lines_count,
+ :last_command_errored, :last_command, :shown_at,
+ :archived_log, :last_log_lines, :last_log_lines_count,
:suppress_left_arrow_behavior, :command_set_at,
:toast_ids, :bottom,
- :font_style, :menu
+ :font_style, :menu,
+ :background_color, :spam_color, :text_color, :warn_color,
+ :error_color, :header_color, :code_color, :comment_color,
+ :debug_color, :unfiltered_color
def initialize
@font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)
@@ -37365,15 +38464,22 @@ module GTK
@command_history_index = -1
@nonhistory_input = ''
@logo = 'console-logo.png'
- @history_fname = 'console_history.txt'
+ @history_fname = 'logs/console_history.txt'
@background_color = Color.new [0, 0, 0, 224]
- @text_color = Color.new [255, 255, 255]
- @error_color = Color.new [200, 50, 50]
@header_color = Color.new [100, 200, 220]
@code_color = Color.new [210, 168, 255]
- @comment_color = Color.new [0, 200, 100]
+ @comment_color = Color.new [0, 200, 100]
@animation_duration = 1.seconds
@shown_at = -1
+
+ # these are the colors for text at various log levels.
+ @spam_color = Color.new [160, 160, 160]
+ @debug_color = Color.new [0, 255, 0]
+ @text_color = Color.new [255, 255, 255]
+ @warn_color = Color.new [255, 255, 0]
+ @error_color = Color.new [200, 50, 50]
+ @unfiltered_color = Color.new [0, 255, 255]
+
load_history
end
@@ -37439,7 +38545,13 @@ module GTK
nil
end
- def add_text obj
+ def add_text obj, loglevel=-1
+ # loglevel is one of the values of LogLevel in logging.h, or -1 to say "we don't care, colorize it with your special string parsing magic"
+ loglevel = -1 if loglevel < 0
+ loglevel = 5 if loglevel > 5 # 5 == unfiltered (it's 0x7FFFFFFE in C, clamp it down)
+ loglevel = 2 if (loglevel == -1) && obj.start_with?('!c!') # oh well
+ colorstr = (loglevel != -1) ? "!c!#{loglevel}" : nil
+
@last_log_lines_count ||= 1
@log_invocation_count += 1
@@ -37448,12 +38560,18 @@ module GTK
log_lines = []
str.each_line do |s|
- s.wrapped_lines(self.console_text_width).each do |l|
- log_lines << l
+ if colorstr.nil?
+ s.wrapped_lines(self.console_text_width).each do |l|
+ log_lines << l
+ end
+ else
+ s.wrapped_lines(self.console_text_width).each do |l|
+ log_lines << "#{colorstr}#{l}"
+ end
end
end
- if log_lines == @last_log_lines
+ if log_lines == @last_log_lines && log_lines.length != 0
@last_log_lines_count += 1
new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})"
if log_lines.length > 1
@@ -37728,10 +38846,12 @@ S
def mouse_wheel_scroll args
@inertia ||= 0
- if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0
- @inertia = 1
- elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0
- @inertia = -1
+ if args.inputs.mouse.wheel
+ if args.inputs.mouse.wheel.y > 0
+ @inertia = 1
+ elsif args.inputs.mouse.wheel.y < 0
+ @inertia = -1
+ end
end
if args.inputs.mouse.click
@@ -37740,13 +38860,11 @@ S
return if @inertia == 0
- if @inertia != 0
- @inertia = (@inertia * 0.7)
- if @inertia > 0
- @log_offset -= 1
- elsif @inertia < 0
- @log_offset += 1
- end
+ @inertia = (@inertia * 0.7)
+ if @inertia > 0
+ @log_offset += 1
+ elsif @inertia < 0
+ @log_offset -= 1
end
if @inertia.abs < 0.01
@@ -37764,6 +38882,7 @@ S
if console_toggle_key_down? args
args.inputs.text.clear
toggle
+ args.inputs.keyboard.clear if !@visible
end
return unless visible?
@@ -37775,7 +38894,16 @@ S
@log_offset = 0 if @log_offset < 0
if args.inputs.keyboard.key_down.enter
- eval_the_set_command
+ if slide_progress > 0.5
+ # in the event of an exception, the console window pops up
+ # and is pre-filled with $gtk.reset.
+ # there is an annoying scenario where the exception could be thrown
+ # by pressing enter (while playing the game). if you press enter again
+ # quickly, then the game is reset which closes the console.
+ # so enter in the console is only evaluated if the slide_progress
+ # is atleast half way down the page.
+ eval_the_set_command
+ end
elsif args.inputs.keyboard.key_down.v
if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta
prompt << $gtk.ffi_misc.getclipboard
@@ -37852,7 +38980,7 @@ S
def write_line(args, left, y, str, archived: false)
color = color_for_log_entry(str)
color = color.mult_alpha(0.5) if archived
-
+ str = str[4..-1] if str.start_with?('!c!') # chop off loglevel color
args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color)
end
@@ -38088,7 +39216,9 @@ S
return false
end
- def color_for_log_entry(log_entry)
+ def color_for_plain_text log_entry
+ log_entry = log_entry[4..-1] if log_entry.start_with? "!c!"
+
if code? log_entry
@code_color
elsif code_comment? log_entry
@@ -38108,6 +39238,29 @@ S
end
end
+ def color_for_log_entry(log_entry)
+ if log_entry.start_with?('!c!') # loglevel color specified.
+ return case log_entry[3..3].to_i
+ when 0 # spam
+ @spam_color
+ when 1 # debug
+ @debug_color
+ #when 2 # info (caught by the `else` block.)
+ # @text_color
+ when 3 # warn
+ @warn_color
+ when 4 # error
+ @error_color
+ when 5 # unfiltered
+ @unfiltered_color
+ else
+ color_for_plain_text log_entry
+ end
+ end
+
+ return color_for_plain_text log_entry
+ end
+
def prompt
@prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width)
end
@@ -38551,11 +39704,11 @@ S
# partition the original list of items into a string to be printed
items.each_slice(columns).each_with_index do |cells, i|
- pretty_print_row_seperator string_width, cell_width, column_width, columns
+ pretty_print_row_separator string_width, cell_width, column_width, columns
pretty_print_row cells, string_width, cell_width, column_width, columns
end
- pretty_print_row_seperator string_width, cell_width, column_width, columns
+ pretty_print_row_separator string_width, cell_width, column_width, columns
end
end
@@ -39382,8 +40535,8 @@ module GTK
ease_extended start_tick,
current_tick,
start_tick + duration,
- (initial_value *definitions),
- (final_value *definitions),
+ initial_value(*definitions),
+ final_value(*definitions),
*definitions
end
@@ -39574,8 +40727,8 @@ end
module GTK
module Geometry
def self.rotate_point point, angle, around = nil
- s = Math.sin a.to_radians
- c = Math.cos a.to_radians
+ s = Math.sin angle.to_radians
+ c = Math.cos angle.to_radians
px = point.x
py = point.y
cx = 0
@@ -39756,8 +40909,16 @@ S
end
# @gtk
- def self.line_y_intercept line
- line.y - line_slope(line) * line.x
+ def self.line_y_intercept line, replace_infinity: nil
+ line.y - line_slope(line, replace_infinity: replace_infinity) * line.x
+ rescue Exception => e
+raise <<-S
+* ERROR: ~Geometry::line_y_intercept~
+The following exception was thrown for line: #{line}
+#{e}
+
+Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.
+S
end
# @gtk
@@ -39833,14 +40994,22 @@ S
end
# @gtk
- def self.line_intersect line_one, line_two
- m1 = line_slope(line_one)
- m2 = line_slope(line_two)
- b1 = line_y_intercept(line_one)
- b2 = line_y_intercept(line_two)
+ def self.line_intersect line_one, line_two, replace_infinity: nil
+ m1 = line_slope(line_one, replace_infinity: replace_infinity)
+ m2 = line_slope(line_two, replace_infinity: replace_infinity)
+ b1 = line_y_intercept(line_one, replace_infinity: replace_infinity)
+ b2 = line_y_intercept(line_two, replace_infinity: replace_infinity)
x = (b1 - b2) / (m2 - m1)
y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2))
[x, y]
+ rescue Exception => e
+raise <<-S
+* ERROR: ~Geometry::line_intersect~
+The following exception was thrown for line_one: #{line_one}, line_two: #{line_two}
+#{e}
+
+Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.
+S
end
def self.contract_intersect_rect?
@@ -40521,7 +41690,8 @@ module GTK
value = Kernel.tick_count if value
collection.each do |m|
- self.instance_variable_set("@#{m.to_s}".to_sym, value)
+ m_to_s = m.to_s
+ self.instance_variable_set("@#{m_to_s}".to_sym, value) if m_to_s.strip.length > 0
rescue Exception => e
raise e, <<-S
* ERROR:
@@ -41063,6 +42233,7 @@ class IOSWizard < Wizard
:check_for_dev_profile,
*app_metadata_retrieval_steps,
+ :determine_devcert,
:clear_tmp_directory,
:stage_app,
@@ -41091,6 +42262,7 @@ class IOSWizard < Wizard
:determine_app_version,
*app_metadata_retrieval_steps,
+ :determine_prodcert,
:clear_tmp_directory,
:stage_app,
@@ -41285,6 +42457,10 @@ teamid=
appid=
# appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.
appname=
+# devcert is the certificate to use for development/deploying to your local device
+devcert=
+# prodcert is the certificate to use for distribution to the app store
+prodcert=
S
end
@@ -41320,7 +42496,7 @@ S
def raise_ios_metadata_required
raise WizardException.new(
"* mygame/metadata/ios_metadata.txt needs to be filled out.",
- "You need to update metadata/ios_metadata.txt with a valid teamid, appname, and appid.",
+ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, appid, devcert, and prodcert.",
"Instructions for where the values should come from are within metadata/ios_metadata.txt."
)
end
@@ -41360,7 +42536,19 @@ S
def determine_app_id
@app_id = ios_metadata.appid
raise_ios_metadata_required if @app_id.strip.length == 0
- log_info "App Identifier is set to : #{@app_id}"
+ log_info "App Identifier is set to: #{@app_id}"
+ end
+
+ def determine_devcert
+ @certificate_name = ios_metadata.devcert
+ raise_ios_metadata_required if @certificate_name.strip.length == 0
+ log_info "Dev Certificate is set to: #{@certificate_name}"
+ end
+
+ def determine_prodcert
+ @certificate_name = ios_metadata.prodcert
+ raise_ios_metadata_required if @certificate_name.strip.length == 0
+ log_info "Production (Distribution) Certificate is set to: #{@certificate_name}"
end
def set_app_name name
@@ -41382,12 +42570,6 @@ S
sh "rm -rf #{tmp_directory}"
end
- def stage_app
- log_info "Staging."
- sh "mkdir -p #{tmp_directory}"
- sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""
- end
-
def set_app_id id
log_info = "App Id set to: #{id}"
@app_id = id
@@ -41418,34 +42600,13 @@ S
def check_for_certs
log_info "Attempting to find certificates on your computer."
- if !cli_app_exist?(security_cli_app)
- raise WizardException.new(
- "* It doesn't look like you have #{security_cli_app}.",
- "** 1. Open Disk Utility and run First Aid.",
- { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },
- )
- end
-
- if valid_certs.length == 0
- raise WizardException.new(
- "* It doesn't look like you have any valid certs installed.",
- "** 1. Open Xcode.",
- "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",
- { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },
- "** 3. After loggin in, select Manage Certificates...",
- { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },
- "** 4. Add a certificate for Apple Development.",
- { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },
- )
- raise "You do not have any Apple development certs on this computer."
- end
-
if @production_build
- @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]
+ @certificate_name = ios_metadata[:prodcert]
else
- @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]
+ @certificate_name = ios_metadata[:devcert]
end
- log_info "I will be using Certificate: '#{@certificate_name}'."
+
+ log_info "I will be using certificate: '#{@certificate_name}'."
end
def idevice_id_cli_app
@@ -41460,24 +42621,6 @@ S
"xcodebuild"
end
- def valid_certs
- certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|
- if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))
- l.strip
- else
- nil
- end
- end.reject_nil.map do |l|
- number, id, name = l.split(' ', 3)
- name = name.gsub("\"", "") if name
- {
- number: 1,
- id: id,
- name: name
- }
- end
- end
-
def connected_devices
sh("idevice_id -l").strip.each_line.map do |l|
l.strip
@@ -42007,6 +43150,9 @@ XML
end
def stage_app
+ log_info "Staging."
+ sh "mkdir -p #{tmp_directory}"
+ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""
sh %Q[cp -r "#{root_folder}/app/" "#{app_path}/app/"]
sh %Q[cp -r "#{root_folder}/sounds/" "#{app_path}/sounds/"]
sh %Q[cp -r "#{root_folder}/sprites/" "#{app_path}/sprites/"]
@@ -43834,26 +44980,6 @@ S
(0..self).to_a
end
- def >= other
- return false if !other
- return gte other
- end
-
- def > other
- return false if !other
- return gt other
- end
-
- def <= other
- return false if !other
- return lte other
- end
-
- def < other
- return false if !other
- return gt other
- end
-
# @gtk
def map
unless block_given?
@@ -43939,34 +45065,6 @@ The object above is not a Numeric.
S
end
- def - other
- return self unless other
- self - other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :-, e
- end
-
- def + other
- return self unless other
- self + other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :+, e
- end
-
- def * other
- return self unless other
- self * other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :*, e
- end
-
- def / other
- return self unless other
- self / other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :/, e
- end
-
def serialize
self
end
@@ -44021,34 +45119,6 @@ class Fixnum
return !even?
end
- def + other
- return self unless other
- self + other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :+, e
- end
-
- def * other
- return self unless other
- self * other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :*, e
- end
-
- def / other
- return self unless other
- self / other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :/, e
- end
-
- def - other
- return self unless other
- self - other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :-, e
- end
-
# Returns `-1` if the number is less than `0`. `+1` if the number
# is greater than `0`. Returns `0` if the number is equal to `0`.
#
@@ -44104,34 +45174,6 @@ class Float
alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__
alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__
- def - other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :-, e
- end
-
- def + other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :+, e
- end
-
- def * other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :*, e
- end
-
- def / other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :/, e
- end
-
def serialize
self
end
@@ -44180,6 +45222,270 @@ class Integer
end
</code></pre>
+<h3 id='----recording-rb'>recording.rb</h3>
+<pre><code class="language-ruby"># ./dragon/recording.rb
+# coding: utf-8
+# Copyright 2019 DragonRuby LLC
+# MIT License
+# recording.rb has been released under MIT (*only this file*).
+
+module GTK
+ # FIXME: Gross
+ # @gtk
+ class Replay
+ # @gtk
+ def self.start file_name = nil
+ $recording.start_replay file_name
+ end
+
+ # @gtk
+ def self.stop
+ $recording.stop_replay
+ end
+ end
+
+ # @gtk
+ class Recording
+ def initialize runtime
+ @runtime = runtime
+ @tick_count = 0
+ @global_input_order = 1
+ end
+
+ def tick
+ @tick_count += 1
+ end
+
+ def start_recording seed_number = nil
+ if !seed_number
+ log <<-S
+* ERROR:
+To start recording, you must provide an integer value to
+seed random number generation.
+S
+ $console.set_command "$recording.start SEED_NUMBER"
+ return
+ end
+
+ if @is_recording
+ log <<-S
+* ERROR:
+You are already recording, first cancel (or stop) the current recording.
+S
+ $console.set_command "$recording.cancel"
+ return
+ end
+
+ if @is_replaying
+ log <<-S
+* ERROR:
+You are currently replaying a recording, first stop the replay.
+S
+ return
+ end
+
+ log_info <<-S
+Recording has begun with RNG seed value set to #{seed_number}.
+To stop recording use stop_recording(filename).
+The recording will stop without saving a file if a filename is nil.
+S
+
+ $console.set_command "$recording.stop 'replay.txt'"
+ @runtime.__reset__
+ @seed_number = seed_number
+ @runtime.set_rng seed_number
+
+ @tick_count = 0
+ @global_input_order = 1
+ @is_recording = true
+ @input_history = []
+ @runtime.notify! "Recording started. When completed, open the console to save it using $recording.stop FILE_NAME (or cancel).", 300
+ end
+
+ # @gtk
+ def start seed_number = nil
+ start_recording seed_number
+ end
+
+ def is_replaying?
+ @is_replaying
+ end
+
+ def is_recording?
+ @is_recording
+ end
+
+ # @gtk
+ def stop file_name = nil
+ stop_recording file_name
+ end
+
+ # @gtk
+ def cancel
+ stop_recording_core
+ @runtime.notify! "Recording cancelled."
+ end
+
+ def stop_recording file_name = nil
+ if !file_name
+ log <<-S
+* ERROR:
+To please specify a file name when calling:
+$recording.stop FILE_NAME
+
+If you do NOT want to save the recording, call:
+$recording.cancel
+S
+ $console.set_command "$recording.stop 'replay.txt'"
+ return
+ end
+
+ if !@is_recording
+ log_info "You are not currently recording. Use start_recording(seed_number) to start recording."
+ $console.set_command "$recording.start"
+ return
+ end
+
+ if file_name
+ text = "replay_version 2.0\n"
+ text << "stopped_at #{@tick_count}\n"
+ text << "seed #{@seed_number}\n"
+ text << "recorded_at #{Time.now.to_s}\n"
+ @input_history.each do |items|
+ text << "#{items}\n"
+ end
+ @runtime.write_file file_name, text
+ @runtime.write_file 'last_replay.txt', text
+ log_info "The recording has been saved successfully at #{file_name}. You can use start_replay(\"#{file_name}\") to replay the recording."
+ end
+
+ $console.set_command "$replay.start '#{file_name}'"
+ stop_recording_core
+ @runtime.notify! "Recording saved to #{file_name}. To replay it: $replay.start \"#{file_name}\"."
+ log_info "You can run the replay later on startup using: ./dragonruby mygame --replay #{@replay_file_name}"
+ nil
+ end
+
+ def stop_recording_core
+ @is_recording = false
+ @input_history = nil
+ @last_history = nil
+ @runtime.__reset__
+ end
+
+ def start_replay file_name = nil
+ if !file_name
+ log <<-S
+* ERROR:
+Please provide a file name to $recording.start.
+S
+ $console.set_command "$replay.start 'replay.txt'"
+ return
+ end
+
+ text = @runtime.read_file file_name
+ return false unless text
+
+ if text.each_line.first.strip != "replay_version 2.0"
+ raise "The replay file #{file_name} is not compatible with this version of DragonRuby Game Toolkit. Please recreate the replay (sorry)."
+ end
+
+ @replay_file_name = file_name
+
+ $replay_data = { input_history: { } }
+ text.each_line do |l|
+ if l.strip.length == 0
+ next
+ elsif l.start_with? 'replay_version'
+ next
+ elsif l.start_with? 'seed'
+ $replay_data[:seed] = l.split(' ').last.to_i
+ elsif l.start_with? 'stopped_at'
+ $replay_data[:stopped_at] = l.split(' ').last.to_i
+ elsif l.start_with? 'recorded_at'
+ $replay_data[:recorded_at] = l.split(' ')[1..-1].join(' ')
+ elsif l.start_with? '['
+ name, value_1, value_2, value_count, id, tick_count = l.strip.gsub('[', '').gsub(']', '').split(',')
+ $replay_data[:input_history][tick_count.to_i] ||= []
+ $replay_data[:input_history][tick_count.to_i] << {
+ id: id.to_i,
+ name: name.gsub(':', '').to_sym,
+ value_1: value_1.to_f,
+ value_2: value_2.to_f,
+ value_count: value_count.to_i
+ }
+ else
+ raise "Replay data seems corrupt. I don't know how to parse #{l}."
+ end
+ end
+
+ $replay_data[:input_history].keys.each do |key|
+ $replay_data[:input_history][key] = $replay_data[:input_history][key].sort_by {|input| input[:id]}
+ end
+
+ @runtime.__reset__
+ @runtime.set_rng $replay_data[:seed]
+ @tick_count = 0
+ @is_replaying = true
+ log_info "Replay has been started."
+ @runtime.notify! "Replay started [#{@replay_file_name}]."
+ end
+
+ def stop_replay notification_message = "Replay has been stopped."
+ if !is_replaying?
+ log <<-S
+* ERROR:
+No replay is currently running. Call $replay.start FILE_NAME to start a replay.
+S
+
+ $console.set_command "$replay.start 'replay.txt'"
+ return
+ end
+ log_info notification_message
+ @is_replaying = false
+ $replay_data = nil
+ @tick_count = 0
+ @global_input_order = 1
+ $console.set_command_silent "$replay.start '#{@replay_file_name}'"
+ @runtime.__reset__
+ @runtime.notify! notification_message
+ end
+
+ def record_input_history name, value_1, value_2, value_count, clear_cache = false
+ return if @is_replaying
+ return unless @is_recording
+ @input_history << [name, value_1, value_2, value_count, @global_input_order, @tick_count]
+ @global_input_order += 1
+ end
+
+ def stage_replay_values
+ return unless @is_replaying
+ return unless $replay_data
+
+ if $replay_data[:stopped_at] <= @tick_count
+ stop_replay "Replay completed [#{@replay_file_name}]. To rerun, bring up the Console and press enter."
+ return
+ end
+
+ inputs_this_tick = $replay_data[:input_history][@tick_count]
+
+ if @tick_count.zmod? 60
+ log_info "Replay ends in #{($replay_data[:stopped_at] - @tick_count).idiv 60} second(s)."
+ end
+
+ return unless inputs_this_tick
+ inputs_this_tick.each do |v|
+ args = []
+ args << v[:value_1] if v[:value_count] >= 1
+ args << v[:value_2] if v[:value_count] >= 2
+ args << :replay
+ $gtk.send v[:name], *args
+ end
+ end
+ end
+end
+
+</code></pre>
<h3 id='----remote_hotload_client-rb'>remote_hotload_client.rb</h3>
<pre><code class="language-ruby"># ./dragon/remote_hotload_client.rb
# coding: utf-8
@@ -44546,14 +45852,13 @@ module GTK
log <<-S
** Invoking :#{name}...
S
- time_start = Time.now
idx = 0
r = nil
+ time_start = Time.now
while idx < iterations
r = proc.call
idx += 1
end
-
result = (Time.now - time_start).round 3
{ name: name,
@@ -44676,7 +45981,7 @@ module GTK
fn.each_send pass.borders, self, :draw_border
fn.each_send pass.static_borders, self, :draw_border
- if !$gtk.production
+ if !self.production
fn.each_send pass.debug, self, :draw_primitive
fn.each_send pass.static_debug, self, :draw_primitive
end
@@ -44693,6 +45998,7 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_solid_2 s.x, s.y, s.w, s.h,
s.r, s.g, s.b, s.a,
(s.blendmode_enum || 1)
@@ -44706,6 +46012,7 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,
(s.path || '').to_s,
s.angle,
@@ -44725,6 +46032,7 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_screenshot (s.path || '').to_s,
s.x, s.y, s.w, s.h,
s.angle,
@@ -44743,6 +46051,7 @@ module GTK
if l.respond_to? :draw_override
l.draw_override @ffi_draw
else
+ l = l.as_hash if l.is_a? OpenEntity
@ffi_draw.draw_label_3 l.x, l.y,
(l.text || '').to_s,
l.size_enum, l.alignment_enum,
@@ -44760,6 +46069,7 @@ module GTK
if l.respond_to? :draw_override
l.draw_override @ffi_draw
else
+ l = l.as_hash if l.is_a? OpenEntity
if l.x2
@ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,
l.r, l.g, l.b, l.a,
@@ -44785,6 +46095,7 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_border_2 s.x, s.y, s.w, s.h,
s.r, s.g, s.b, s.a,
(s.blendmode_enum || 1)
@@ -44850,13 +46161,8 @@ module GTK
if @tick_speed_count > 60 * 2
if framerate_below_threshold?
@last_framerate = current_framerate
- if !@framerate_important_notification_happened
- log_important framerate_warning_message
- else
- log framerate_warning_message
- end
- @framerate_important_notification_happened = true
+ log framerate_warning_message
end
end
@@ -45721,6 +47027,112 @@ module GTK
end
</code></pre>
+<h3 id='----tweetcart-rb'>tweetcart.rb</h3>
+<pre><code class="language-ruby"># ./dragon/tweetcart.rb
+# coding: utf-8
+# Copyright 2019 DragonRuby LLC
+# MIT License
+# tweetcart.rb has been released under MIT (*only this file*).
+
+def $top_level.TICK &block
+ $top_level.define_method(:tick) do |args|
+ args.outputs[:scene].w = 160
+ args.outputs[:scene].h = 90
+ args.outputs[:scene].background_color = [0, 0, 0, 0]
+ block.call args
+ args.outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :scene }
+ end
+
+ def $top_level.bg! *rgb
+ r,g,b = rgb
+ r ||= 255
+ g ||= r
+ b ||= g
+ $args.outputs.background_color = [r, g, b]
+ end
+
+ def $top_level.slds
+ $args.outputs[:scene].sprites
+ end
+
+ def $top_level.slds! *os
+ if (os.first.is_a? Numeric)
+ sld!(*os)
+ else
+ os.each { |o| sld!(*o) }
+ end
+ end
+
+ def $top_level.sld! *params
+ x, y, w, h, r, g, b, a = nil
+ if params.length == 2
+ x, y = params
+ elsif params.length == 3 && (params.last.is_a? Array)
+ x = params[0]
+ y = params[1]
+ r, g, b, a = params[2]
+ r ||= 255
+ g ||= r
+ b ||= g
+ a ||= 255
+ elsif params.length == 4
+ x, y, w, h = params
+ elsif params.length == 5 && (params.last.is_a? Array)
+ x = params[0]
+ y = params[1]
+ w = params[2]
+ h = params[3]
+ r,g,b,a = params[4]
+ r ||= 255
+ g ||= r
+ b ||= g
+ a ||= 255
+ elsif params.length >= 7
+ x, y, w, h, r, g, b = params
+ else
+ raise "I don't know how to render #{params} with reasonable defaults."
+ end
+
+ w ||= 1
+ h ||= 1
+ r ||= 255
+ g ||= 255
+ b ||= 255
+ a ||= 255
+
+ slds << { x: x, y: y,
+ w: w, h: h,
+ r: r, g: g, b: b, a: a,
+ path: :pixel }
+ end
+end
+
+=begin
+wht = [255] * 3
+red = [255, 0, 0]
+blu = [0, 130, 255]
+purp = [150, 80, 255]
+
+TICK {
+ bg! 0
+
+ slds << [0, 0, 3, 3, 0, 255, 0, 255]
+
+ sld! 10, 10
+ sld! 20, 20, 3, 2
+ sld! 30, 30, 2, 2, red
+ sld! 35, 35, blu
+
+ slds! 40, 40
+
+ slds! [50, 50],
+ [60, 60, purp],
+ [70, 70, 10, 10, wht],
+ [80, 80, 4, 4, 255, 0, 255]
+}
+=end
+
+</code></pre>
<h3 id='----wizards-rb'>wizards.rb</h3>
<pre><code class="language-ruby"># ./dragon/wizards.rb
# coding: utf-8
diff --git a/docs/docs.txt b/docs/docs.txt
index d6f5def..c0cc841 100644
--- a/docs/docs.txt
+++ b/docs/docs.txt
@@ -1654,6 +1654,34 @@ is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file a
end
#+end_src
+* DOCS: ~GTK::Runtime#benchmark~
+You can use this function to compare the relative performance of methods.
+
+#+begin_src ruby
+ def tick args
+ # press r to run benchmark
+ if args.inputs.keyboard.key_down.r
+ args.gtk.console.show
+ args.gtk.benchmark iterations: 1000, # number of iterations
+ # label for experiment
+ using_numeric_map: -> () {
+ # experiment body
+ v = 100.map do |i|
+ i * 100
+ end
+ },
+ # label for experiment
+ using_numeric_times: -> () {
+ # experiment body
+ v = []
+ 100.times do |i|
+ v << i * 100
+ end
+ }
+ end
+ end
+#+end_src
+
* DOCS: ~Array~
The Array class has been extend to provide methods that
@@ -4199,7 +4227,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Use args.inputs.mouse.click.created_at
# To see how many frames its been since the click occurred
- # Use args.inputs.mouse.click.creat_at_elapsed
+ # Use args.inputs.mouse.click.created_at_elapsed
# Saving the click in args.state can be quite useful
@@ -6840,17 +6868,17 @@ Follows is a source code listing for all files that have been open sourced. This
end
def calc_player_dx
- player.y += player.dy
- player.dy += state.gravity
- player.dy += player.dy * state.drag ** 2 * -1
- end
-
- def calc_player_dy
player.dx = player.dx.clamp(-5, 5)
player.dx *= 0.9
player.x += player.dx
end
+ def calc_player_dy
+ player.y += player.dy
+ player.dy += state.gravity
+ player.dy += player.dy * state.drag ** 2 * -1
+ end
+
def reset_player
player.x = 100
player.y = 720
@@ -6994,8 +7022,7 @@ Follows is a source code listing for all files that have been open sourced. This
input
end
- # Sets default values
- def defaults
+ def init_game
s.platforms ||= [ # initializes platforms collection with two platforms using hashes
new_platform(x: 0, y: 0, w: 700, h: 32, dx: 1, speed: 0, rect: nil),
new_platform(x: 0, y: 300, w: 700, h: 32, dx: 1, speed: 0, rect: nil), # 300 pixels higher
@@ -7018,6 +7045,11 @@ Follows is a source code listing for all files that have been open sourced. This
s.camera ||= { y: -100 } # shows view on screen (as the player moves upward, the camera does too)
end
+ # Sets default values
+ def defaults
+ init_game
+ end
+
# Outputs objects onto the screen
def render
outputs.solids << s.platforms.map do |p| # outputs platforms onto screen
@@ -7105,7 +7137,9 @@ Follows is a source code listing for all files that have been open sourced. This
rect: nil)
end
else
+ # game over
s.as_hash.clear # otherwise clear the hash (no new platform is necessary)
+ init_game
end
end
@@ -7244,15 +7278,15 @@ Follows is a source code listing for all files that have been open sourced. This
# ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb
DEGREES_TO_RADIANS = Math::PI / 180
- class Block
+ class Block
def initialize(x, y, block_size, rotation)
@x = x
- @y = y
+ @y = y
@block_size = block_size
@rotation = rotation
#The repel velocity?
- @velocity = {x: 2, y: 0}
+ @velocity = {x: 2, y: 0}
horizontal_offset = (3 * block_size) * Math.cos(rotation * DEGREES_TO_RADIANS)
vertical_offset = block_size * Math.sin(rotation * DEGREES_TO_RADIANS)
@@ -7280,7 +7314,7 @@ Follows is a source code listing for all files that have been open sourced. This
@imaginary_line = [ @x1, @y1, @x2, @y2 ]
end
-
+
end
def draw args
@@ -7324,7 +7358,7 @@ Follows is a source code listing for all files that have been open sourced. This
collision = false
if @rotation >= 0
- if (current_area < min_area &&
+ if (current_area < min_area &&
current_area > 0 &&
args.state.ball.center.y > @y1 &&
args.state.ball.center.x < @x2)
@@ -7332,7 +7366,7 @@ Follows is a source code listing for all files that have been open sourced. This
collision = true
end
else
- if (current_area < min_area &&
+ if (current_area < min_area &&
current_area > 0 &&
args.state.ball.center.y > @y2 &&
args.state.ball.center.x > @x1)
@@ -7340,7 +7374,7 @@ Follows is a source code listing for all files that have been open sourced. This
collision = true
end
end
-
+
return collision
end
@@ -7361,7 +7395,7 @@ Follows is a source code listing for all files that have been open sourced. This
x:args.state.ball.center.x-args.state.ball.velocity.x,
y:args.state.ball.center.y-args.state.ball.velocity.y
}
-
+
velocityMag = (args.state.ball.velocity.x**2 + args.state.ball.velocity.y**2)**0.5 # the current velocity magnitude of the ball
theta_ball = Math.atan2(args.state.ball.velocity.y, args.state.ball.velocity.x) #the angle of the ball's velocity
theta_repel = (180 * DEGREES_TO_RADIANS) - theta_ball + (@rotation * DEGREES_TO_RADIANS)
@@ -7383,7 +7417,7 @@ Follows is a source code listing for all files that have been open sourced. This
dampener = 0.3
ynew *= dampener * 0.5
-
+
#If the bounce is very low, that means the ball is rolling and we don't want to dampenen the X velocity
if ynew > -0.1
xnew *= dampener
@@ -7392,7 +7426,7 @@ Follows is a source code listing for all files that have been open sourced. This
#Add the sine component of gravity back in (X component)
gravity_x = 4 * Math.sin(@rotation * DEGREES_TO_RADIANS)
xnew += gravity_x
-
+
args.state.ball.velocity.x = -xnew
args.state.ball.velocity.y = -ynew
@@ -9806,12 +9840,23 @@ Follows is a source code listing for all files that have been open sourced. This
# Starts the game with player x's turn and creates an array (to_a) for space combinations.
# Calls methods necessary for the game to run properly.
def tick
- state.current_turn ||= :x
- state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a
+ init_new_game
render_board
input_board
end
+ def init_new_game
+ state.current_turn ||= :x
+ state.space_combinations ||= [-1, 0, 1].product([-1, 0, 1]).to_a
+
+ state.spaces ||= {}
+
+ state.space_combinations.each do |x, y|
+ state.spaces[x] ||= {}
+ state.spaces[x][y] ||= state.new_entity(:space)
+ end
+ end
+
# Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.
def render_board
square_size = 80
@@ -9887,6 +9932,7 @@ Follows is a source code listing for all files that have been open sourced. This
def input_restart_game
return unless state.game_over
gtk.reset
+ init_new_game
end
# Checks if x or o won the game.
@@ -10203,7 +10249,7 @@ Follows is a source code listing for all files that have been open sourced. This
def calc_kill_zombie
# Find all zombies that intersect with the player. They are considered killed.
- killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }
+ killed_this_frame = state.zombies.find_all { |z| z.sprite && (z.sprite.intersect_rect? state.player_sprite) }
state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection
state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies
@@ -11107,6 +11153,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
def playtime_str t
+ return "" unless t
minutes = (t / 60.0).floor
seconds = t - (minutes * 60.0).to_f
return minutes.to_s + ':' + seconds.floor.to_s + ((seconds - seconds.floor).to_s + "000")[1..3]
@@ -11219,7 +11266,7 @@ Follows is a source code listing for all files that have been open sourced. This
results.playtime_slider_rect = progress_bar(args: args,
row: 2.5,
col: 2,
- percentage: audio_entry.playtime / audio_entry.length_,
+ percentage: (audio_entry.playtime || 1) / (audio_entry.length_ || 1),
text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")
results.primitives << results.playtime_slider_rect.primitives
@@ -11419,21 +11466,6 @@ Follows is a source code listing for all files that have been open sourced. This
192.168.1.65
#+end_src
-*** Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt
-#+begin_src ruby
- # ./samples/07_advanced_audio/01_audio_mixer/metadata/ios_metadata.txt
- # ios_metadata.txt is used by the Pro version of DragonRuby Game Toolkit to create iOS apps.
- # Information about the Pro version can be found at: http://dragonruby.org/toolkit/game#purchase
-
- # teamid needs to be set to your assigned Team Id which can be found at https://developer.apple.com/account/#/membership/
- teamid=
- # appid needs to be set to your application identifier which can be found at https://developer.apple.com/account/resources/identifiers/list
- appid=
- # appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.
- appname=
-
-#+end_src
-
*** Advanced Audio - Sound Synthesis - main.rb
#+begin_src ruby
# ./samples/07_advanced_audio/02_sound_synthesis/app/main.rb
@@ -12033,6 +12065,138 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Rendering - Labels With Wrapped Text - main.rb
+#+begin_src ruby
+ # ./samples/07_advanced_rendering/00_labels_with_wrapped_text/app/main.rb
+ def tick args
+ # defaults
+ args.state.scroll_location ||= 0
+ args.state.textbox.messages ||= []
+ args.state.textbox.scroll ||= 0
+
+ # render
+ args.outputs.background_color = [0, 0, 0, 255]
+ render_messages args
+ render_instructions args
+
+ # inputs
+ if args.inputs.keyboard.key_down.one
+ queue_message args, "Hello there neighbour! my name is mark, how is your day today?"
+ end
+
+ if args.inputs.keyboard.key_down.two
+ queue_message args, "I'm doing great sir, actually I'm having a picnic today"
+ end
+
+ if args.inputs.keyboard.key_down.three
+ queue_message args, "Well that sounds wonderful!"
+ end
+
+ if args.inputs.keyboard.key_down.home
+ args.state.scroll_location = 1
+ end
+
+ if args.inputs.keyboard.key_down.delete
+ clear_message_queue args
+ end
+ end
+
+ def queue_message args, msg
+ args.state.textbox.messages.concat msg.wrapped_lines 50
+ end
+
+ def clear_message_queue args
+ args.state.textbox.messages = nil
+ args.state.textbox.scroll = 0
+ end
+
+ def render_messages args
+ args.outputs[:textbox].w = 400
+ args.outputs[:textbox].h = 720
+
+ args.outputs.primitives << args.state.textbox.messages.each_with_index.map do |s, idx|
+ {
+ x: 0,
+ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,
+ text: s,
+ size_enum: -3,
+ alignment_enum: 0,
+ r: 255, g:255, b: 255, a: 255
+ }
+ end
+
+ args.outputs[:textbox].labels << args.state.textbox.messages.each_with_index.map do |s, idx|
+ {
+ x: 0,
+ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,
+ text: s,
+ size_enum: -3,
+ alignment_enum: 0,
+ r: 255, g:255, b: 255, a: 255
+ }
+ end
+
+ args.outputs[:textbox].borders << [0, 0, args.outputs[:textbox].w, 720]
+
+ args.state.textbox.scroll += args.inputs.mouse.wheel.y unless args.inputs.mouse.wheel.nil?
+
+ if args.state.scroll_location > 0
+ args.state.textbox.scroll = 0
+ args.state.scroll_location = 0
+ end
+
+ args.outputs.sprites << [900, 0, args.outputs[:textbox].w, 720, :textbox]
+ end
+
+ def render_instructions args
+ args.outputs.labels << [30,
+ 30.from_top,
+ "press 1, 2, 3 to display messages, MOUSE WHEEL to scroll, HOME to go to top, BACKSPACE to delete.",
+ 0, 255, 255]
+
+ args.outputs.primitives << [0, 55.from_top, 1280, 30, :pixel, 0, 255, 0, 0, 0].sprite
+ end
+
+#+end_src
+
+*** Advanced Rendering - Rotating Label - main.rb
+#+begin_src ruby
+ # ./samples/07_advanced_rendering/00_rotating_label/app/main.rb
+ def tick args
+ # set the render target width and height to match the label
+ args.outputs[:scene].w = 220
+ args.outputs[:scene].h = 30
+
+
+ # make the background transparent
+ args.outputs[:scene].background_color = [255, 255, 255, 0]
+
+ # set the blendmode of the label to 0 (no blending)
+ # center it inside of the scene
+ # set the vertical_alignment_enum to 1 (center)
+ args.outputs[:scene].labels << { x: 0,
+ y: 15,
+ text: "label in render target",
+ blendmode_enum: 0,
+ vertical_alignment_enum: 1 }
+
+ # add a border to the render target
+ args.outputs[:scene].borders << { x: 0,
+ y: 0,
+ w: args.outputs[:scene].w,
+ h: args.outputs[:scene].h }
+
+ # add the rendertarget to the main output as a sprite
+ args.outputs.sprites << { x: 640 - args.outputs[:scene].w.half,
+ y: 360 - args.outputs[:scene].h.half,
+ w: args.outputs[:scene].w,
+ h: args.outputs[:scene].h,
+ angle: args.state.tick_count,
+ path: :scene }
+ end
+
+#+end_src
+
*** Advanced Rendering - Simple Render Targets - main.rb
#+begin_src ruby
# ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb
@@ -13198,7 +13362,7 @@ Follows is a source code listing for all files that have been open sourced. This
def serialize
{state: state, inputs: inputs, outputs: outputs, grid: grid }
end
-
+
def inspect
serialize.to_s
end
@@ -13268,12 +13432,12 @@ Follows is a source code listing for all files that have been open sourced. This
default_player(0, 0, 64, 64,
"sprites/player/player_#{state.player_cyan.orientation}_standing.png")
end
-
+
def new_player_magenta
default_player(64, 0, 64, 64,
"sprites/player/player_#{state.player_magenta.orientation}_standing.png")
end
-
+
def new_camera_magenta
default_camera(0,0,720,720)
end
@@ -13285,7 +13449,8 @@ Follows is a source code listing for all files that have been open sourced. This
def new_camera_center
default_camera(0,0,1280,720)
end
-
+
+
def new_room
default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png')
end
@@ -13310,7 +13475,7 @@ Follows is a source code listing for all files that have been open sourced. This
state.player_cyan.x += state.player_cyan.dx
state.player_cyan.y += state.player_cyan.dy
end
-
+
def calc_player_magenta
state.player_magenta.x += state.player_magenta.dx
state.player_magenta.y += state.player_magenta.dy
@@ -13325,7 +13490,7 @@ Follows is a source code listing for all files that have been open sourced. This
state.camera_center.x += (targetX - state.camera_center.x) * 0.1 * timeScale
state.camera_center.y += (targetY - state.camera_center.y) * 0.1 * timeScale
end
-
+
def calc_camera_magenta
timeScale = 1
@@ -13362,7 +13527,7 @@ Follows is a source code listing for all files that have been open sourced. This
def calc_trauma_decay
state.trauma = state.trauma * 0.9
end
-
+
def calc_random_float_range(min, max)
rand * (max-min) + min
end
@@ -13390,7 +13555,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 255,
b: 255}
end
-
+
def render_player_magenta
outputs[:scene].sprites << {x: state.player_magenta.x,
y: state.player_magenta.y,
@@ -13436,16 +13601,16 @@ Follows is a source code listing for all files that have been open sourced. This
render_camera_magenta_scene
render_camera_cyan_scene
- angle = Math.atan((state.player_magenta.y - state.player_cyan.y)/(state.player_magenta.x- state.player_cyan.x)) * 180/Math::PI
+ angle = Math.atan((state.player_magenta.y - state.player_cyan.y)/(state.player_magenta.x- state.player_cyan.x)) * 180/Math::PI
output_split_camera angle
-
+
end
def render_camera_magenta_scene
zoomFactor = 1
offsetX = 32
offsetY = 32
-
+
outputs[:scene_magenta].sprites << {x: (-state.camera_magenta.x*2),
y: (-state.camera_magenta.y),
w: outputs[:scene].width*2,
@@ -13471,7 +13636,7 @@ Follows is a source code listing for all files that have been open sourced. This
outputs.labels << [128,64,"#{quadrant}",8,2,255,0,255,255]
if quadrant == 1
set_camera_attributes(w: 640, h: 720, m_x: 640, m_y: 0, c_x: 0, c_y: 0)
-
+
elsif quadrant == 2
set_camera_attributes(w: 1280, h: 360, m_x: 0, m_y: 360, c_x: 0, c_y: 0)
@@ -13489,7 +13654,7 @@ Follows is a source code listing for all files that have been open sourced. This
state.camera_cyan.h = h + 64
outputs[:scene_cyan].width = (w) * 2
outputs[:scene_cyan].height = h
-
+
state.camera_magenta.w = w + 64
state.camera_magenta.h = h + 64
outputs[:scene_magenta].width = (w) * 2
@@ -13501,7 +13666,7 @@ Follows is a source code listing for all files that have been open sourced. This
path: :scene_magenta}
outputs.sprites << {x: c_x,
y: c_y,
- w: w,
+ w: w,
h: h,
path: :scene_cyan}
end
@@ -13509,7 +13674,7 @@ Follows is a source code listing for all files that have been open sourced. This
def add_trauma amount
state.trauma = [state.trauma + amount, 1.0].min
end
-
+
def remove_trauma amount
state.trauma = [state.trauma - amount, 0.0].max
end
@@ -13549,7 +13714,7 @@ Follows is a source code listing for all files that have been open sourced. This
outputs.labels << [128,512,"#{state.player_cyan.x.round()}",8,2,0,255,255,255]
outputs.labels << [128,480,"#{state.player_cyan.y.round()}",8,2,0,255,255,255]
end
-
+
def input_move_magenta
if inputs.keyboard.key_held.w
state.player_magenta.dy = 5
@@ -13583,7 +13748,7 @@ Follows is a source code listing for all files that have been open sourced. This
$camera_movement.outputs = args.outputs
$camera_movement.state = args.state
$camera_movement.grid = args.grid
- $camera_movement.tick
+ $camera_movement.tick
end
#+end_src
@@ -14404,9 +14569,97 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Performance - Sprites As Struct - main.rb
+#+begin_src ruby
+ # ./samples/09_performance/03_sprites_as_struct/app/main.rb
+ # create a Struct variant that allows for named parameters on construction.
+ class NamedStruct < Struct
+ def initialize **opts
+ super(*members.map { |k| opts[k] })
+ end
+ end
+
+ # create a Star NamedStruct
+ Star = NamedStruct.new(:x, :y, :w, :h, :path, :s,
+ :angle, :angle_anchor_x, :angle_anchor_y,
+ :r, :g, :b, :a,
+ :tile_x, :tile_y,
+ :tile_w, :tile_h,
+ :source_x, :source_y,
+ :source_w, :source_h,
+ :flip_horizontally, :flip_vertically,
+ :blendmode_enum)
+
+ # Sprites represented as Structs. They require a little bit more code than Hashes,
+ # but are the a little faster to render too.
+ def random_x args
+ (args.grid.w.randomize :ratio) * -1
+ end
+
+ def random_y args
+ (args.grid.h.randomize :ratio) * -1
+ end
+
+ def random_speed
+ 1 + (4.randomize :ratio)
+ end
+
+ def new_star args
+ Star.new x: (random_x args),
+ y: (random_y args),
+ w: 4, h: 4,
+ path: 'sprites/tiny-star.png',
+ s: random_speed
+ end
+
+ def move_star args, star
+ star.x += star[:s]
+ star.y += star[:s]
+ if star.x > args.grid.w || star.y > args.grid.h
+ star.x = (random_x args)
+ star.y = (random_y args)
+ star[:s] = random_speed
+ end
+ end
+
+ def tick args
+ args.state.star_count ||= 0
+
+ # sets console command when sample app initially opens
+ if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Structs"
+ puts "* INFO: Please specify the number of sprites to render."
+ args.gtk.console.set_command "reset_with count: 100"
+ end
+
+ # init
+ if args.state.tick_count == 0
+ args.state.stars = args.state.star_count.map { |i| new_star args }
+ end
+
+ # update
+ args.state.stars.each { |s| move_star args, s }
+
+ # render
+ args.outputs.sprites << args.state.stars
+ args.outputs.background_color = [0, 0, 0]
+ args.outputs.primitives << args.gtk.current_framerate_primitives
+ end
+
+ # resets game, and assigns star count given by user
+ def reset_with count: count
+ $gtk.reset
+ $gtk.args.state.star_count = count
+ end
+
+#+end_src
+
*** Performance - Sprites As Strict Entities - main.rb
#+begin_src ruby
- # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb
+ # ./samples/09_performance/04_sprites_as_strict_entities/app/main.rb
# Sprites represented as StrictEntities using the queue ~args.outputs.sprites~
# yields apis access similar to Entities, but all properties that can be set on the
# entity must be predefined with a default value. Strict entities do not support the
@@ -14484,7 +14737,7 @@ Follows is a source code listing for all files that have been open sourced. This
*** Performance - Sprites As Classes - main.rb
#+begin_src ruby
- # ./samples/09_performance/04_sprites_as_classes/app/main.rb
+ # ./samples/09_performance/05_sprites_as_classes/app/main.rb
# Sprites represented as Classes using the queue ~args.outputs.sprites~.
# gives you full control of property declaration and method invocation.
# They are more performant than OpenEntities and StrictEntities, but more code upfront.
@@ -14545,7 +14798,7 @@ Follows is a source code listing for all files that have been open sourced. This
*** Performance - Static Sprites As Classes - main.rb
#+begin_src ruby
- # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb
+ # ./samples/09_performance/06_static_sprites_as_classes/app/main.rb
# Sprites represented as Classes using the queue ~args.outputs.static_sprites~.
# bypasses the queue behavior of ~args.outputs.sprites~. All instances are held
# by reference. You get better performance, but you are mutating state of held objects
@@ -14607,7 +14860,7 @@ Follows is a source code listing for all files that have been open sourced. This
*** Performance - Static Sprites As Classes With Custom Drawing - main.rb
#+begin_src ruby
- # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb
+ # ./samples/09_performance/07_static_sprites_as_classes_with_custom_drawing/app/main.rb
# Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.
# is the fastest approach. This is comparable to what other game engines set as the default behavior.
# There are tradeoffs for all this speed if the creation of a full blown class, and bypassing
@@ -14701,7 +14954,7 @@ Follows is a source code listing for all files that have been open sourced. This
*** Performance - Collision Limits - main.rb
#+begin_src ruby
- # ./samples/09_performance/07_collision_limits/app/main.rb
+ # ./samples/09_performance/08_collision_limits/app/main.rb
=begin
Reminders:
@@ -14760,6 +15013,31 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Debugging - Logging - main.rb
+#+begin_src ruby
+ # ./samples/10_advanced_debugging/00_logging/app/main.rb
+ def tick args
+ args.outputs.background_color = [255, 255, 255, 0]
+ if args.state.tick_count == 0
+ args.gtk.log_spam "log level spam"
+ args.gtk.log_debug "log level debug"
+ args.gtk.log_info "log level info"
+ args.gtk.log_warn "log level warn"
+ args.gtk.log_error "log level error"
+ args.gtk.log_unfiltered "log level unfiltered"
+ puts "This is a puts call"
+ args.gtk.console.show
+ end
+
+ if args.state.tick_count == 60
+ puts "This is a puts call on tick 60"
+ elsif args.state.tick_count == 120
+ puts "This is a puts call on tick 120"
+ end
+ end
+
+#+end_src
+
*** Advanced Debugging - Trace Debugging - main.rb
#+begin_src ruby
# ./samples/10_advanced_debugging/01_trace_debugging/app/main.rb
@@ -15603,12 +15881,12 @@ Follows is a source code listing for all files that have been open sourced. This
GTK::Entity.__reset_id__!
args.state.player_one = "test"
result = args.gtk.serialize_state args.state
- assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
+ assert.equal! result, "{:entity_id=>4, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
GTK::Entity.__reset_id__!
args.gtk.write_file 'state.txt', ''
result = args.gtk.serialize_state 'state.txt', args.state
- assert.equal! result, "{:entity_id=>3, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
+ assert.equal! result, "{:entity_id=>4, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>\"test\"}"
end
def test_deserialize args, assert
@@ -15657,7 +15935,7 @@ Follows is a source code listing for all files that have been open sourced. This
args.state.player_two = args.state.new_entity_strict(:player_strict, name: "Ken", blood_type: nil)
serialized_state = args.gtk.serialize_state args.state
- assert.equal! serialized_state, '{:entity_id=>9, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'
+ assert.equal! serialized_state, '{:entity_id=>7, :entity_keys_by_ref=>{}, :tick_count=>-1, :player_one=>{:entity_id=>1, :entity_name=>:player, :entity_keys_by_ref=>{}, :entity_type=>:player, :created_at=>-1, :global_created_at=>-1, :name=>"Ryu"}, :player_two=>{:entity_id=>2, :entity_name=>:player_strict, :entity_type=>:player_strict, :created_at=>-1, :global_created_at_elapsed=>-1, :entity_strict=>true, :entity_keys_by_ref=>{:entity_type=>:entity_name, :global_created_at_elapsed=>:created_at}, :name=>"Ken", :blood_type=>nil}}'
GTK::Entity.__reset_id__!
deserialized_state = args.gtk.deserialize_state serialized_state
@@ -15714,6 +15992,18 @@ Follows is a source code listing for all files that have been open sourced. This
deserialized_state = args.gtk.deserialize_state serialized_state
assert.equal! deserialized_state.strict_entity.one, deserialized_state.strict_entity.two
end
+
+ def test_serialization_excludes_thrash_count args, assert
+ GTK::Entity.__reset_id__!
+ args.state.player.name = "Ryu"
+ # force a nil pun
+ if args.state.player.age > 30
+ end
+ assert.equal! args.state.player.as_hash[:__thrash_count__][:>], 1
+ result = args.gtk.serialize_state args.state
+ assert.false! (result.include? "__thrash_count__"),
+ "The __thrash_count__ key exists in state when it shouldn't have."
+ end
#+end_src
@@ -15876,11 +16166,13 @@ Follows is a source code listing for all files that have been open sourced. This
*** Http - Retrieve Images - main.rb
#+begin_src ruby
# ./samples/11_http/01_retrieve_images/app/main.rb
+ $gtk.register_cvar 'app.warn_seconds', "seconds to wait before starting", :uint, 11
+
def tick args
args.outputs.background_color = [0, 0, 0]
# Show a warning at the start.
- args.state.warning_debounce ||= 11 * 60
+ args.state.warning_debounce ||= args.cvars['app.warn_seconds'].value * 60
if args.state.warning_debounce > 0
args.state.warning_debounce -= 1
args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]
@@ -15932,11 +16224,12 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
-*** Http - Web Server - main.rb
+*** Http - In Game Web Server Http Get - main.rb
#+begin_src ruby
- # ./samples/11_http/02_web_server/app/main.rb
+ # ./samples/11_http/02_in_game_web_server_http_get/app/main.rb
def tick args
args.state.port ||= 3000
+ args.state.reqnum ||= 0
# by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build
# to enable the http server in a production build, you need to manually start
# the server up:
@@ -15965,6 +16258,84 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Http - In Game Web Server Http Post - main.rb
+#+begin_src ruby
+ # ./samples/11_http/03_in_game_web_server_http_post/app/main.rb
+ def tick args
+ # defaults
+ args.state.post_button = args.layout.rect(row: 0, col: 0, w: 5, h: 1).merge(text: "execute http_post")
+ args.state.post_body_button = args.layout.rect(row: 1, col: 0, w: 5, h: 1).merge(text: "execute http_post_body")
+ args.state.request_to_s ||= ""
+ args.state.request_body ||= ""
+
+ # render
+ args.state.post_button.yield_self do |b|
+ args.outputs.borders << b
+ args.outputs.labels << b.merge(text: b.text,
+ y: b.y + 30,
+ x: b.x + 10)
+ end
+
+ args.state.post_body_button.yield_self do |b|
+ args.outputs.borders << b
+ args.outputs.labels << b.merge(text: b.text,
+ y: b.y + 30,
+ x: b.x + 10)
+ end
+
+ draw_label args, 0, 6, "Request:", args.state.request_to_s
+ draw_label args, 0, 14, "Request Body Unaltered:", args.state.request_body
+
+ # input
+ if args.inputs.mouse.click
+ # ============= HTTP_POST =============
+ if (args.inputs.mouse.inside_rect? args.state.post_button)
+ # ========= DATA TO SEND ===========
+ form_fields = { "userId" => "#{Time.now.to_i}" }
+ # ==================================
+
+ args.gtk.http_post "http://localhost:9001/testing",
+ form_fields,
+ ["Content-Type: application/x-www-form-urlencoded"]
+
+ args.gtk.notify! "http_post"
+ end
+
+ # ============= HTTP_POST_BODY =============
+ if (args.inputs.mouse.inside_rect? args.state.post_body_button)
+ # =========== DATA TO SEND ==============
+ json = "{ \"userId\": \"#{Time.now.to_i}\"}"
+ # ==================================
+
+ args.gtk.http_post_body "http://localhost:9001/testing",
+ json,
+ ["Content-Type: application/json", "Content-Length: #{json.length}"]
+
+ args.gtk.notify! "http_post_body"
+ end
+ end
+
+ # calc
+ args.inputs.http_requests.each do |r|
+ puts "#{r}"
+ if r.uri == "/testing"
+ puts r
+ args.state.request_to_s = "#{r}"
+ args.state.request_body = r.raw_body
+ r.respond 200, "ok"
+ end
+ end
+ end
+
+ def draw_label args, row, col, header, text
+ label_pos = args.layout.rect(row: row, col: col, w: 0, h: 0)
+ args.outputs.labels << "#{header}\n\n#{text}".wrapped_lines(80).map_with_index do |l, i|
+ { x: label_pos.x, y: label_pos.y - (i * 15), text: l, size_enum: -2 }
+ end
+ end
+
+#+end_src
+
*** C Extensions - Basics - main.rb
#+begin_src ruby
# ./samples/12_c_extensions/01_basics/app/main.rb
@@ -17401,8 +17772,8 @@ Follows is a source code listing for all files that have been open sourced. This
calc
# Calc Path
end
- render
- input
+ render
+ input
end
def defaults
@@ -17479,7 +17850,7 @@ Follows is a source code listing for all files that have been open sourced. This
[24, 9] => true,
[25, 8] => true,
[25, 9] => true,
- }
+ }
# Variables that are used by the breadth first search
# Storing cells that the search has visited, prevents unnecessary steps
@@ -17498,36 +17869,36 @@ Follows is a source code listing for all files that have been open sourced. This
# 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.current_input ||= :none
+ state.current_input ||= :none
end
def calc
# Setup the search to start from the star
- search.frontier << grid.star
+ search.frontier << grid.star
search.came_from[grid.star] = nil
# Until there are no more cells to expand from
- until search.frontier.empty?
+ until search.frontier.empty?
# Takes the next frontier cell
- new_frontier = search.frontier.shift
+ new_frontier = search.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 search.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless search.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited in the first grid
# Unless the target has been visited
# Add the neighbor to the frontier and remember which cell it came from
- search.frontier << neighbor
+ search.frontier << neighbor
search.came_from[neighbor] = new_frontier
end
end
end
end
-
+
# Draws everything onto the screen
def render
- render_background
+ render_background
# render_heat_map
render_walls
# render_path
@@ -17546,7 +17917,7 @@ Follows is a source code listing for all files that have been open sourced. This
if current_cell && parent_cell
outputs.lines << [(current_cell.x + 0.5) * grid.cell_size, (current_cell.y + 0.5) * grid.cell_size,
(parent_cell.x + 0.5) * grid.cell_size, (parent_cell.y + 0.5) * grid.cell_size, purple]
-
+
end
render_trail(parent_cell)
end
@@ -17572,8 +17943,8 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws what the grid looks like with nothing on it
def render_background
- render_unvisited
- render_grid_lines
+ render_unvisited
+ render_grid_lines
end
# Draws both grids
@@ -17588,7 +17959,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
for y in 0..grid.height
- outputs.lines << horizontal_line(y)
+ outputs.lines << horizontal_line(y)
end
end
@@ -17604,7 +17975,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws the walls on both grids
def render_walls
- grid.walls.each_key do |wall|
+ grid.walls.each_key do |wall|
outputs.solids << [scale_up(wall), wall_color]
end
end
@@ -17612,12 +17983,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Renders the star on both grids
def render_star
outputs.sprites << [scale_up(grid.star), 'star.png']
- end
+ end
# Renders the target on both grids
def render_target
outputs.sprites << [scale_up(grid.target), 'target.png']
- end
+ end
# Labels the grids
def render_labels
@@ -17677,14 +18048,14 @@ Follows is a source code listing for all files that have been open sourced. This
# The program has to remember that the user is dragging an object
# even when the mouse is no longer over that object
# So detecting input and processing input is separate
- # detect_input
- # process_input
+ # detect_input
+ # process_input
if inputs.mouse.up
state.current_input = :none
elsif star_clicked?
state.current_input = :star
end
-
+
if mouse_inside_grid?
unless grid.target == cell_closest_to_mouse
grid.target = cell_closest_to_mouse
@@ -17702,33 +18073,33 @@ Follows is a source code listing for all files that have been open sourced. This
# mouse left click is held
def detect_input
# When the mouse is up, nothing is being edited
- if inputs.mouse.up
- state.current_input = :none
+ if inputs.mouse.up
+ state.current_input = :none
# When the star in the no second grid is clicked
- elsif star_clicked?
- state.current_input = :star
+ elsif star_clicked?
+ state.current_input = :star
# When the target in the no second grid is clicked
- elsif target_clicked?
- state.current_input = :target
+ elsif target_clicked?
+ state.current_input = :target
# When a wall in the first grid is clicked
- elsif wall_clicked?
- state.current_input = :remove_wall
+ elsif wall_clicked?
+ state.current_input = :remove_wall
# When the first grid is clicked
- elsif grid_clicked?
+ elsif grid_clicked?
state.current_input = :add_wall
end
end
# Processes click and drag based on what the user is currently dragging
def process_input
- if state.current_input == :star
- input_star
- elsif state.current_input == :target
- input_target
- elsif state.current_input == :remove_wall
- input_remove_wall
- elsif state.current_input == :add_wall
- input_add_wall
+ if state.current_input == :star
+ input_star
+ elsif state.current_input == :target
+ input_target
+ elsif state.current_input == :remove_wall
+ input_remove_wall
+ elsif state.current_input == :add_wall
+ input_add_wall
end
end
@@ -17736,10 +18107,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def input_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
grid.star = cell_closest_to_mouse
- unless old_star == grid.star
- reset_search
+ unless old_star == grid.star
+ reset_search
end
end
@@ -17747,10 +18118,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchs the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def input_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
grid.target = cell_closest_to_mouse
- unless old_target == grid.target
- reset_search
+ unless old_target == grid.target
+ reset_search
end
end
@@ -17759,32 +18130,32 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 mouse_inside_grid?
+ if mouse_inside_grid?
if grid.walls.has_key?(cell_closest_to_mouse)
- grid.walls.delete(cell_closest_to_mouse)
- reset_search
+ grid.walls.delete(cell_closest_to_mouse)
+ reset_search
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def input_add_wall
- if mouse_inside_grid?
+ if mouse_inside_grid?
unless grid.walls.has_key?(cell_closest_to_mouse)
- grid.walls[cell_closest_to_mouse] = true
- reset_search
+ grid.walls[cell_closest_to_mouse] = true
+ reset_search
end
end
end
-
+
# Whenever the user edits the grid,
# The search has to be reset_searchd upto the current step
# with the current grid as the initial state of the grid
def reset_search
# Reset_Searchs the search
- search.frontier = []
- search.came_from = {}
+ search.frontier = []
+ search.came_from = {}
search.path = {}
end
@@ -17792,21 +18163,21 @@ Follows is a source code listing for all files that have been open sourced. This
# 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
# Sorts the neighbors so the rendered path is a zigzag path
# Cells in a diagonal direction are given priority
# Comment this line to see the difference
neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }
- neighbors
+ neighbors
end
# Finds the vertical and horizontal distance of a cell from the star
@@ -17831,13 +18202,13 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse helps with this
def 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
# Signal that the user is going to be moving the star from the first grid
@@ -17865,13 +18236,13 @@ Follows is a source code listing for all files that have been open sourced. This
# Light brown
def unvisited_color
- [221, 212, 213]
+ [221, 212, 213]
# [255, 255, 255]
end
# Camo Green
def wall_color
- [134, 134, 120]
+ [134, 134, 120]
end
# Pastel White
@@ -17909,7 +18280,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $breadcrumbs ||= Breadcrumbs.new(args)
+ $breadcrumbs ||= Breadcrumbs.new
$breadcrumbs.args = args
$breadcrumbs.tick
end
@@ -17966,8 +18337,8 @@ Follows is a source code listing for all files that have been open sourced. This
# And calculate the path
calc_path
end
- render
- input
+ render
+ input
end
def defaults
@@ -17983,14 +18354,14 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 ||= args.state.grid.width * args.state.grid.height
+ state.max_steps ||= args.state.grid.width * args.state.grid.height
# The location of the star and walls of the grid
# They can be modified to have a different initial grid
# Walls are stored in a hash for quick look up when doing the search
state.star ||= [2, 8]
state.target ||= [10, 5]
- state.walls ||= {}
+ state.walls ||= {}
# Variables that are used by the breadth first search
# Storing cells that the search has visited, prevents unnecessary steps
@@ -18013,12 +18384,12 @@ Follows is a source code listing for all files that have been open sourced. This
# 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.current_input ||= :none
+ state.current_input ||= :none
end
# Draws everything onto the screen
def render
- render_background
+ render_background
render_heat_map
render_walls
render_path
@@ -18031,8 +18402,8 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws what the grid looks like with nothing on it
def render_background
- render_unvisited
- render_grid_lines
+ render_unvisited
+ render_grid_lines
end
# Draws both grids
@@ -18049,7 +18420,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
for y in 0..grid.height
- outputs.lines << horizontal_line(y)
+ outputs.lines << horizontal_line(y)
outputs.lines << early_exit_horizontal_line(y)
end
end
@@ -18076,7 +18447,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws the walls on both grids
def render_walls
- state.walls.each_key do |wall|
+ state.walls.each_key do |wall|
outputs.solids << [scale_up(wall), wall_color]
outputs.solids << [early_exit_scale_up(wall), wall_color]
end
@@ -18086,13 +18457,13 @@ Follows is a source code listing for all files that have been open sourced. This
def render_star
outputs.sprites << [scale_up(state.star), 'star.png']
outputs.sprites << [early_exit_scale_up(state.star), 'star.png']
- end
+ end
# Renders the target on both grids
def render_target
outputs.sprites << [scale_up(state.target), 'target.png']
outputs.sprites << [early_exit_scale_up(state.target), 'target.png']
- end
+ end
# Labels the grids
def render_labels
@@ -18184,8 +18555,8 @@ Follows is a source code listing for all files that have been open sourced. This
# The program has to remember that the user is dragging an object
# even when the mouse is no longer over that object
# So detecting input and processing input is separate
- detect_input
- process_input
+ detect_input
+ process_input
end
# Determines what the user is editing and stores the value
@@ -18193,53 +18564,53 @@ Follows is a source code listing for all files that have been open sourced. This
# mouse left click is held
def detect_input
# When the mouse is up, nothing is being edited
- if inputs.mouse.up
- state.current_input = :none
+ if inputs.mouse.up
+ state.current_input = :none
# When the star in the no second grid is clicked
- elsif star_clicked?
- state.current_input = :star
+ elsif star_clicked?
+ state.current_input = :star
# When the star in the second grid is clicked
- elsif star2_clicked?
- state.current_input = :star2
+ elsif star2_clicked?
+ state.current_input = :star2
# When the target in the no second grid is clicked
- elsif target_clicked?
- state.current_input = :target
+ elsif target_clicked?
+ state.current_input = :target
# When the target in the second grid is clicked
- elsif target2_clicked?
- state.current_input = :target2
+ elsif target2_clicked?
+ state.current_input = :target2
# When a wall in the first grid is clicked
- elsif wall_clicked?
- state.current_input = :remove_wall
+ elsif wall_clicked?
+ state.current_input = :remove_wall
# When a wall in the second grid is clicked
- elsif wall2_clicked?
+ elsif wall2_clicked?
state.current_input = :remove_wall2
# When the first grid is clicked
- elsif grid_clicked?
+ elsif grid_clicked?
state.current_input = :add_wall
# When the second grid is clicked
- elsif grid2_clicked?
+ elsif grid2_clicked?
state.current_input = :add_wall2
end
end
# Processes click and drag based on what the user is currently dragging
def process_input
- if state.current_input == :star
- input_star
+ if state.current_input == :star
+ input_star
elsif state.current_input == :star2
- input_star2
- elsif state.current_input == :target
- input_target
- elsif state.current_input == :target2
- input_target2
- elsif state.current_input == :remove_wall
- input_remove_wall
+ input_star2
+ elsif state.current_input == :target
+ input_target
+ elsif state.current_input == :target2
+ input_target2
+ elsif state.current_input == :remove_wall
+ input_remove_wall
elsif state.current_input == :remove_wall2
- input_remove_wall2
- elsif state.current_input == :add_wall
- input_add_wall
- elsif state.current_input == :add_wall2
- input_add_wall2
+ input_remove_wall2
+ elsif state.current_input == :add_wall
+ input_add_wall
+ elsif state.current_input == :add_wall2
+ input_add_wall2
end
end
@@ -18247,10 +18618,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def input_star
- old_star = state.star.clone
+ old_star = state.star.clone
state.star = cell_closest_to_mouse
- unless old_star == state.star
- reset_search
+ unless old_star == state.star
+ reset_search
end
end
@@ -18258,10 +18629,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def input_star2
- old_star = state.star.clone
+ old_star = state.star.clone
state.star = cell_closest_to_mouse2
- unless old_star == state.star
- reset_search
+ unless old_star == state.star
+ reset_search
end
end
@@ -18269,10 +18640,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchs the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def input_target
- old_target = state.target.clone
+ old_target = state.target.clone
state.target = cell_closest_to_mouse
- unless old_target == state.target
- reset_search
+ unless old_target == state.target
+ reset_search
end
end
@@ -18280,10 +18651,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchs the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def input_target2
- old_target = state.target.clone
+ old_target = state.target.clone
state.target = cell_closest_to_mouse2
- unless old_target == state.target
- reset_search
+ unless old_target == state.target
+ reset_search
end
end
@@ -18292,10 +18663,10 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 mouse_inside_grid?
+ if mouse_inside_grid?
if state.walls.has_key?(cell_closest_to_mouse)
- state.walls.delete(cell_closest_to_mouse)
- reset_search
+ state.walls.delete(cell_closest_to_mouse)
+ reset_search
end
end
end
@@ -18305,31 +18676,31 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 mouse_inside_grid2?
+ if mouse_inside_grid2?
if state.walls.has_key?(cell_closest_to_mouse2)
- state.walls.delete(cell_closest_to_mouse2)
- reset_search
+ state.walls.delete(cell_closest_to_mouse2)
+ reset_search
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def input_add_wall
- if mouse_inside_grid?
+ if mouse_inside_grid?
unless state.walls.has_key?(cell_closest_to_mouse)
- state.walls[cell_closest_to_mouse] = true
- reset_search
+ state.walls[cell_closest_to_mouse] = true
+ reset_search
end
end
end
-
+
# Adds a wall in the second grid in the cell the mouse is over
def input_add_wall2
- if mouse_inside_grid2?
+ if mouse_inside_grid2?
unless state.walls.has_key?(cell_closest_to_mouse2)
- state.walls[cell_closest_to_mouse2] = true
- reset_search
+ state.walls[cell_closest_to_mouse2] = true
+ reset_search
end
end
end
@@ -18339,10 +18710,10 @@ Follows is a source code listing for all files that have been open sourced. This
# with the current grid as the initial state of the grid
def reset_search
# Reset_Searchs the search
- state.frontier = []
- state.visited = {}
- state.early_exit_visited = {}
- state.came_from = {}
+ state.frontier = []
+ state.visited = {}
+ state.early_exit_visited = {}
+ state.came_from = {}
state.path = {}
end
@@ -18350,23 +18721,23 @@ Follows is a source code listing for all files that have been open sourced. This
def step
# The setup to the search
# Runs once when there are no visited cells
- if state.visited.empty?
- state.visited[state.star] = true
- state.early_exit_visited[state.star] = true
- state.frontier << state.star
+ if state.visited.empty?
+ state.visited[state.star] = true
+ state.early_exit_visited[state.star] = true
+ state.frontier << state.star
state.came_from[state.star] = nil
end
# A step in the search
- unless state.frontier.empty?
+ unless state.frontier.empty?
# Takes the next frontier cell
- new_frontier = state.frontier.shift
+ new_frontier = state.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 state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)
+ unless state.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited in the first grid
- state.visited[neighbor] = true
+ state.visited[neighbor] = true
# Unless the target has been visited
unless state.visited.has_key?(state.target)
# Mark the neighbor as visited in the second grid as well
@@ -18374,32 +18745,32 @@ Follows is a source code listing for all files that have been open sourced. This
end
# Add the neighbor to the frontier and remember which cell it came from
- state.frontier << neighbor
+ state.frontier << neighbor
state.came_from[neighbor] = new_frontier
end
end
end
end
-
+
# 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
# Sorts the neighbors so the rendered path is a zigzag path
# Cells in a diagonal direction are given priority
# Comment this line to see the difference
neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }
- neighbors
+ neighbors
end
# Finds the vertical and horizontal distance of a cell from the star
@@ -18424,13 +18795,13 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse helps with this
def 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
@@ -18438,15 +18809,15 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse in the second grid helps with this
def cell_closest_to_mouse2
# 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 = 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
# Signal that the user is going to be moving the star from the first grid
@@ -18525,12 +18896,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Light brown
def unvisited_color
- [221, 212, 213]
+ [221, 212, 213]
end
# Camo Green
def wall_color
- [134, 134, 120]
+ [134, 134, 120]
end
# Pastel White
@@ -18560,7 +18931,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)
+ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new
$early_exit_breadth_first_search.args = args
$early_exit_breadth_first_search.tick
end
@@ -18596,8 +18967,8 @@ Follows is a source code listing for all files that have been open sourced. This
# The next step in the search is calculated
def tick
defaults
- render
- input
+ render
+ input
calc
end
@@ -18614,7 +18985,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Walls are stored in a hash for quick look up when doing the search
state.star ||= [1, 5]
state.target ||= [8, 4]
- state.walls ||= {[1, 1] => true, [2, 1] => true, [3, 1] => true, [1, 2] => true, [2, 2] => true, [3, 2] => true}
+ state.walls ||= {[1, 1] => true, [2, 1] => true, [3, 1] => true, [1, 2] => true, [2, 2] => true, [3, 2] => true}
state.hills ||= {
[4, 1] => true,
[5, 1] => true,
@@ -18649,7 +19020,7 @@ Follows is a source code listing for all files that have been open sourced. This
# 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
# Values that are used for the breadth first search
# Keeping track of what cells were visited prevents counting cells multiple times
@@ -18673,7 +19044,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws everything onto the screen
def render
- render_background
+ render_background
render_heat_maps
@@ -18688,8 +19059,8 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws what the grid looks like with nothing on it
def render_background
- render_unvisited
- render_grid_lines
+ render_unvisited
+ render_grid_lines
render_labels
end
@@ -18708,7 +19079,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
for y in 0..grid.height
- outputs.lines << horizontal_line(y)
+ outputs.lines << horizontal_line(y)
outputs.lines << shifted_horizontal_line(y)
end
end
@@ -18821,16 +19192,16 @@ Follows is a source code listing for all files that have been open sourced. This
def render_star
outputs.sprites << [scale_up(state.star), 'star.png']
outputs.sprites << [move_and_scale_up(state.star), 'star.png']
- end
+ end
# Renders the target on both grids
def render_target
outputs.sprites << [scale_up(state.target), 'target.png']
outputs.sprites << [move_and_scale_up(state.target), 'target.png']
- end
+ end
def render_hills
- state.hills.each_key do |hill|
+ state.hills.each_key do |hill|
outputs.solids << [scale_up(hill), hill_color]
outputs.solids << [move_and_scale_up(hill), hill_color]
end
@@ -18838,7 +19209,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Draws the walls on both grids
def render_walls
- state.walls.each_key do |wall|
+ state.walls.each_key do |wall|
outputs.solids << [scale_up(wall), wall_color]
outputs.solids << [move_and_scale_up(wall), wall_color]
end
@@ -18921,7 +19292,7 @@ Follows is a source code listing for all files that have been open sourced. This
# 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
+ determine_input
end
# Process user input based on user_input variable and current mouse position
@@ -18934,43 +19305,43 @@ Follows is a source code listing for all files that have been open sourced. This
# mouse left click is held
def determine_input
# If the mouse is over the star in the first grid
- if mouse_over_star?
+ if mouse_over_star?
# The user is editing the star from the first grid
- state.user_input = :star
+ state.user_input = :star
# If the mouse is over the star in the second grid
- elsif mouse_over_star2?
+ elsif mouse_over_star2?
# The user is editing the star from the second grid
- state.user_input = :star2
+ state.user_input = :star2
# If the mouse is over the target in the first grid
- elsif mouse_over_target?
+ elsif mouse_over_target?
# The user is editing the target from the first grid
- state.user_input = :target
+ state.user_input = :target
# If the mouse is over the target in the second grid
- elsif mouse_over_target2?
+ elsif mouse_over_target2?
# The user is editing the target from the second grid
- state.user_input = :target2
+ state.user_input = :target2
# If the mouse is over a wall in the first grid
- elsif mouse_over_wall?
+ elsif mouse_over_wall?
# The user is removing a wall from the first grid
- state.user_input = :remove_wall
+ state.user_input = :remove_wall
# If the mouse is over a wall in the second grid
- elsif mouse_over_wall2?
+ elsif mouse_over_wall2?
# The user is removing a wall from the second grid
state.user_input = :remove_wall2
# If the mouse is over a hill in the first grid
- elsif mouse_over_hill?
+ elsif mouse_over_hill?
# The user is adding a wall from the first grid
- state.user_input = :add_wall
+ state.user_input = :add_wall
# If the mouse is over a hill in the second grid
- elsif mouse_over_hill2?
+ elsif mouse_over_hill2?
# The user is adding a wall from the second grid
state.user_input = :add_wall2
# If the mouse is over the first grid
- elsif mouse_over_grid?
+ elsif mouse_over_grid?
# The user is adding a hill from the first grid
state.user_input = :add_hill
# If the mouse is over the second grid
- elsif mouse_over_grid2?
+ elsif mouse_over_grid2?
# The user is adding a hill from the second grid
state.user_input = :add_hill2
end
@@ -18978,26 +19349,26 @@ Follows is a source code listing for all files that have been open sourced. This
# Processes click and drag based on what the user is currently dragging
def process_input
- if state.user_input == :star
- input_star
+ if state.user_input == :star
+ input_star
elsif state.user_input == :star2
- input_star2
- elsif state.user_input == :target
- input_target
- elsif state.user_input == :target2
- input_target2
- elsif state.user_input == :remove_wall
- input_remove_wall
+ input_star2
+ elsif state.user_input == :target
+ input_target
+ elsif state.user_input == :target2
+ input_target2
+ elsif state.user_input == :remove_wall
+ input_remove_wall
elsif state.user_input == :remove_wall2
- input_remove_wall2
- elsif state.user_input == :add_hill
- input_add_hill
- elsif state.user_input == :add_hill2
- input_add_hill2
- elsif state.user_input == :add_wall
- input_add_wall
- elsif state.user_input == :add_wall2
- input_add_wall2
+ input_remove_wall2
+ elsif state.user_input == :add_hill
+ input_add_hill
+ elsif state.user_input == :add_hill2
+ input_add_hill2
+ elsif state.user_input == :add_wall
+ input_add_wall
+ elsif state.user_input == :add_wall2
+ input_add_wall2
end
end
@@ -19010,26 +19381,26 @@ Follows is a source code listing for all files that have been open sourced. This
calc_dijkstra
end
end
-
+
def calc_breadth_first
# Sets up the Breadth First Search
- breadth_first_search.visited[state.star] = true
- breadth_first_search.frontier << state.star
+ breadth_first_search.visited[state.star] = true
+ breadth_first_search.frontier << state.star
breadth_first_search.came_from[state.star] = nil
until breadth_first_search.frontier.empty?
return if breadth_first_search.visited.has_key?(state.target)
# A step in the search
# Takes the next frontier cell
- new_frontier = breadth_first_search.frontier.shift
+ new_frontier = breadth_first_search.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 breadth_first_search.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)
+ unless breadth_first_search.visited.has_key?(neighbor) || state.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited in the first grid
- breadth_first_search.visited[neighbor] = true
- breadth_first_search.frontier << neighbor
+ breadth_first_search.visited[neighbor] = true
+ breadth_first_search.frontier << neighbor
# Remember which cell the neighbor came from
breadth_first_search.came_from[neighbor] = new_frontier
end
@@ -19089,12 +19460,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def input_star
- old_star = state.star.clone
+ old_star = state.star.clone
unless cell_closest_to_mouse == state.target
- state.star = cell_closest_to_mouse
+ state.star = cell_closest_to_mouse
end
- unless old_star == state.star
- reset_search
+ unless old_star == state.star
+ reset_search
end
end
@@ -19102,12 +19473,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
def input_star2
- old_star = state.star.clone
+ old_star = state.star.clone
unless cell_closest_to_mouse2 == state.target
state.star = cell_closest_to_mouse2
end
- unless old_star == state.star
- reset_search
+ unless old_star == state.star
+ reset_search
end
end
@@ -19115,12 +19486,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchs the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def input_target
- old_target = state.target.clone
+ old_target = state.target.clone
unless cell_closest_to_mouse == state.star
state.target = cell_closest_to_mouse
end
- unless old_target == state.target
- reset_search
+ unless old_target == state.target
+ reset_search
end
end
@@ -19128,12 +19499,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchs the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def input_target2
- old_target = state.target.clone
+ old_target = state.target.clone
unless cell_closest_to_mouse2 == state.star
state.target = cell_closest_to_mouse2
end
- unless old_target == state.target
- reset_search
+ unless old_target == state.target
+ reset_search
end
end
@@ -19142,11 +19513,11 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 mouse_over_grid?
+ if mouse_over_grid?
if state.walls.has_key?(cell_closest_to_mouse) or state.hills.has_key?(cell_closest_to_mouse)
- state.walls.delete(cell_closest_to_mouse)
- state.hills.delete(cell_closest_to_mouse)
- reset_search
+ state.walls.delete(cell_closest_to_mouse)
+ state.hills.delete(cell_closest_to_mouse)
+ reset_search
end
end
end
@@ -19156,21 +19527,21 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 mouse_over_grid2?
+ if mouse_over_grid2?
if state.walls.has_key?(cell_closest_to_mouse2) or state.hills.has_key?(cell_closest_to_mouse2)
- state.walls.delete(cell_closest_to_mouse2)
- state.hills.delete(cell_closest_to_mouse2)
- reset_search
+ state.walls.delete(cell_closest_to_mouse2)
+ state.hills.delete(cell_closest_to_mouse2)
+ reset_search
end
end
end
# Adds a hill in the first grid in the cell the mouse is over
def input_add_hill
- if mouse_over_grid?
+ if mouse_over_grid?
unless state.hills.has_key?(cell_closest_to_mouse)
- state.hills[cell_closest_to_mouse] = true
- reset_search
+ state.hills[cell_closest_to_mouse] = true
+ reset_search
end
end
end
@@ -19178,32 +19549,32 @@ Follows is a source code listing for all files that have been open sourced. This
# Adds a hill in the second grid in the cell the mouse is over
def input_add_hill2
- if mouse_over_grid2?
+ if mouse_over_grid2?
unless state.hills.has_key?(cell_closest_to_mouse2)
- state.hills[cell_closest_to_mouse2] = true
- reset_search
+ state.hills[cell_closest_to_mouse2] = true
+ reset_search
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def input_add_wall
- if mouse_over_grid?
+ if mouse_over_grid?
unless state.walls.has_key?(cell_closest_to_mouse)
- state.hills.delete(cell_closest_to_mouse)
- state.walls[cell_closest_to_mouse] = true
- reset_search
+ state.hills.delete(cell_closest_to_mouse)
+ state.walls[cell_closest_to_mouse] = true
+ reset_search
end
end
end
# Adds a wall in the second grid in the cell the mouse is over
def input_add_wall2
- if mouse_over_grid2?
+ if mouse_over_grid2?
unless state.walls.has_key?(cell_closest_to_mouse2)
- state.hills.delete(cell_closest_to_mouse2)
- state.walls[cell_closest_to_mouse2] = true
- reset_search
+ state.hills.delete(cell_closest_to_mouse2)
+ state.walls[cell_closest_to_mouse2] = true
+ reset_search
end
end
end
@@ -19226,21 +19597,21 @@ Follows is a source code listing for all files that have been open sourced. This
# 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
# Sorts the neighbors so the rendered path is a zigzag path
# Cells in a diagonal direction are given priority
# Comment this line to see the difference
neighbors = neighbors.sort_by { |neighbor_x, neighbor_y| proximity_to_star(neighbor_x, neighbor_y) }
- neighbors
+ neighbors
end
# Finds the vertical and horizontal distance of a cell from the star
@@ -19265,13 +19636,13 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse helps with this
def 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
@@ -19279,17 +19650,17 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse in the second grid helps with this
def cell_closest_to_mouse2
# 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
# Signal that the user is going to be moving the star from the first grid
@@ -19362,12 +19733,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Light brown
def unvisited_color
- [221, 212, 213]
+ [221, 212, 213]
end
# Camo Green
def wall_color
- [134, 134, 120]
+ [134, 134, 120]
end
# Pastel White
@@ -19410,7 +19781,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
# Every tick, new args are passed, and the Dijkstra tick method is called
- $movement_costs ||= Movement_Costs.new(args)
+ $movement_costs ||= Movement_Costs.new
$movement_costs.args = args
$movement_costs.tick
end
@@ -20396,7 +20767,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $heuristic_with_walls ||= Heuristic_With_Walls.new(args)
+ $heuristic_with_walls ||= Heuristic_With_Walls.new
$heuristic_with_walls.args = args
$heuristic_with_walls.tick
end
@@ -21415,7 +21786,7 @@ Follows is a source code listing for all files that have been open sourced. This
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
@@ -21443,8 +21814,8 @@ Follows is a source code listing for all files that have been open sourced. This
def tick
defaults
- render
- input
+ render
+ input
if dijkstra.came_from.empty?
calc_searches
@@ -21497,7 +21868,7 @@ Follows is a source code listing for all files that have been open sourced. This
# 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.
@@ -21575,7 +21946,7 @@ Follows is a source code listing for all files that have been open sourced. This
# 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
@@ -21586,51 +21957,51 @@ Follows is a source code listing for all files that have been open sourced. This
# This method is called when the mouse is clicked down
def determine_input
# If the mouse is over the star in the first grid
- if dijkstra_mouse_over_star?
+ if dijkstra_mouse_over_star?
# The user is editing the star from the first grid
- state.user_input = :dijkstra_star
+ state.user_input = :dijkstra_star
# If the mouse is over the star in the second grid
- elsif greedy_mouse_over_star?
+ elsif greedy_mouse_over_star?
# The user is editing the star from the second grid
- state.user_input = :greedy_star
+ state.user_input = :greedy_star
# If the mouse is over the star in the third grid
- elsif a_star_mouse_over_star?
+ elsif a_star_mouse_over_star?
# The user is editing the star from the third grid
- state.user_input = :a_star_star
+ state.user_input = :a_star_star
# If the mouse is over the target in the first grid
- elsif dijkstra_mouse_over_target?
+ elsif dijkstra_mouse_over_target?
# The user is editing the target from the first grid
- state.user_input = :dijkstra_target
+ state.user_input = :dijkstra_target
# If the mouse is over the target in the second grid
- elsif greedy_mouse_over_target?
+ elsif greedy_mouse_over_target?
# The user is editing the target from the second grid
- state.user_input = :greedy_target
+ state.user_input = :greedy_target
# If the mouse is over the target in the third grid
- elsif a_star_mouse_over_target?
+ elsif a_star_mouse_over_target?
# The user is editing the target from the third grid
- state.user_input = :a_star_target
+ state.user_input = :a_star_target
# If the mouse is over a wall in the first grid
- elsif dijkstra_mouse_over_wall?
+ elsif dijkstra_mouse_over_wall?
# The user is removing a wall from the first grid
- state.user_input = :dijkstra_remove_wall
+ state.user_input = :dijkstra_remove_wall
# If the mouse is over a wall in the second grid
- elsif greedy_mouse_over_wall?
+ elsif greedy_mouse_over_wall?
# The user is removing a wall from the second grid
state.user_input = :greedy_remove_wall
# If the mouse is over a wall in the third grid
- elsif a_star_mouse_over_wall?
+ elsif a_star_mouse_over_wall?
# The user is removing a wall from the third grid
state.user_input = :a_star_remove_wall
# If the mouse is over the first grid
- elsif dijkstra_mouse_over_grid?
+ elsif dijkstra_mouse_over_grid?
# The user is adding a wall from the first grid
state.user_input = :dijkstra_add_wall
# If the mouse is over the second grid
- elsif greedy_mouse_over_grid?
+ elsif greedy_mouse_over_grid?
# The user is adding a wall from the second grid
state.user_input = :greedy_add_wall
# If the mouse is over the third grid
- elsif a_star_mouse_over_grid?
+ elsif a_star_mouse_over_grid?
# The user is adding a wall from the third grid
state.user_input = :a_star_add_wall
end
@@ -21638,30 +22009,30 @@ Follows is a source code listing for all files that have been open sourced. This
# Processes click and drag based on what the user is currently dragging
def process_input
- if state.user_input == :dijkstra_star
- process_input_dijkstra_star
+ if state.user_input == :dijkstra_star
+ process_input_dijkstra_star
elsif state.user_input == :greedy_star
- process_input_greedy_star
+ process_input_greedy_star
elsif state.user_input == :a_star_star
- process_input_a_star_star
- elsif state.user_input == :dijkstra_target
- process_input_dijkstra_target
- elsif state.user_input == :greedy_target
- process_input_greedy_target
- elsif state.user_input == :a_star_target
- process_input_a_star_target
- elsif state.user_input == :dijkstra_remove_wall
- process_input_dijkstra_remove_wall
+ process_input_a_star_star
+ elsif state.user_input == :dijkstra_target
+ process_input_dijkstra_target
+ elsif state.user_input == :greedy_target
+ process_input_greedy_target
+ elsif state.user_input == :a_star_target
+ process_input_a_star_target
+ elsif state.user_input == :dijkstra_remove_wall
+ process_input_dijkstra_remove_wall
elsif state.user_input == :greedy_remove_wall
- process_input_greedy_remove_wall
+ process_input_greedy_remove_wall
elsif state.user_input == :a_star_remove_wall
- process_input_a_star_remove_wall
- elsif state.user_input == :dijkstra_add_wall
- process_input_dijkstra_add_wall
- elsif state.user_input == :greedy_add_wall
- process_input_greedy_add_wall
- elsif state.user_input == :a_star_add_wall
- process_input_a_star_add_wall
+ process_input_a_star_remove_wall
+ elsif state.user_input == :dijkstra_add_wall
+ process_input_dijkstra_add_wall
+ elsif state.user_input == :greedy_add_wall
+ process_input_greedy_add_wall
+ elsif state.user_input == :a_star_add_wall
+ process_input_a_star_add_wall
end
end
@@ -21676,7 +22047,7 @@ Follows is a source code listing for all files that have been open sourced. This
# The horizontal grid lines
for y in 0..grid.height
- outputs.lines << dijkstra_horizontal_line(y)
+ outputs.lines << dijkstra_horizontal_line(y)
end
end
@@ -21691,7 +22062,7 @@ Follows is a source code listing for all files that have been open sourced. This
# The horizontal grid lines
for y in 0..grid.height
- outputs.lines << greedy_horizontal_line(y)
+ outputs.lines << greedy_horizontal_line(y)
end
end
@@ -21706,10 +22077,10 @@ Follows is a source code listing for all files that have been open sourced. This
# The horizontal grid lines
for y in 0..grid.height
- outputs.lines << a_star_horizontal_line(y)
+ outputs.lines << a_star_horizontal_line(y)
end
end
-
+
# Returns a vertical line for a column of the first grid
def dijkstra_vertical_line column
dijkstra_scale_up([column, 0, column, grid.height])
@@ -21759,7 +22130,7 @@ Follows is a source code listing for all files that have been open sourced. This
def render_dijkstra_target
outputs.sprites << [dijkstra_scale_up(grid.target), 'target.png']
end
-
+
# Renders the target on the second grid
def render_greedy_target
outputs.sprites << [greedy_scale_up(grid.target), 'target.png']
@@ -21772,21 +22143,21 @@ Follows is a source code listing for all files that have been open sourced. This
# Renders the walls on the first grid
def render_dijkstra_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [dijkstra_scale_up(wall), wall_color]
end
end
# Renders the walls on the second grid
def render_greedy_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [greedy_scale_up(wall), wall_color]
end
end
# Renders the walls on the third grid
def render_a_star_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [a_star_scale_up(wall), wall_color]
end
end
@@ -21986,12 +22357,12 @@ Follows is a source code listing for all files that have been open sourced. This
# 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_dijkstra_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless dijkstra_cell_closest_to_mouse == grid.target
- grid.star = dijkstra_cell_closest_to_mouse
+ grid.star = dijkstra_cell_closest_to_mouse
end
- unless old_star == grid.star
- reset_searches
+ unless old_star == grid.star
+ reset_searches
end
end
@@ -21999,12 +22370,12 @@ Follows is a source code listing for all files that have been open sourced. This
# 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_greedy_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless greedy_cell_closest_to_mouse == grid.target
grid.star = greedy_cell_closest_to_mouse
end
- unless old_star == grid.star
- reset_searches
+ unless old_star == grid.star
+ reset_searches
end
end
@@ -22012,12 +22383,12 @@ Follows is a source code listing for all files that have been open sourced. This
# 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_a_star_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless a_star_cell_closest_to_mouse == grid.target
grid.star = a_star_cell_closest_to_mouse
end
- unless old_star == grid.star
- reset_searches
+ unless old_star == grid.star
+ reset_searches
end
end
@@ -22025,12 +22396,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_dijkstra_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless dijkstra_cell_closest_to_mouse == grid.star
grid.target = dijkstra_cell_closest_to_mouse
end
- unless old_target == grid.target
- reset_searches
+ unless old_target == grid.target
+ reset_searches
end
end
@@ -22038,12 +22409,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_greedy_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless greedy_cell_closest_to_mouse == grid.star
grid.target = greedy_cell_closest_to_mouse
end
- unless old_target == grid.target
- reset_searches
+ unless old_target == grid.target
+ reset_searches
end
end
@@ -22051,12 +22422,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only reset_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_a_star_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless a_star_cell_closest_to_mouse == grid.star
grid.target = a_star_cell_closest_to_mouse
end
- unless old_target == grid.target
- reset_searches
+ unless old_target == grid.target
+ reset_searches
end
end
@@ -22065,10 +22436,10 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 dijkstra_mouse_over_grid?
+ if dijkstra_mouse_over_grid?
if grid.walls.has_key?(dijkstra_cell_closest_to_mouse)
- grid.walls.delete(dijkstra_cell_closest_to_mouse)
- reset_searches
+ grid.walls.delete(dijkstra_cell_closest_to_mouse)
+ reset_searches
end
end
end
@@ -22078,10 +22449,10 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 greedy_mouse_over_grid?
+ if greedy_mouse_over_grid?
if grid.walls.has_key?(greedy_cell_closest_to_mouse)
- grid.walls.delete(greedy_cell_closest_to_mouse)
- reset_searches
+ grid.walls.delete(greedy_cell_closest_to_mouse)
+ reset_searches
end
end
end
@@ -22091,40 +22462,40 @@ Follows is a source code listing for all files that have been open sourced. This
# 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 a_star_mouse_over_grid?
+ if a_star_mouse_over_grid?
if grid.walls.has_key?(a_star_cell_closest_to_mouse)
- grid.walls.delete(a_star_cell_closest_to_mouse)
- reset_searches
+ grid.walls.delete(a_star_cell_closest_to_mouse)
+ reset_searches
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def process_input_dijkstra_add_wall
- if dijkstra_mouse_over_grid?
+ if dijkstra_mouse_over_grid?
unless grid.walls.has_key?(dijkstra_cell_closest_to_mouse)
- grid.walls[dijkstra_cell_closest_to_mouse] = true
- reset_searches
+ grid.walls[dijkstra_cell_closest_to_mouse] = true
+ reset_searches
end
end
end
# Adds a wall in the second grid in the cell the mouse is over
def process_input_greedy_add_wall
- if greedy_mouse_over_grid?
+ if greedy_mouse_over_grid?
unless grid.walls.has_key?(greedy_cell_closest_to_mouse)
- grid.walls[greedy_cell_closest_to_mouse] = true
- reset_searches
+ grid.walls[greedy_cell_closest_to_mouse] = true
+ reset_searches
end
end
end
# Adds a wall in the third grid in the cell the mouse is over
def process_input_a_star_add_wall
- if a_star_mouse_over_grid?
+ if a_star_mouse_over_grid?
unless grid.walls.has_key?(a_star_cell_closest_to_mouse)
- grid.walls[a_star_cell_closest_to_mouse] = true
- reset_searches
+ grid.walls[a_star_cell_closest_to_mouse] = true
+ reset_searches
end
end
end
@@ -22134,13 +22505,13 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse helps with this
def dijkstra_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
@@ -22148,17 +22519,17 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse in the second grid helps with this
def greedy_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
# When the user grabs the star and puts their cursor to the far right
@@ -22166,17 +22537,17 @@ Follows is a source code listing for all files that have been open sourced. This
# Finding the cell closest to the mouse in the third grid helps with this
def a_star_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) * 2
# 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 reset_searches
@@ -22204,21 +22575,21 @@ Follows is a source code listing for all files that have been open sourced. This
def calc_dijkstra
# Sets up the search to begin from the star
- dijkstra.frontier << grid.star
- dijkstra.came_from[grid.star] = nil
- dijkstra.cost_so_far[grid.star] = 0
+ dijkstra.frontier << grid.star
+ dijkstra.came_from[grid.star] = nil
+ dijkstra.cost_so_far[grid.star] = 0
# Until the target is found or there are no more cells to explore from
until dijkstra.came_from.has_key?(grid.target) or dijkstra.frontier.empty?
# Take the next frontier cell. The first element is the cell, the second is the priority.
new_frontier = dijkstra.frontier.shift#[0]
# 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 dijkstra.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)
+ unless dijkstra.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
dijkstra.frontier << neighbor
- dijkstra.came_from[neighbor] = new_frontier
+ dijkstra.came_from[neighbor] = new_frontier
dijkstra.cost_so_far[neighbor] = dijkstra.cost_so_far[new_frontier] + 1
end
end
@@ -22239,20 +22610,20 @@ Follows is a source code listing for all files that have been open sourced. This
def calc_greedy
# Sets up the search to begin from the star
- greedy.frontier << grid.star
- greedy.came_from[grid.star] = nil
+ greedy.frontier << grid.star
+ greedy.came_from[grid.star] = nil
# Until the target is found or there are no more cells to explore from
until greedy.came_from.has_key?(grid.target) or greedy.frontier.empty?
# Take the next frontier cell
- new_frontier = greedy.frontier.shift
+ new_frontier = greedy.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 greedy.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)
+ unless greedy.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- greedy.frontier << neighbor
- greedy.came_from[neighbor] = new_frontier
+ greedy.frontier << neighbor
+ greedy.came_from[neighbor] = new_frontier
end
end
# Sort the frontier so that cells that are in a zigzag pattern are prioritized over those in an line
@@ -22282,12 +22653,12 @@ Follows is a source code listing for all files that have been open sourced. This
current_frontier = a_star.frontier.shift
# For each of that cells neighbors
- adjacent_neighbors(current_frontier).each do | neighbor |
+ adjacent_neighbors(current_frontier).each do | neighbor |
# That have not been visited and are not walls
- unless a_star.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)
+ unless a_star.came_from.has_key?(neighbor) or grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- a_star.frontier << neighbor
- a_star.came_from[neighbor] = current_frontier
+ a_star.frontier << neighbor
+ a_star.came_from[neighbor] = current_frontier
a_star.cost_so_far[neighbor] = a_star.cost_so_far[current_frontier] + 1
end
end
@@ -22369,16 +22740,16 @@ Follows is a source code listing for all files that have been open sourced. This
# 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
@@ -22423,11 +22794,11 @@ Follows is a source code listing for all files that have been open sourced. This
def wall_color
[134, 134, 120] # Camo Green
end
-
+
def visited_color
[204, 191, 179] # Dark Brown
end
-
+
def path_color
[231, 230, 228] # Pastel White
end
@@ -22450,7 +22821,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
# Every tick, new args are passed, and the Breadth First Search tick is called
- $a_star_algorithm ||= A_Star_Algorithm.new(args)
+ $a_star_algorithm ||= A_Star_Algorithm.new
$a_star_algorithm.args = args
$a_star_algorithm.tick
end
@@ -22986,6 +23357,363 @@ Follows is a source code listing for all files that have been open sourced. This
https://en.wikipedia.org/wiki/OFF_(file_format)
#+end_src
+*** 3d - Yaw Pitch Roll - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_3d/03_yaw_pitch_roll/app/main.rb
+ class Game
+ attr_gtk
+
+ def tick
+ defaults
+ render
+ input
+ end
+
+ def matrix_mul m, v
+ (hmap x: ((m.x.x * v.x) + (m.x.y * v.y) + (m.x.z * v.z) + (m.x.w * v.w)),
+ y: ((m.y.x * v.x) + (m.y.y * v.y) + (m.y.z * v.z) + (m.y.w * v.w)),
+ z: ((m.z.x * v.x) + (m.z.y * v.y) + (m.z.z * v.z) + (m.z.w * v.w)),
+ w: ((m.w.x * v.x) + (m.w.y * v.y) + (m.w.z * v.z) + (m.w.w * v.w)))
+ end
+
+ def player_ship
+ [
+ # engine back
+ { x: -1, y: -1, z: 1, w: 0 },
+ { x: -1, y: 1, z: 1, w: 0 },
+
+ { x: -1, y: 1, z: 1, w: 0 },
+ { x: 1, y: 1, z: 1, w: 0 },
+
+ { x: 1, y: 1, z: 1, w: 0 },
+ { x: 1, y: -1, z: 1, w: 0 },
+
+ { x: 1, y: -1, z: 1, w: 0 },
+ { x: -1, y: -1, z: 1, w: 0 },
+
+ # engine front
+ { x: -1, y: -1, z: -1, w: 0 },
+ { x: -1, y: 1, z: -1, w: 0 },
+
+ { x: -1, y: 1, z: -1, w: 0 },
+ { x: 1, y: 1, z: -1, w: 0 },
+
+ { x: 1, y: 1, z: -1, w: 0 },
+ { x: 1, y: -1, z: -1, w: 0 },
+
+ { x: 1, y: -1, z: -1, w: 0 },
+ { x: -1, y: -1, z: -1, w: 0 },
+
+ # engine left
+ { x: -1, z: -1, y: -1, w: 0 },
+ { x: -1, z: -1, y: 1, w: 0 },
+
+ { x: -1, z: -1, y: 1, w: 0 },
+ { x: -1, z: 1, y: 1, w: 0 },
+
+ { x: -1, z: 1, y: 1, w: 0 },
+ { x: -1, z: 1, y: -1, w: 0 },
+
+ { x: -1, z: 1, y: -1, w: 0 },
+ { x: -1, z: -1, y: -1, w: 0 },
+
+ # engine right
+ { x: 1, z: -1, y: -1, w: 0 },
+ { x: 1, z: -1, y: 1, w: 0 },
+
+ { x: 1, z: -1, y: 1, w: 0 },
+ { x: 1, z: 1, y: 1, w: 0 },
+
+ { x: 1, z: 1, y: 1, w: 0 },
+ { x: 1, z: 1, y: -1, w: 0 },
+
+ { x: 1, z: 1, y: -1, w: 0 },
+ { x: 1, z: -1, y: -1, w: 0 },
+
+ # top front of engine to front of ship
+ { x: 1, y: 1, z: 1, w: 0 },
+ { x: 0, y: -1, z: 9, w: 0 },
+
+ { x: 0, y: -1, z: 9, w: 0 },
+ { x: -1, y: 1, z: 1, w: 0 },
+
+ # bottom front of engine
+ { x: 1, y: -1, z: 1, w: 0 },
+ { x: 0, y: -1, z: 9, w: 0 },
+
+ { x: -1, y: -1, z: 1, w: 0 },
+ { x: 0, y: -1, z: 9, w: 0 },
+
+ # right wing
+ # front of wing
+ { x: 1, y: 0.10, z: 1, w: 0 },
+ { x: 9, y: 0.10, z: -1, w: 0 },
+
+ { x: 9, y: 0.10, z: -1, w: 0 },
+ { x: 10, y: 0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: 1, y: 0.10, z: -1, w: 0 },
+ { x: 9, y: 0.10, z: -1, w: 0 },
+
+ { x: 10, y: 0.10, z: -2, w: 0 },
+ { x: 8, y: 0.10, z: -1, w: 0 },
+
+ # front of wing
+ { x: 1, y: -0.10, z: 1, w: 0 },
+ { x: 9, y: -0.10, z: -1, w: 0 },
+
+ { x: 9, y: -0.10, z: -1, w: 0 },
+ { x: 10, y: -0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: 1, y: -0.10, z: -1, w: 0 },
+ { x: 9, y: -0.10, z: -1, w: 0 },
+
+ { x: 10, y: -0.10, z: -2, w: 0 },
+ { x: 8, y: -0.10, z: -1, w: 0 },
+
+ # left wing
+ # front of wing
+ { x: -1, y: 0.10, z: 1, w: 0 },
+ { x: -9, y: 0.10, z: -1, w: 0 },
+
+ { x: -9, y: 0.10, z: -1, w: 0 },
+ { x: -10, y: 0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: -1, y: 0.10, z: -1, w: 0 },
+ { x: -9, y: 0.10, z: -1, w: 0 },
+
+ { x: -10, y: 0.10, z: -2, w: 0 },
+ { x: -8, y: 0.10, z: -1, w: 0 },
+
+ # front of wing
+ { x: -1, y: -0.10, z: 1, w: 0 },
+ { x: -9, y: -0.10, z: -1, w: 0 },
+
+ { x: -9, y: -0.10, z: -1, w: 0 },
+ { x: -10, y: -0.10, z: -2, w: 0 },
+
+ # back of wing
+ { x: -1, y: -0.10, z: -1, w: 0 },
+ { x: -9, y: -0.10, z: -1, w: 0 },
+
+ { x: -10, y: -0.10, z: -2, w: 0 },
+ { x: -8, y: -0.10, z: -1, w: 0 },
+
+ # left fin
+ # top
+ { x: -1, y: 0.10, z: 1, w: 0 },
+ { x: -1, y: 3, z: -3, w: 0 },
+
+ { x: -1, y: 0.10, z: -1, w: 0 },
+ { x: -1, y: 3, z: -3, w: 0 },
+
+ { x: -1.1, y: 0.10, z: 1, w: 0 },
+ { x: -1.1, y: 3, z: -3, w: 0 },
+
+ { x: -1.1, y: 0.10, z: -1, w: 0 },
+ { x: -1.1, y: 3, z: -3, w: 0 },
+
+ # bottom
+ { x: -1, y: -0.10, z: 1, w: 0 },
+ { x: -1, y: -2, z: -2, w: 0 },
+
+ { x: -1, y: -0.10, z: -1, w: 0 },
+ { x: -1, y: -2, z: -2, w: 0 },
+
+ { x: -1.1, y: -0.10, z: 1, w: 0 },
+ { x: -1.1, y: -2, z: -2, w: 0 },
+
+ { x: -1.1, y: -0.10, z: -1, w: 0 },
+ { x: -1.1, y: -2, z: -2, w: 0 },
+
+ # right fin
+ { x: 1, y: 0.10, z: 1, w: 0 },
+ { x: 1, y: 3, z: -3, w: 0 },
+
+ { x: 1, y: 0.10, z: -1, w: 0 },
+ { x: 1, y: 3, z: -3, w: 0 },
+
+ { x: 1.1, y: 0.10, z: 1, w: 0 },
+ { x: 1.1, y: 3, z: -3, w: 0 },
+
+ { x: 1.1, y: 0.10, z: -1, w: 0 },
+ { x: 1.1, y: 3, z: -3, w: 0 },
+
+ # bottom
+ { x: 1, y: -0.10, z: 1, w: 0 },
+ { x: 1, y: -2, z: -2, w: 0 },
+
+ { x: 1, y: -0.10, z: -1, w: 0 },
+ { x: 1, y: -2, z: -2, w: 0 },
+
+ { x: 1.1, y: -0.10, z: 1, w: 0 },
+ { x: 1.1, y: -2, z: -2, w: 0 },
+
+ { x: 1.1, y: -0.10, z: -1, w: 0 },
+ { x: 1.1, y: -2, z: -2, w: 0 },
+ ]
+ end
+
+ def defaults
+ state.points ||= player_ship
+ state.shifted_points ||= state.points.map { |point| point }
+
+ state.scale ||= 1
+ state.angle_x ||= 0
+ state.angle_y ||= 0
+ state.angle_z ||= 0
+ end
+
+ def matrix_new x0, y0, z0, w0, x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3
+ (hmap x: (hmap x: x0, y: y0, z: z0, w: w0),
+ y: (hmap x: x1, y: y1, z: z1, w: w1),
+ z: (hmap x: x2, y: y2, z: z2, w: w2),
+ w: (hmap x: x3, y: y3, z: z3, w: w3))
+ end
+
+ def angle_z_matrix degrees
+ cos_t = Math.cos degrees.to_radians
+ sin_t = Math.sin degrees.to_radians
+ (matrix_new cos_t, -sin_t, 0, 0,
+ sin_t, cos_t, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1)
+ end
+
+ def angle_y_matrix degrees
+ cos_t = Math.cos degrees.to_radians
+ sin_t = Math.sin degrees.to_radians
+ (matrix_new cos_t, 0, sin_t, 0,
+ 0, 1, 0, 0,
+ -sin_t, 0, cos_t, 0,
+ 0, 0, 0, 1)
+ end
+
+ def angle_x_matrix degrees
+ cos_t = Math.cos degrees.to_radians
+ sin_t = Math.sin degrees.to_radians
+ (matrix_new 1, 0, 0, 0,
+ 0, cos_t, -sin_t, 0,
+ 0, sin_t, cos_t, 0,
+ 0, 0, 0, 1)
+ end
+
+ def scale_matrix factor
+ (matrix_new factor, 0, 0, 0,
+ 0, factor, 0, 0,
+ 0, 0, factor, 0,
+ 0, 0, 0, 1)
+ end
+
+ def input
+ if (inputs.keyboard.shift && inputs.keyboard.p)
+ state.scale -= 0.1
+ elsif inputs.keyboard.p
+ state.scale += 0.1
+ end
+
+ if inputs.mouse.wheel
+ state.scale += inputs.mouse.wheel.y
+ end
+
+ state.scale = state.scale.clamp(0.1, 1000)
+
+ if (inputs.keyboard.shift && inputs.keyboard.y) || inputs.keyboard.right
+ state.angle_y += 1
+ elsif (inputs.keyboard.y) || inputs.keyboard.left
+ state.angle_y -= 1
+ end
+
+ if (inputs.keyboard.shift && inputs.keyboard.x) || inputs.keyboard.down
+ state.angle_x -= 1
+ elsif (inputs.keyboard.x || inputs.keyboard.up)
+ state.angle_x += 1
+ end
+
+ if inputs.keyboard.shift && inputs.keyboard.z
+ state.angle_z += 1
+ elsif inputs.keyboard.z
+ state.angle_z -= 1
+ end
+
+ if inputs.keyboard.zero
+ state.angle_x = 0
+ state.angle_y = 0
+ state.angle_z = 0
+ end
+
+ angle_x = state.angle_x
+ angle_y = state.angle_y
+ angle_z = state.angle_z
+ scale = state.scale
+
+ s_matrix = scale_matrix state.scale
+ x_matrix = angle_z_matrix angle_z
+ y_matrix = angle_y_matrix angle_y
+ z_matrix = angle_x_matrix angle_x
+
+ state.shifted_points = state.points.map do |point|
+ (matrix_mul s_matrix,
+ (matrix_mul z_matrix,
+ (matrix_mul x_matrix,
+ (matrix_mul y_matrix, point)))).merge(original: point)
+ end
+ end
+
+ def thick_line line
+ [
+ line.merge(y: line.y - 1, y2: line.y2 - 1, r: 0, g: 0, b: 0),
+ line.merge(x: line.x - 1, x2: line.x2 - 1, r: 0, g: 0, b: 0),
+ line.merge(x: line.x - 0, x2: line.x2 - 0, r: 0, g: 0, b: 0),
+ line.merge(y: line.y + 1, y2: line.y2 + 1, r: 0, g: 0, b: 0),
+ line.merge(x: line.x + 1, x2: line.x2 + 1, r: 0, g: 0, b: 0)
+ ]
+ end
+
+ def render
+ outputs.lines << state.shifted_points.each_slice(2).map do |(p1, p2)|
+ perc = 0
+ thick_line({ x: p1.x.*(10) + 640, y: p1.y.*(10) + 320,
+ x2: p2.x.*(10) + 640, y2: p2.y.*(10) + 320,
+ r: 255 * perc,
+ g: 255 * perc,
+ b: 255 * perc })
+ end
+
+ outputs.labels << [ 10, 700, "angle_x: #{state.angle_x.to_sf}", 0]
+ outputs.labels << [ 10, 670, "x, shift+x", 0]
+
+ outputs.labels << [210, 700, "angle_y: #{state.angle_y.to_sf}", 0]
+ outputs.labels << [210, 670, "y, shift+y", 0]
+
+ outputs.labels << [410, 700, "angle_z: #{state.angle_z.to_sf}", 0]
+ outputs.labels << [410, 670, "z, shift+z", 0]
+
+ outputs.labels << [610, 700, "scale: #{state.scale.to_sf}", 0]
+ outputs.labels << [610, 670, "p, shift+p", 0]
+ end
+ end
+
+ $game = Game.new
+
+ def tick args
+ $game.args = args
+ $game.tick
+ end
+
+ def set_angles x, y, z
+ $game.state.angle_x = x
+ $game.state.angle_y = y
+ $game.state.angle_z = z
+ end
+
+ $gtk.reset
+
+#+end_src
+
*** Arcade - Bullet Hell - main.rb
#+begin_src ruby
# ./samples/99_genre_arcade/bullet_hell/app/main.rb
@@ -23604,31 +24332,36 @@ Follows is a source code listing for all files that have been open sourced. This
end
def render_score
- outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label
- outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label
- outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label
+ outputs.primitives << { x: 10, y: 710, text: "HI SCORE: #{state.hi_score}", **large_white_typeset }
+ outputs.primitives << { x: 10, y: 680, text: "SCORE: #{state.score}", **large_white_typeset }
+ outputs.primitives << { x: 10, y: 650, text: "DIFFICULTY: #{state.difficulty.upcase}", **large_white_typeset }
end
def render_menu
return unless state.scene == :menu
render_overlay
- outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]
- outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]
- outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]
- outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]
- outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]
- outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]
- outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]
+ outputs.labels << { x: 640, y: 700, text: "Flappy Dragon", size_enum: 50, alignment_enum: 1, **white }
+ outputs.labels << { x: 640, y: 500, text: "Instructions: Press Spacebar to flap. Don't die.", size_enum: 4, alignment_enum: 1, **white }
+ outputs.labels << { x: 430, y: 430, text: "[Tab] Change difficulty", size_enum: 4, alignment_enum: 0, **white }
+ outputs.labels << { x: 430, y: 400, text: "[Enter] Start at New Difficulty ", size_enum: 4, alignment_enum: 0, **white }
+ outputs.labels << { x: 430, y: 370, text: "[Escape] Cancel/Resume ", size_enum: 4, alignment_enum: 0, **white }
+ outputs.labels << { x: 640, y: 300, text: "(mouse, touch, and game controllers work, too!) ", size_enum: 4, alignment_enum: 1, **white }
+ outputs.labels << { x: 640, y: 200, text: "Difficulty: #{state.new_difficulty.capitalize}", size_enum: 4, alignment_enum: 1, **white }
- outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]
- outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]
- outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]
- outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]
+ outputs.labels << { x: 10, y: 100, text: "Code: @amirrajan", **white }
+ outputs.labels << { x: 10, y: 80, text: "Art: @mobypixel", **white }
+ outputs.labels << { x: 10, y: 60, text: "Music: @mobypixel", **white }
+ outputs.labels << { x: 10, y: 40, text: "Engine: DragonRuby GTK", **white }
end
def render_overlay
- outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid
+ overlay_rect = grid.rect.scale_rect(1.1, 0, 0)
+ outputs.primitives << { x: overlay_rect.x,
+ y: overlay_rect.y,
+ w: overlay_rect.w,
+ h: overlay_rect.h,
+ r: 0, g: 0, b: 0, a: 230 }.solid!
end
def render_game
@@ -23641,14 +24374,14 @@ Follows is a source code listing for all files that have been open sourced. This
def render_game_over
return unless state.scene == :game
- outputs.labels << [638, 358, score_text, 20, 1]
- outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]
- outputs.labels << [638, 428, countdown_text, 20, 1]
- outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]
+ outputs.labels << { x: 638, y: 358, text: score_text, size_enum: 20, alignment_enum: 1 }
+ outputs.labels << { x: 635, y: 360, text: score_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }
+ outputs.labels << { x: 638, y: 428, text: countdown_text, size_enum: 20, alignment_enum: 1 }
+ outputs.labels << { x: 635, y: 430, text: countdown_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }
end
def render_background
- outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']
+ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: 'sprites/background.png' }
scroll_point_at = state.tick_count
scroll_point_at = state.scene_at if state.scene == :menu
@@ -23660,11 +24393,18 @@ Follows is a source code listing for all files that have been open sourced. This
outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80)
end
+ def scrolling_background at, path, rate, y = 0
+ [
+ { x: 0 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path },
+ { x: 1440 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path }
+ ]
+ end
+
def render_walls
state.walls.each do |w|
w.sprites = [
- [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],
- [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]
+ { x: w.x, y: w.bottom_height - 720, w: 100, h: 720, path: 'sprites/wall.png', angle: 180 },
+ { x: w.x, y: w.top_y, w: 100, h: 720, path: 'sprites/wallbottom.png', angle: 0 }
]
end
outputs.sprites << state.walls.map(&:sprites)
@@ -23673,15 +24413,13 @@ Follows is a source code listing for all files that have been open sourced. This
def render_dragon
state.show_death = true if state.countdown == 3.seconds
- render_debug_hitbox false
-
if state.show_death == false || !state.death_at
animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at
sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png"
- state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]
+ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }
else
sprite_name = "sprites/dragon_die.png"
- state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]
+ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }
sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds
state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1
state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction
@@ -23691,20 +24429,12 @@ Follows is a source code listing for all files that have been open sourced. This
outputs.sprites << state.dragon_sprite
end
- def render_debug_hitbox show
- return unless show
- outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite
- outputs.borders << state.walls.flat_map do |w|
- w.sprites.map { |s| [s.rect, 255, 0, 0] }
- end
- end
-
def render_flash
return unless state.flash_at
- outputs.primitives << [grid.rect,
- white,
- 255 * state.flash_at.ease(20, :flip)].solid
+ outputs.primitives << { **grid.rect.to_hash,
+ **white,
+ a: 255 * state.flash_at.ease(20, :flip) }.solid!
state.flash_at = 0 if state.flash_at.elapsed_time > 20
end
@@ -23824,19 +24554,12 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
- def scrolling_background at, path, rate, y = 0
- [
- [ 0 - at.*(rate) % 1440, y, 1440, 720, path],
- [1440 - at.*(rate) % 1440, y, 1440, 720, path]
- ]
- end
-
def white
- [255, 255, 255]
+ { r: 255, g: 255, b: 255 }
end
def large_white_typeset
- [5, 0, 255, 255, 255]
+ { size_enum: 5, alignment_enum: 0, r: 255, g: 255, b: 255 }
end
def at_beginning?
@@ -23845,9 +24568,9 @@ Follows is a source code listing for all files that have been open sourced. This
def dragon_collision_box
state.dragon_sprite
- .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)
- .rect_shift_right(10)
- .rect_shift_up(state.dy * 2)
+ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)
+ .rect_shift_right(10)
+ .rect_shift_up(state.dy * 2)
end
def game_over?
@@ -23856,7 +24579,7 @@ Follows is a source code listing for all files that have been open sourced. This
state.walls
.flat_map { |w| w.sprites }
.any? do |s|
- s.intersect_rect?(dragon_collision_box)
+ s && s.intersect_rect?(dragon_collision_box)
end
end
@@ -25248,319 +25971,6 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
-*** Crafting - Farming Game Starting Point - repl.rb
-#+begin_src ruby
- # ./samples/99_genre_crafting/farming_game_starting_point/app/repl.rb
- # ===============================================================
- # Welcome to repl.rb
- # ===============================================================
- # You can experiement with code within this file. Code in this
- # file is only executed when you save (and only excecuted ONCE).
- # ===============================================================
-
- # ===============================================================
- # REMOVE the "x" from the word "xrepl" and save the file to RUN
- # the code in between the do/end block delimiters.
- # ===============================================================
-
- # ===============================================================
- # ADD the "x" to the word "repl" (make it xrepl) and save the
- # file to IGNORE the code in between the do/end block delimiters.
- # ===============================================================
-
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- puts "The result of 1 + 2 is: #{1 + 2}"
- end
-
- # ====================================================================================
- # Ruby Crash Course:
- # Strings, Numeric, Booleans, Conditionals, Looping, Enumerables, Arrays
- # ====================================================================================
-
- # ====================================================================================
- # Strings
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- message = "Hello World"
- puts "The value of message is: " + message
- puts "Any value can be interpolated within a string using \#{}."
- puts "Interpolated message: #{message}."
- puts 'This #{message} is not interpolated because the string uses single quotes.'
- end
-
- # ====================================================================================
- # Numerics
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- a = 10
- puts "The value of a is: #{a}"
- puts "a + 1 is: #{a + 1}"
- puts "a / 3 is: #{a / 3}"
- end
-
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- b = 10.12
- puts "The value of b is: #{b}"
- puts "b + 1 is: #{b + 1}"
- puts "b as an integer is: #{b.to_i}"
- puts ''
- end
-
- # ====================================================================================
- # Booleans
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- c = 30
- puts "The value of c is #{c}."
-
- if c
- puts "This if statement ran because c is truthy."
- end
- end
-
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- d = false
- puts "The value of d is #{d}."
-
- if !d
- puts "This if statement ran because d is falsey, using the not operator (!) makes d evaluate to true."
- end
-
- e = nil
- puts "Nil is also considered falsey. The value of e is: #{e}."
-
- if !e
- puts "This if statement ran because e is nil (a falsey value)."
- end
- end
-
- # ====================================================================================
- # Conditionals
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- i_am_true = true
- i_am_nil = nil
- i_am_false = false
- i_am_hi = "hi"
-
- puts "======== if statement"
- i_am_one = 1
- if i_am_one
- puts "This was printed because i_am_one is truthy."
- end
-
- puts "======== if/else statement"
- if i_am_false
- puts "This will NOT get printed because i_am_false is false."
- else
- puts "This was printed because i_am_false is false."
- end
-
- puts "======== if/elsif/else statement"
- if i_am_false
- puts "This will NOT get printed because i_am_false is false."
- elsif i_am_true
- puts "This was printed because i_am_true is true."
- else
- puts "This will NOT get printed i_am_true was true."
- end
-
- puts "======== case statement "
- i_am_one = 1
- case i_am_one
- when 10
- puts "case equaled: 10"
- when 9
- puts "case equaled: 9"
- when 5
- puts "case equaled: 5"
- when 1
- puts "case equaled: 1"
- else
- puts "Value wasn't cased."
- end
-
- puts "======== different types of comparisons"
- if 4 == 4
- puts "equal (4 == 4)"
- end
-
- if 4 != 3
- puts "not equal (4 != 3)"
- end
-
- if 3 < 4
- puts "less than (3 < 4)"
- end
-
- if 4 > 3
- puts "greater than (4 > 3)"
- end
-
- if ((4 > 3) || (3 < 4) || false)
- puts "or statement ((4 > 3) || (3 < 4) || false)"
- end
-
- if ((4 > 3) && (3 < 4))
- puts "and statement ((4 > 3) && (3 < 4))"
- end
- end
-
- # ====================================================================================
- # Looping
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- puts "======== times block"
- 3.times do |i|
- puts i
- end
- puts "======== range block exclusive"
- (0...3).each do |i|
- puts i
- end
- puts "======== range block inclusive"
- (0..3).each do |i|
- puts i
- end
- end
-
- # ====================================================================================
- # Enumerables
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- puts "======== array each"
- colors = ["red", "blue", "yellow"]
- colors.each do |color|
- puts color
- end
-
- puts '======== array each_with_index'
- colors = ["red", "blue", "yellow"]
- colors.each_with_index do |color, i|
- puts "#{color} at index #{i}"
- end
- end
-
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- puts "======== single parameter function"
- def add_one_to n
- n + 5
- end
-
- puts add_one_to(3)
-
- puts "======== function with default value"
- def function_with_default_value v = 10
- v * 10
- end
-
- puts "passing three: #{function_with_default_value(3)}"
- puts "passing nil: #{function_with_default_value}"
-
- puts "======== Or Equal (||=) operator for nil values"
- def function_with_nil_default_with_local a = nil
- result = a
- result ||= "or equal operator was exected and set a default value"
- end
-
- puts "passing 'hi': #{function_with_nil_default_with_local 'hi'}"
- puts "passing nil: #{function_with_nil_default_with_local}"
- end
-
- # ====================================================================================
- # Arrays
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- puts "======== Create an array with the numbers 1 to 10."
- one_to_ten = (1..10).to_a
- puts one_to_ten
-
- puts "======== Create a new array that only contains even numbers from the previous array."
- one_to_ten = (1..10).to_a
- evens = one_to_ten.find_all do |number|
- number % 2 == 0
- end
- puts evens
-
- puts "======== Create a new array that rejects odd numbers."
- one_to_ten = (1..10).to_a
- also_even = one_to_ten.reject do |number|
- number % 2 != 0
- end
- puts also_even
-
- puts "======== Create an array that doubles every number."
- one_to_ten = (1..10).to_a
- doubled = one_to_ten.map do |number|
- number * 2
- end
- puts doubled
-
- puts "======== Create an array that selects only odd numbers and then multiply those by 10."
- one_to_ten = (1..10).to_a
- odd_doubled = one_to_ten.find_all do |number|
- number % 2 != 0
- end.map do |odd_number|
- odd_number * 10
- end
- puts odd_doubled
-
- puts "======== All combination of numbers 1 to 10."
- one_to_ten = (1..10).to_a
- all_combinations = one_to_ten.product(one_to_ten)
- puts all_combinations
-
- puts "======== All uniq combinations of numbers. For example: [1, 2] is the same as [2, 1]."
- one_to_ten = (1..10).to_a
- uniq_combinations =
- one_to_ten.product(one_to_ten)
- .map do |unsorted_number|
- unsorted_number.sort
- end.uniq
- puts uniq_combinations
- end
-
- # ====================================================================================
- # Advanced Arrays
- # ====================================================================================
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
- xrepl do
- puts "======== All unique Pythagorean Triples between 1 and 40 sorted by area of the triangle."
-
- one_to_hundred = (1..40).to_a
- triples =
- one_to_hundred.product(one_to_hundred).map do |width, height|
- [width, height, Math.sqrt(width ** 2 + height ** 2)]
- end.find_all do |_, _, hypotenuse|
- hypotenuse.to_i == hypotenuse
- end.map do |triangle|
- triangle.map(&:to_i)
- end.uniq do |triangle|
- triangle.sort
- end.map do |width, height, hypotenuse|
- [width, height, hypotenuse, (width * height) / 2]
- end.sort_by do |_, _, _, area|
- area
- end
-
- triples.each do |width, height, hypotenuse, area|
- puts "(#{width}, #{height}, #{hypotenuse}) = #{area}"
- end
- end
-
-#+end_src
-
*** Crafting - Farming Game Starting Point - tests.rb
#+begin_src ruby
# ./samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
@@ -28721,10 +29131,381 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Mario - Jumping - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_mario/01_jumping/app/main.rb
+ def tick args
+ defaults args
+ render args
+ input args
+ calc args
+ end
+
+ def defaults args
+ args.state.player.x ||= args.grid.w.half
+ args.state.player.y ||= 0
+ args.state.player.size ||= 100
+ args.state.player.dy ||= 0
+ args.state.player.action ||= :jumping
+ args.state.jump.power = 20
+ args.state.jump.increase_frames = 10
+ args.state.jump.increase_power = 1
+ args.state.gravity = -1
+ end
+
+ def render args
+ args.outputs.sprites << {
+ x: args.state.player.x -
+ args.state.player.size.half,
+ y: args.state.player.y,
+ w: args.state.player.size,
+ h: args.state.player.size,
+ path: 'sprites/square/red.png'
+ }
+ end
+
+ def input args
+ if args.inputs.keyboard.key_down.space
+ if args.state.player.action == :standing
+ args.state.player.action = :jumping
+ args.state.player.dy = args.state.jump.power
+
+ # record when the action took place
+ current_frame = args.state.tick_count
+ args.state.player.action_at = current_frame
+ end
+ end
+
+ # if the space bar is being held
+ if args.inputs.keyboard.key_held.space
+ # is the player jumping
+ is_jumping = args.state.player.action == :jumping
+
+ # when was the jump performed
+ time_of_jump = args.state.player.action_at
+
+ # how much time has passed since the jump
+ jump_elapsed_time = time_of_jump.elapsed_time
+
+ # how much time is allowed for increasing power
+ time_allowed = args.state.jump.increase_frames
+
+ # if the player is jumping
+ # and the elapsed time is less than
+ # the allowed time
+ if is_jumping && jump_elapsed_time < time_allowed
+ # increase the dy by the increase power
+ power_to_add = args.state.jump.increase_power
+ args.state.player.dy += power_to_add
+ end
+ end
+ end
+
+ def calc args
+ if args.state.player.action == :jumping
+ args.state.player.y += args.state.player.dy
+ args.state.player.dy += args.state.gravity
+ end
+
+ if args.state.player.y < 0
+ args.state.player.y = 0
+ args.state.player.action = :standing
+ end
+ end
+
+#+end_src
+
+*** Mario - Jumping And Collisions - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_mario/02_jumping_and_collisions/app/main.rb
+ class Game
+ attr_gtk
+
+ def tick
+ defaults
+ render
+ input
+ calc
+ end
+
+ def defaults
+ return if state.tick_count != 0
+
+ player.x = 64
+ player.y = 800
+ player.size = 50
+ player.dx = 0
+ player.dy = 0
+ player.action = :falling
+
+ player.max_speed = 20
+ player.jump_power = 15
+ player.jump_air_time = 15
+ player.jump_increase_power = 1
+
+ state.gravity = -1
+ state.drag = 0.001
+ state.tile_size = 64
+ state.tiles ||= [
+ { ordinal_x: 0, ordinal_y: 0 },
+ { ordinal_x: 1, ordinal_y: 0 },
+ { ordinal_x: 2, ordinal_y: 0 },
+ { ordinal_x: 3, ordinal_y: 0 },
+ { ordinal_x: 4, ordinal_y: 0 },
+ { ordinal_x: 5, ordinal_y: 0 },
+ { ordinal_x: 6, ordinal_y: 0 },
+ { ordinal_x: 7, ordinal_y: 0 },
+ { ordinal_x: 8, ordinal_y: 0 },
+ { ordinal_x: 9, ordinal_y: 0 },
+ { ordinal_x: 10, ordinal_y: 0 },
+ { ordinal_x: 11, ordinal_y: 0 },
+ { ordinal_x: 12, ordinal_y: 0 },
+
+ { ordinal_x: 9, ordinal_y: 3 },
+ { ordinal_x: 10, ordinal_y: 3 },
+ { ordinal_x: 11, ordinal_y: 3 },
+ ]
+
+ tiles.each do |t|
+ t.rect = { x: t.ordinal_x * 64,
+ y: t.ordinal_y * 64,
+ w: 64,
+ h: 64 }
+ end
+ end
+
+ def render
+ render_player
+ render_tiles
+ # render_grid
+ end
+
+ def input
+ input_jump
+ input_move
+ end
+
+ def calc
+ calc_player_rect
+ calc_left
+ calc_right
+ calc_below
+ calc_above
+ calc_player_dy
+ calc_player_dx
+ calc_game_over
+ end
+
+ def render_player
+ outputs.sprites << {
+ x: player.x,
+ y: player.y,
+ w: player.size,
+ h: player.size,
+ path: 'sprites/square/red.png'
+ }
+ end
+
+ def render_tiles
+ outputs.sprites << state.tiles.map do |t|
+ t.merge path: 'sprites/square/white.png',
+ x: t.ordinal_x * 64,
+ y: t.ordinal_y * 64,
+ w: 64,
+ h: 64
+ end
+ end
+
+ def render_grid
+ if state.tick_count == 0
+ outputs[:grid].background_color = [0, 0, 0, 0]
+ outputs[:grid].borders << available_brick_locations
+ outputs[:grid].labels << available_brick_locations.map do |b|
+ [
+ b.merge(text: "#{b.ordinal_x},#{b.ordinal_y}",
+ x: b.x + 2,
+ y: b.y + 2,
+ size_enum: -3,
+ vertical_alignment_enum: 0,
+ blendmode_enum: 0),
+ b.merge(text: "#{b.x},#{b.y}",
+ x: b.x + 2,
+ y: b.y + 2 + 20,
+ size_enum: -3,
+ vertical_alignment_enum: 0,
+ blendmode_enum: 0)
+ ]
+ end
+ end
+
+ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :grid }
+ end
+
+ def input_jump
+ if inputs.keyboard.key_down.space
+ player_jump
+ end
+
+ if inputs.keyboard.key_held.space
+ player_jump_increase_air_time
+ end
+ end
+
+ def input_move
+ if player.dx.abs < 20
+ if inputs.keyboard.left
+ player.dx -= 2
+ elsif inputs.keyboard.right
+ player.dx += 2
+ end
+ end
+ end
+
+ def calc_game_over
+ if player.y < -64
+ player.x = 64
+ player.y = 800
+ player.dx = 0
+ player.dy = 0
+ end
+ end
+
+ def calc_player_rect
+ player.rect = player_current_rect
+ player.next_rect = player_next_rect
+ player.prev_rect = player_prev_rect
+ end
+
+ def calc_player_dx
+ player.dx = player_next_dx
+ player.x += player.dx
+ end
+
+ def calc_player_dy
+ player.y += player.dy
+ player.dy = player_next_dy
+ end
+
+ def calc_below
+ return unless player.dy < 0
+ tiles_below = tiles_find { |t| t.rect.top <= player.prev_rect.y }
+ collision = tiles_find_colliding tiles_below, (player.rect.merge y: player.next_rect.y)
+ if collision
+ player.y = collision.rect.y + state.tile_size
+ player.dy = 0
+ player.action = :standing
+ else
+ player.action = :falling
+ end
+ end
+
+ def calc_left
+ return unless player.dx < 0 && player_next_dx < 0
+ tiles_left = tiles_find { |t| t.rect.right <= player.prev_rect.left }
+ collision = tiles_find_colliding tiles_left, (player.rect.merge x: player.next_rect.x)
+ return unless collision
+ player.x = collision.rect.right
+ player.dx = 0
+ end
+
+ def calc_right
+ return unless player.dx > 0 && player_next_dx > 0
+ tiles_right = tiles_find { |t| t.rect.left >= player.prev_rect.right }
+ collision = tiles_find_colliding tiles_right, (player.rect.merge x: player.next_rect.x)
+ return unless collision
+ player.x = collision.rect.left - player.rect.w
+ player.dx = 0
+ end
+
+ def calc_above
+ return unless player.dy > 0
+ tiles_above = tiles_find { |t| t.rect.y >= player.prev_rect.y }
+ collision = tiles_find_colliding tiles_above, (player.rect.merge y: player.next_rect.y)
+ return unless collision
+ player.dy = 0
+ player.y = collision.rect.bottom - player.rect.h
+ end
+
+ def player_current_rect
+ { x: player.x, y: player.y, w: player.size, h: player.size }
+ end
+
+ def available_brick_locations
+ (0..19).to_a
+ .product(0..11)
+ .map do |(ordinal_x, ordinal_y)|
+ { ordinal_x: ordinal_x,
+ ordinal_y: ordinal_y,
+ x: ordinal_x * 64,
+ y: ordinal_y * 64,
+ w: 64,
+ h: 64 }
+ end
+ end
+
+ def player
+ state.player ||= args.state.new_entity :player
+ end
+
+ def player_next_dy
+ player.dy + state.gravity + state.drag ** 2 * -1
+ end
+
+ def player_next_dx
+ player.dx * 0.8
+ end
+
+ def player_next_rect
+ player.rect.merge x: player.x + player_next_dx,
+ y: player.y + player_next_dy
+ end
+
+ def player_prev_rect
+ player.rect.merge x: player.x - player.dx,
+ y: player.y - player.dy
+ end
+
+ def player_jump
+ return if player.action != :standing
+ player.action = :jumping
+ player.dy = state.player.jump_power
+ current_frame = state.tick_count
+ player.action_at = current_frame
+ end
+
+ def player_jump_increase_air_time
+ return if player.action != :jumping
+ return if player.action_at.elapsed_time >= player.jump_air_time
+ player.dy += player.jump_increase_power
+ end
+
+ def tiles
+ state.tiles
+ end
+
+ def tiles_find_colliding tiles, target
+ tiles.find { |t| t.rect.intersect_rect? target }
+ end
+
+ def tiles_find &block
+ tiles.find_all(&block)
+ end
+ end
+
+ def tick args
+ $game ||= Game.new
+ $game.args = args
+ $game.tick
+ end
+
+ $gtk.reset
+
+#+end_src
+
*** Platformer - Clepto Frog - main.rb
#+begin_src ruby
# ./samples/99_genre_platformer/clepto_frog/app/main.rb
- MAP_FILE_PATH = 'app/map.txt'
+ MAP_FILE_PATH = 'map.txt'
require 'app/map.rb'
@@ -28779,35 +29560,7 @@ Follows is a source code listing for all files that have been open sourced. This
def render_intro
outputs.labels << [640, 700, "Clepto Frog", 4, 1]
- if state.tick_count >= 120
- outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",
- 4, 1, 0, 0, 0, 255 * 120.ease(60)]
- end
-
- if state.tick_count >= 240
- outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",
- 4, 1, 0, 0, 0, 255 * 240.ease(60)]
- end
-
- if state.tick_count >= 360
- outputs.labels << [640, 540, "\"Uh...\" - New Guy",
- 4, 1, 0, 0, 0, 255 * 360.ease(60)]
- end
-
- if state.tick_count >= 480
- outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",
- 4, 1, 0, 0, 0, 255 * 480.ease(60)]
- end
-
- if state.tick_count >= 600
- outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",
- 4, 1, 0, 0, 0, 255 * 600.ease(60)]
- end
-
- outputs.sprites << [640 - 50, 360 - 50, 100, 100,
- "sprites/square-green.png"]
-
- if state.tick_count == 800
+ if state.tick_count == 120
state.scene = :game
state.game_start_at = state.tick_count
end
@@ -28815,7 +29568,7 @@ Follows is a source code listing for all files that have been open sourced. This
def tick
defaults
- if state.scene == :intro && state.tick_count <= 800
+ if state.scene == :intro && state.tick_count <= 120
render_intro
elsif state.scene == :ending
render_ending
@@ -28918,15 +29671,15 @@ Follows is a source code listing for all files that have been open sourced. This
if state.god_mode
# SHOW HIDE COLLISIONS
- outputs.sprites << state.world.map do |x, y, w, h|
- x = vx(x)
- y = vy(y)
+ outputs.sprites << state.world.map do |rect|
+ x = vx(rect.x)
+ y = vy(rect.y)
if x > -80 && x < 1280 && y > -80 && y < 720
{
x: x,
y: y,
- w: vw(w || state.tile_size),
- h: vh(h || state.tile_size),
+ w: vw(rect.w || state.tile_size),
+ h: vh(rect.h || state.tile_size),
path: 'sprites/square-gray.png',
a: 128
}
@@ -28949,8 +29702,10 @@ Follows is a source code listing for all files that have been open sourced. This
# Creates sprite following mouse to help indicate which sprite you have selected
- outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,
- state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite
+ outputs.primitives << [inputs.mouse.position.x - 32 * state.camera_scale,
+ inputs.mouse.position.y - 32 * state.camera_scale,
+ state.tile_size * state.camera_scale,
+ state.tile_size * state.camera_scale, 'sprites/square-indigo.png', 0, 100].sprite
end
render_mini_map
@@ -29031,6 +29786,29 @@ Follows is a source code listing for all files that have been open sourced. This
set_camera_scale 1
end
+ if inputs.mouse.click
+ state.id_seed += 1
+ id = state.id_seed
+ x = state.camera_x + (inputs.mouse.click.x.fdiv(state.camera_scale) - 32)
+ y = state.camera_y + (inputs.mouse.click.y.fdiv(state.camera_scale) - 32)
+ x = ((x + 2).idiv 4) * 4
+ y = ((y + 2).idiv 4) * 4
+ w = 64
+ h = 64
+ candidate_rect = { id: id, x: x, y: y, w: w, h: h }
+ scaled_candidate_rect = { x: x + 30, y: y + 30, w: w - 60, h: h - 60 }
+ to_remove = state.world.find { |r| r.intersect_rect? scaled_candidate_rect }
+ if to_remove && args.inputs.keyboard.x
+ state.world.reject! { |r| r.id == to_remove.id }
+ else
+ state.world << candidate_rect
+ end
+ export_map
+ state.world_lookup = {}
+ state.world_collision_rects = nil
+ calc_world_lookup
+ end
+
if input_up?
state.y += 10
state.dy = 0
@@ -29052,12 +29830,6 @@ Follows is a source code listing for all files that have been open sourced. This
if state.scene == :game
process_inputs_player_movement
process_inputs_god_mode
- elsif state.scene == :intro
- if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space
- if Kernel.tick_count < 600
- Kernel.tick_count = 600
- end
- end
end
end
@@ -29155,17 +29927,6 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
- def add_floors
- # floors
- state.world += [
- [0, 0, 10000, 40],
- [0, 1670, 3250, 60],
- [6691, 1653, 3290, 60],
- [1521, 3792, 7370, 60],
- [0, 5137, 3290, 60]
- ]
- end
-
def attempt_load_world_from_file
return if state.world
# exported_world = gtk.read_file(MAP_FILE_PATH)
@@ -29173,26 +29934,11 @@ Follows is a source code listing for all files that have been open sourced. This
state.objects = []
if $collisions
- $collisions.map do |x, y, w, h|
- state.world << [x, y, w, h]
+ state.id_seed ||= 0
+ $collisions.each do |x, y, w, h|
+ state.id_seed += 1
+ state.world << { id: state.id_seed, x: x, y: y, w: w, h: h }
end
-
- add_floors
- # elsif exported_world
- # exported_world.each_line.map do |l|
- # tokens = l.strip.split(',')
- # x = tokens[0].to_i
- # y = tokens[1].to_i
- # type = tokens[2].to_i
- # if type == 1
- # state.world << [x, y, state.tile_size, state.tile_size]
- # elsif type == 2
- # w, h, path = tokens[3..-1]
- # state.objects << [x, y, w.to_i, h.to_i, path]
- # end
- # end
-
- # add_floors
end
if $mugs
@@ -29213,23 +29959,24 @@ Follows is a source code listing for all files that have been open sourced. This
# Searches through the world and finds the cordinates that exist
state.world_lookup = {}
- state.world.each do |x, y, w, h|
- state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true
+ state.world.each do |rect|
+ state.world_lookup[rect.id] = rect
end
# Assigns collision rects for every sprite drawn
state.world_collision_rects =
state.world_lookup
.keys
- .map do |x, y, w, h|
+ .map do |key|
+ rect = state.world_lookup[key]
s = state.tile_size
- w ||= s
- h ||= s
+ rect.w ||= s
+ rect.h ||= s
{
- args: [x, y, w, h],
- left_right: [x, y + 4, w, h - 6],
- top: [x + 4, y + 6, w - 8, h - 6],
- bottom: [x + 1, y - 1, w - 2, h - 8],
+ args: rect,
+ left_right: { x: rect.x, y: rect.y + 4, w: rect.w, h: rect.h - 6 },
+ top: { x: rect.x + 4, y: rect.y + 6, w: rect.w - 8, h: rect.h - 6 },
+ bottom: { x: rect.x + 1, y: rect.y - 1, w: rect.w - 2, h: rect.h - 8 },
}
end
@@ -29285,12 +30032,21 @@ Follows is a source code listing for all files that have been open sourced. This
def end_of_tongue
p = state.tongue_angle.vector(state.tongue_length)
- [start_of_tongue.x + p.x, start_of_tongue.y + p.y]
+ { x: start_of_tongue.x + p.x, y: start_of_tongue.y + p.y }
end
def calc_shooting
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ calc_shooting_increment
+ end
+
+ def calc_shooting_increment
return unless state.action == :shooting
- state.tongue_length += 30
+ state.tongue_length += 5
potential_anchor = end_of_tongue
if potential_anchor.x <= 0
state.anchor_point = potential_anchor
@@ -29309,9 +30065,9 @@ Follows is a source code listing for all files that have been open sourced. This
state.action = :anchored
outputs.sounds << 'sounds/attached.wav'
else
- anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]
+ anchor_rect = { x: potential_anchor.x - 5, y: potential_anchor.y - 5, w: 10, h: 10 }
collision = state.world_collision_rects.find_all do |v|
- [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)
+ v[:args].intersect_rect?(anchor_rect)
end.first
if collision
state.anchor_point = potential_anchor
@@ -29407,7 +30163,7 @@ Follows is a source code listing for all files that have been open sourced. This
.first
return unless left_side_collisions
- state.x = left_side_collisions[:left_right].right
+ state.x = left_side_collisions[:left_right].right + 1
state.dx = state.dy.abs * 0.8
state.collision_on_x = true
end
@@ -29422,7 +30178,7 @@ Follows is a source code listing for all files that have been open sourced. This
.first
return unless right_side_collisions
- state.x = right_side_collisions[:left_right].left - state.tile_size
+ state.x = right_side_collisions[:left_right].left - state.tile_size - 1
state.dx = state.dx.abs * 0.8 * -1
state.collision_on_x = true
end
@@ -29438,7 +30194,7 @@ Follows is a source code listing for all files that have been open sourced. This
.first
return unless ceil_collisions
- state.y = ceil_collisions[:bottom].y - state.tile_size
+ state.y = ceil_collisions[:bottom].y - state.tile_size - 1
state.dy = state.dy.abs * 0.8 * -1
state.collision_on_y = true
end
@@ -29451,13 +30207,17 @@ Follows is a source code listing for all files that have been open sourced. This
end
def export_map
- export_string = state.world.map do |x, y|
- "#{x},#{y},1"
- end
+ export_string = "$collisions = [\n"
+ export_string += state.world.map do |rect|
+ "[#{rect.x},#{rect.y},#{rect.w},#{rect.h}],"
+ end.join "\n"
+ export_string += "\n]\n\n"
+ export_string += "$mugs = [\n"
export_string += state.objects.map do |x, y, w, h, path|
- "#{x},#{y},2,#{w},#{h},#{path}"
- end
- gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))
+ "[#{x},#{y},#{w},#{h},'#{path}'],"
+ end.join "\n"
+ export_string += "\n]\n\n"
+ gtk.write_file(MAP_FILE_PATH, export_string)
state.map_saved_at = state.tick_count
end
@@ -30585,6 +31345,11 @@ Follows is a source code listing for all files that have been open sourced. This
[4459, 3997, 64, 64],
[76, 5215, 64, 64],
[39, 5217, 64, 64],
+ [0, 0, 10000, 40],
+ [0, 1670, 3250, 60],
+ [6691, 1653, 3290, 60],
+ [1521, 3792, 7370, 60],
+ [0, 5137, 3290, 60]
]
$mugs = [
@@ -31440,6 +32205,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
def load_lines file
+ return unless state.snaps
data = gtk.read_file(file) || ""
data.each_line
.reject { |l| l.strip.length == 0 }
@@ -31498,10 +32264,10 @@ Follows is a source code listing for all files that have been open sourced. This
results[:point] = { x: x, y: y }
results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 }
results[:trajectory] = trajectory(results)
- results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|
+ results[:impacts] = terrain.find_all { |t| t && (line_near_rect? results[:rect], t) }.map do |t|
{
terrain: t,
- point: geometry.line_intersect(results[:trajectory], t),
+ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),
type: :terrain
}
end.reject { |t| !point_within_line? t[:point], t[:terrain] }
@@ -31509,10 +32275,10 @@ Follows is a source code listing for all files that have been open sourced. This
results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t|
{
terrain: t,
- point: geometry.line_intersect(results[:trajectory], t),
+ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),
type: :lava
}
- end.reject { |t| !point_within_line? t[:point], t[:terrain] }
+ end.reject { |t| !t || (!point_within_line? t[:point], t[:terrain]) }
results
end
@@ -31525,6 +32291,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
def calc_terrains_to_monitor
+ return unless circle.impacts
circle.impact = nil
circle.impacts.each do |i|
circle.terrains_to_monitor[i[:terrain]] ||= {
@@ -37074,6 +37841,151 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Rpg Topdown - Topdown Casino - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_rpg_topdown/topdown_casino/app/main.rb
+ $gtk.reset
+
+ def coinflip
+ rand < 0.5
+ end
+
+ class Game
+ attr_accessor :args
+
+ def text_font
+ return nil #"rpg.ttf"
+ end
+
+ def text_color
+ [ 255, 255, 255, 255 ]
+ end
+
+ def set_gem_values
+ @args.state.gem0 = ((coinflip) ? 100 : 20)
+ @args.state.gem1 = ((coinflip) ? -10 : -50)
+ @args.state.gem2 = ((coinflip) ? -10 : -30)
+ if coinflip
+ tmp = @args.state.gem0
+ @args.state.gem0 = @args.state.gem1
+ @args.state.gem1 = tmp
+ end
+ if coinflip
+ tmp = @args.state.gem1
+ @args.state.gem1 = @args.state.gem2
+ @args.state.gem2 = tmp
+ end
+ if coinflip
+ tmp = @args.state.gem0
+ @args.state.gem0 = @args.state.gem2
+ @args.state.gem2 = tmp
+ end
+ end
+
+ def initialize args
+ @args = args
+ @args.state.animticks = 0
+ @args.state.score = 0
+ @args.state.gem_chosen = false
+ @args.state.round_finished = false
+ @args.state.gem0_x = 197
+ @args.state.gem0_y = 720-274
+ @args.state.gem1_x = 623
+ @args.state.gem1_y = 720-274
+ @args.state.gem2_x = 1049
+ @args.state.gem2_y = 720-274
+ @args.state.hero_sprite = "sprites/herodown100.png"
+ @args.state.hero_x = 608
+ @args.state.hero_y = 720-656
+ set_gem_values
+ end
+
+ def render_gem_value x, y, gem
+ if @args.state.gem_chosen
+ @args.outputs.labels << [ x, y + 96, gem.to_s, 1, 1, *text_color, text_font ]
+ end
+ end
+
+ def render
+ gemsprite = ((@args.state.animticks % 400) < 200) ? 'sprites/gem200.png' : 'sprites/gem400.png'
+ @args.outputs.background_color = [ 0, 0, 0, 255 ]
+ @args.outputs.sprites << [608, 720-150, 64, 64, 'sprites/oldman.png']
+ @args.outputs.sprites << [300, 720-150, 64, 64, 'sprites/fire.png']
+ @args.outputs.sprites << [900, 720-150, 64, 64, 'sprites/fire.png']
+ @args.outputs.sprites << [@args.state.gem0_x, @args.state.gem0_y, 32, 64, gemsprite]
+ @args.outputs.sprites << [@args.state.gem1_x, @args.state.gem1_y, 32, 64, gemsprite]
+ @args.outputs.sprites << [@args.state.gem2_x, @args.state.gem2_y, 32, 64, gemsprite]
+ @args.outputs.sprites << [@args.state.hero_x, @args.state.hero_y, 64, 64, @args.state.hero_sprite]
+
+ @args.outputs.labels << [ 630, 720-30, "IT'S A SECRET TO EVERYONE.", 1, 1, *text_color, text_font ]
+ @args.outputs.labels << [ 50, 720-85, @args.state.score.to_s, 1, 1, *text_color, text_font ]
+ render_gem_value @args.state.gem0_x, @args.state.gem0_y, @args.state.gem0
+ render_gem_value @args.state.gem1_x, @args.state.gem1_y, @args.state.gem1
+ render_gem_value @args.state.gem2_x, @args.state.gem2_y, @args.state.gem2
+ end
+
+ def calc
+ @args.state.animticks += 16
+
+ return unless @args.state.gem_chosen
+ @args.state.round_finished_debounce ||= 60 * 3
+ @args.state.round_finished_debounce -= 1
+ return if @args.state.round_finished_debounce > 0
+
+ @args.state.gem_chosen = false
+ @args.state.hero.sprite[0] = 'sprites/herodown100.png'
+ @args.state.hero.sprite[1] = 608
+ @args.state.hero.sprite[2] = 656
+ @args.state.round_finished_debounce = nil
+ set_gem_values
+ end
+
+ def walk xdir, ydir, anim
+ @args.state.hero_sprite = "sprites/#{anim}#{(((@args.state.animticks % 200) < 100) ? '100' : '200')}.png"
+ @args.state.hero_x += 5 * xdir
+ @args.state.hero_y += 5 * ydir
+ end
+
+ def check_gem_touching gem_x, gem_y, gem
+ return if @args.state.gem_chosen
+ herorect = [ @args.state.hero_x, @args.state.hero_y, 64, 64 ]
+ return if !herorect.intersect_rect?([gem_x, gem_y, 32, 64])
+ @args.state.gem_chosen = true
+ @args.state.score += gem
+ @args.outputs.sounds << ((gem < 0) ? 'sounds/lose.wav' : 'sounds/win.wav')
+ end
+
+ def input
+ if @args.inputs.keyboard.key_held.left
+ walk(-1.0, 0.0, 'heroleft')
+ elsif @args.inputs.keyboard.key_held.right
+ walk(1.0, 0.0, 'heroright')
+ elsif @args.inputs.keyboard.key_held.up
+ walk(0.0, 1.0, 'heroup')
+ elsif @args.inputs.keyboard.key_held.down
+ walk(0.0, -1.0, 'herodown')
+ end
+
+ check_gem_touching(@args.state.gem0_x, @args.state.gem0_y, @args.state.gem0)
+ check_gem_touching(@args.state.gem1_x, @args.state.gem1_y, @args.state.gem1)
+ check_gem_touching(@args.state.gem2_x, @args.state.gem2_y, @args.state.gem2)
+ end
+
+ def tick
+ input
+ calc
+ render
+ end
+ end
+
+ def tick args
+ args.state.game ||= Game.new args
+ args.state.game.args = args
+ args.state.game.tick
+ end
+
+#+end_src
+
*** Rpg Topdown - Topdown Starting Point - main.rb
#+begin_src ruby
# ./samples/99_genre_rpg_topdown/topdown_starting_point/app/main.rb
@@ -37188,6 +38100,189 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Teenytiny - Teenytiny Starting Point - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_teenytiny/teenytiny_starting_point/app/main.rb
+ # full documenation is at http://docs.dragonruby.org
+ # be sure to come to the discord if you hit any snags: http://discord.dragonruby.org
+ def tick args
+ # ====================================================
+ # initialize default variables
+ # ====================================================
+
+ # ruby has an operator called ||= which means "only initialize this if it's nil"
+ args.state.count_down ||= 20 * 60 # set the count down to 20 seconds
+ # set the initial position of the target
+ args.state.target ||= { x: args.grid.w.half,
+ y: args.grid.h.half,
+ w: 20,
+ h: 20 }
+
+ # set the initial position of the player
+ args.state.player ||= { x: 50,
+ y: 50,
+ w: 20,
+ h: 20 }
+
+ # set the player movement speed
+ args.state.player_speed ||= 5
+
+ # set the score
+ args.state.score ||= 0
+ args.state.teleports ||= 3
+
+ # set the instructions
+ args.state.instructions ||= "Get to the red goal! Use arrow keys to move. Spacebar to teleport (use them carefully)!"
+
+ # ====================================================
+ # render the game
+ # ====================================================
+ args.outputs.labels << { x: args.grid.w.half, y: args.grid.h - 10,
+ text: args.state.instructions,
+ alignment_enum: 1 }
+
+ # check if it's game over. if so, then render game over
+ # otherwise render the current time left
+ if game_over? args
+ args.outputs.labels << { x: args.grid.w.half,
+ y: args.grid.h - 40,
+ text: "game over! (press r to start over)",
+ alignment_enum: 1 }
+ else
+ args.outputs.labels << { x: args.grid.w.half,
+ y: args.grid.h - 40,
+ text: "time left: #{(args.state.count_down.idiv 60) + 1}",
+ alignment_enum: 1 }
+ end
+
+ # render the score
+ args.outputs.labels << { x: args.grid.w.half,
+ y: args.grid.h - 70,
+ text: "score: #{args.state.score}",
+ alignment_enum: 1 }
+
+ # render the player with teleport count
+ args.outputs.sprites << { x: args.state.player.x,
+ y: args.state.player.y,
+ w: args.state.player.w,
+ h: args.state.player.h,
+ path: 'sprites/square-green.png' }
+
+ args.outputs.labels << { x: args.state.player.x + 10,
+ y: args.state.player.y + 40,
+ text: "teleports: #{args.state.teleports}",
+ alignment_enum: 1, size_enum: -2 }
+
+ # render the target
+ args.outputs.sprites << { x: args.state.target.x,
+ y: args.state.target.y,
+ w: args.state.target.w,
+ h: args.state.target.h,
+ path: 'sprites/square-red.png' }
+
+ # ====================================================
+ # run simulation
+ # ====================================================
+
+ # count down calculation
+ args.state.count_down -= 1
+ args.state.count_down = -1 if args.state.count_down < -1
+
+ # ====================================================
+ # process player input
+ # ====================================================
+ # if it isn't game over let them move
+ if !game_over? args
+ dir_y = 0
+ dir_x = 0
+
+ # determine the change horizontally
+ if args.inputs.keyboard.up
+ dir_y += args.state.player_speed
+ elsif args.inputs.keyboard.down
+ dir_y -= args.state.player_speed
+ end
+
+ # determine the change vertically
+ if args.inputs.keyboard.left
+ dir_x -= args.state.player_speed
+ elsif args.inputs.keyboard.right
+ dir_x += args.state.player_speed
+ end
+
+ # determine if teleport can be used
+ if args.inputs.keyboard.key_down.space && args.state.teleports > 0
+ args.state.teleports -= 1
+ dir_x *= 20
+ dir_y *= 20
+ end
+
+ # apply change to player
+ args.state.player.x += dir_x
+ args.state.player.y += dir_y
+ else
+ # if r is pressed, reset the game
+ if args.inputs.keyboard.key_down.r
+ $gtk.reset
+ return
+ end
+ end
+
+ # ====================================================
+ # determine score
+ # ====================================================
+
+ # calculate new score if the player is at goal
+ if !game_over? args
+
+ # if the player is at the goal, then move the goal
+ if args.state.player.intersect_rect? args.state.target
+ # increment the goal
+ args.state.score += 1
+
+ # move the goal to a random location
+ args.state.target = { x: (rand args.grid.w), y: (rand args.grid.h), w: 20, h: 20 }
+
+ # make sure the goal is inside the view area
+ if args.state.target.x < 0
+ args.state.target.x += 20
+ elsif args.state.target.x > 1280
+ args.state.target.x -= 20
+ end
+
+ # make sure the goal is inside the view area
+ if args.state.target.y < 0
+ args.state.target.y += 20
+ elsif args.state.target.y > 720
+ args.state.target.y -= 20
+ end
+ end
+ end
+ end
+
+ def game_over? args
+ args.state.count_down < 0
+ end
+
+ $gtk.reset
+
+#+end_src
+
+*** Teenytiny - Teenytiny Starting Point - license.txt
+#+begin_src ruby
+ # ./samples/99_genre_teenytiny/teenytiny_starting_point/license.txt
+ Copyright 2019 DragonRuby LLC
+
+ MIT License
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#+end_src
+
** OSS
Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].
*** args.rb
@@ -37205,6 +38300,7 @@ Follows is a source code listing for all files that have been open sourced. This
class Args
include ArgsDeprecated
include Serialize
+ attr_accessor :cvars
attr_accessor :inputs
attr_accessor :outputs
attr_accessor :audio
@@ -37225,6 +38321,7 @@ Follows is a source code listing for all files that have been open sourced. This
def initialize runtime, recording
@inputs = Inputs.new
@outputs = Outputs.new args: self
+ @cvars = {}
@audio = {}
@passes = []
@state = OpenEntity.new
@@ -37395,6 +38492,23 @@ Follows is a source code listing for all files that have been open sourced. This
def autocomplete_methods
[:inputs, :outputs, :gtk, :state, :geometry, :audio, :grid, :layout, :fn]
end
+
+ def method_missing name, *args, &block
+ if (args.length <= 1) && (@state.as_hash.key? name)
+ raise <<-S
+ * ERROR - :#{name} method missing on ~#{self.class.name}~.
+ The method
+ :#{name}
+ with args
+ #{args}
+ doesn't exist on #{inspect}.
+ ** POSSIBLE SOLUTION - ~args.state.#{name}~ exists.
+ Did you forget ~.state~ before ~.#{name}~?
+ S
+ end
+
+ super
+ end
end
end
@@ -37690,14 +38804,17 @@ Follows is a source code listing for all files that have been open sourced. This
class Console
include ConsoleDeprecated
- attr_accessor :show_reason, :log, :logo, :background_color,
- :text_color, :animation_duration,
+ attr_accessor :show_reason, :log, :logo,
+ :animation_duration,
:max_log_lines, :max_history, :log,
- :last_command_errored, :last_command, :error_color, :shown_at,
- :header_color, :archived_log, :last_log_lines, :last_log_lines_count,
+ :last_command_errored, :last_command, :shown_at,
+ :archived_log, :last_log_lines, :last_log_lines_count,
:suppress_left_arrow_behavior, :command_set_at,
:toast_ids, :bottom,
- :font_style, :menu
+ :font_style, :menu,
+ :background_color, :spam_color, :text_color, :warn_color,
+ :error_color, :header_color, :code_color, :comment_color,
+ :debug_color, :unfiltered_color
def initialize
@font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)
@@ -37715,15 +38832,22 @@ Follows is a source code listing for all files that have been open sourced. This
@command_history_index = -1
@nonhistory_input = ''
@logo = 'console-logo.png'
- @history_fname = 'console_history.txt'
+ @history_fname = 'logs/console_history.txt'
@background_color = Color.new [0, 0, 0, 224]
- @text_color = Color.new [255, 255, 255]
- @error_color = Color.new [200, 50, 50]
@header_color = Color.new [100, 200, 220]
@code_color = Color.new [210, 168, 255]
- @comment_color = Color.new [0, 200, 100]
+ @comment_color = Color.new [0, 200, 100]
@animation_duration = 1.seconds
@shown_at = -1
+
+ # these are the colors for text at various log levels.
+ @spam_color = Color.new [160, 160, 160]
+ @debug_color = Color.new [0, 255, 0]
+ @text_color = Color.new [255, 255, 255]
+ @warn_color = Color.new [255, 255, 0]
+ @error_color = Color.new [200, 50, 50]
+ @unfiltered_color = Color.new [0, 255, 255]
+
load_history
end
@@ -37789,7 +38913,13 @@ Follows is a source code listing for all files that have been open sourced. This
nil
end
- def add_text obj
+ def add_text obj, loglevel=-1
+ # loglevel is one of the values of LogLevel in logging.h, or -1 to say "we don't care, colorize it with your special string parsing magic"
+ loglevel = -1 if loglevel < 0
+ loglevel = 5 if loglevel > 5 # 5 == unfiltered (it's 0x7FFFFFFE in C, clamp it down)
+ loglevel = 2 if (loglevel == -1) && obj.start_with?('!c!') # oh well
+ colorstr = (loglevel != -1) ? "!c!#{loglevel}" : nil
+
@last_log_lines_count ||= 1
@log_invocation_count += 1
@@ -37798,12 +38928,18 @@ Follows is a source code listing for all files that have been open sourced. This
log_lines = []
str.each_line do |s|
- s.wrapped_lines(self.console_text_width).each do |l|
- log_lines << l
+ if colorstr.nil?
+ s.wrapped_lines(self.console_text_width).each do |l|
+ log_lines << l
+ end
+ else
+ s.wrapped_lines(self.console_text_width).each do |l|
+ log_lines << "#{colorstr}#{l}"
+ end
end
end
- if log_lines == @last_log_lines
+ if log_lines == @last_log_lines && log_lines.length != 0
@last_log_lines_count += 1
new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})"
if log_lines.length > 1
@@ -38078,10 +39214,12 @@ Follows is a source code listing for all files that have been open sourced. This
def mouse_wheel_scroll args
@inertia ||= 0
- if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0
- @inertia = 1
- elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0
- @inertia = -1
+ if args.inputs.mouse.wheel
+ if args.inputs.mouse.wheel.y > 0
+ @inertia = 1
+ elsif args.inputs.mouse.wheel.y < 0
+ @inertia = -1
+ end
end
if args.inputs.mouse.click
@@ -38090,13 +39228,11 @@ Follows is a source code listing for all files that have been open sourced. This
return if @inertia == 0
- if @inertia != 0
- @inertia = (@inertia * 0.7)
- if @inertia > 0
- @log_offset -= 1
- elsif @inertia < 0
- @log_offset += 1
- end
+ @inertia = (@inertia * 0.7)
+ if @inertia > 0
+ @log_offset += 1
+ elsif @inertia < 0
+ @log_offset -= 1
end
if @inertia.abs < 0.01
@@ -38114,6 +39250,7 @@ Follows is a source code listing for all files that have been open sourced. This
if console_toggle_key_down? args
args.inputs.text.clear
toggle
+ args.inputs.keyboard.clear if !@visible
end
return unless visible?
@@ -38125,7 +39262,16 @@ Follows is a source code listing for all files that have been open sourced. This
@log_offset = 0 if @log_offset < 0
if args.inputs.keyboard.key_down.enter
- eval_the_set_command
+ if slide_progress > 0.5
+ # in the event of an exception, the console window pops up
+ # and is pre-filled with $gtk.reset.
+ # there is an annoying scenario where the exception could be thrown
+ # by pressing enter (while playing the game). if you press enter again
+ # quickly, then the game is reset which closes the console.
+ # so enter in the console is only evaluated if the slide_progress
+ # is atleast half way down the page.
+ eval_the_set_command
+ end
elsif args.inputs.keyboard.key_down.v
if args.inputs.keyboard.key_down.control || args.inputs.keyboard.key_down.meta
prompt << $gtk.ffi_misc.getclipboard
@@ -38202,7 +39348,7 @@ Follows is a source code listing for all files that have been open sourced. This
def write_line(args, left, y, str, archived: false)
color = color_for_log_entry(str)
color = color.mult_alpha(0.5) if archived
-
+ str = str[4..-1] if str.start_with?('!c!') # chop off loglevel color
args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color)
end
@@ -38438,7 +39584,9 @@ Follows is a source code listing for all files that have been open sourced. This
return false
end
- def color_for_log_entry(log_entry)
+ def color_for_plain_text log_entry
+ log_entry = log_entry[4..-1] if log_entry.start_with? "!c!"
+
if code? log_entry
@code_color
elsif code_comment? log_entry
@@ -38458,6 +39606,29 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
+ def color_for_log_entry(log_entry)
+ if log_entry.start_with?('!c!') # loglevel color specified.
+ return case log_entry[3..3].to_i
+ when 0 # spam
+ @spam_color
+ when 1 # debug
+ @debug_color
+ #when 2 # info (caught by the `else` block.)
+ # @text_color
+ when 3 # warn
+ @warn_color
+ when 4 # error
+ @error_color
+ when 5 # unfiltered
+ @unfiltered_color
+ else
+ color_for_plain_text log_entry
+ end
+ end
+
+ return color_for_plain_text log_entry
+ end
+
def prompt
@prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width)
end
@@ -38909,11 +40080,11 @@ Follows is a source code listing for all files that have been open sourced. This
# partition the original list of items into a string to be printed
items.each_slice(columns).each_with_index do |cells, i|
- pretty_print_row_seperator string_width, cell_width, column_width, columns
+ pretty_print_row_separator string_width, cell_width, column_width, columns
pretty_print_row cells, string_width, cell_width, column_width, columns
end
- pretty_print_row_seperator string_width, cell_width, column_width, columns
+ pretty_print_row_separator string_width, cell_width, column_width, columns
end
end
@@ -39750,8 +40921,8 @@ Follows is a source code listing for all files that have been open sourced. This
ease_extended start_tick,
current_tick,
start_tick + duration,
- (initial_value *definitions),
- (final_value *definitions),
+ initial_value(*definitions),
+ final_value(*definitions),
*definitions
end
@@ -39946,8 +41117,8 @@ Follows is a source code listing for all files that have been open sourced. This
module GTK
module Geometry
def self.rotate_point point, angle, around = nil
- s = Math.sin a.to_radians
- c = Math.cos a.to_radians
+ s = Math.sin angle.to_radians
+ c = Math.cos angle.to_radians
px = point.x
py = point.y
cx = 0
@@ -40128,8 +41299,16 @@ Follows is a source code listing for all files that have been open sourced. This
end
# @gtk
- def self.line_y_intercept line
- line.y - line_slope(line) * line.x
+ def self.line_y_intercept line, replace_infinity: nil
+ line.y - line_slope(line, replace_infinity: replace_infinity) * line.x
+ rescue Exception => e
+ raise <<-S
+ * ERROR: ~Geometry::line_y_intercept~
+ The following exception was thrown for line: #{line}
+ #{e}
+
+ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.
+ S
end
# @gtk
@@ -40205,14 +41384,22 @@ Follows is a source code listing for all files that have been open sourced. This
end
# @gtk
- def self.line_intersect line_one, line_two
- m1 = line_slope(line_one)
- m2 = line_slope(line_two)
- b1 = line_y_intercept(line_one)
- b2 = line_y_intercept(line_two)
+ def self.line_intersect line_one, line_two, replace_infinity: nil
+ m1 = line_slope(line_one, replace_infinity: replace_infinity)
+ m2 = line_slope(line_two, replace_infinity: replace_infinity)
+ b1 = line_y_intercept(line_one, replace_infinity: replace_infinity)
+ b2 = line_y_intercept(line_two, replace_infinity: replace_infinity)
x = (b1 - b2) / (m2 - m1)
y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2))
[x, y]
+ rescue Exception => e
+ raise <<-S
+ * ERROR: ~Geometry::line_intersect~
+ The following exception was thrown for line_one: #{line_one}, line_two: #{line_two}
+ #{e}
+
+ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.
+ S
end
def self.contract_intersect_rect?
@@ -40897,7 +42084,8 @@ Follows is a source code listing for all files that have been open sourced. This
value = Kernel.tick_count if value
collection.each do |m|
- self.instance_variable_set("@#{m.to_s}".to_sym, value)
+ m_to_s = m.to_s
+ self.instance_variable_set("@#{m_to_s}".to_sym, value) if m_to_s.strip.length > 0
rescue Exception => e
raise e, <<-S
* ERROR:
@@ -41441,6 +42629,7 @@ Follows is a source code listing for all files that have been open sourced. This
:check_for_dev_profile,
*app_metadata_retrieval_steps,
+ :determine_devcert,
:clear_tmp_directory,
:stage_app,
@@ -41469,6 +42658,7 @@ Follows is a source code listing for all files that have been open sourced. This
:determine_app_version,
*app_metadata_retrieval_steps,
+ :determine_prodcert,
:clear_tmp_directory,
:stage_app,
@@ -41663,6 +42853,10 @@ Follows is a source code listing for all files that have been open sourced. This
appid=
# appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.
appname=
+ # devcert is the certificate to use for development/deploying to your local device
+ devcert=
+ # prodcert is the certificate to use for distribution to the app store
+ prodcert=
S
end
@@ -41698,7 +42892,7 @@ Follows is a source code listing for all files that have been open sourced. This
def raise_ios_metadata_required
raise WizardException.new(
"* mygame/metadata/ios_metadata.txt needs to be filled out.",
- "You need to update metadata/ios_metadata.txt with a valid teamid, appname, and appid.",
+ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, appid, devcert, and prodcert.",
"Instructions for where the values should come from are within metadata/ios_metadata.txt."
)
end
@@ -41738,7 +42932,19 @@ Follows is a source code listing for all files that have been open sourced. This
def determine_app_id
@app_id = ios_metadata.appid
raise_ios_metadata_required if @app_id.strip.length == 0
- log_info "App Identifier is set to : #{@app_id}"
+ log_info "App Identifier is set to: #{@app_id}"
+ end
+
+ def determine_devcert
+ @certificate_name = ios_metadata.devcert
+ raise_ios_metadata_required if @certificate_name.strip.length == 0
+ log_info "Dev Certificate is set to: #{@certificate_name}"
+ end
+
+ def determine_prodcert
+ @certificate_name = ios_metadata.prodcert
+ raise_ios_metadata_required if @certificate_name.strip.length == 0
+ log_info "Production (Distribution) Certificate is set to: #{@certificate_name}"
end
def set_app_name name
@@ -41760,12 +42966,6 @@ Follows is a source code listing for all files that have been open sourced. This
sh "rm -rf #{tmp_directory}"
end
- def stage_app
- log_info "Staging."
- sh "mkdir -p #{tmp_directory}"
- sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""
- end
-
def set_app_id id
log_info = "App Id set to: #{id}"
@app_id = id
@@ -41796,34 +42996,13 @@ Follows is a source code listing for all files that have been open sourced. This
def check_for_certs
log_info "Attempting to find certificates on your computer."
- if !cli_app_exist?(security_cli_app)
- raise WizardException.new(
- "* It doesn't look like you have #{security_cli_app}.",
- "** 1. Open Disk Utility and run First Aid.",
- { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },
- )
- end
-
- if valid_certs.length == 0
- raise WizardException.new(
- "* It doesn't look like you have any valid certs installed.",
- "** 1. Open Xcode.",
- "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",
- { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },
- "** 3. After loggin in, select Manage Certificates...",
- { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },
- "** 4. Add a certificate for Apple Development.",
- { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },
- )
- raise "You do not have any Apple development certs on this computer."
- end
-
if @production_build
- @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]
+ @certificate_name = ios_metadata[:prodcert]
else
- @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]
+ @certificate_name = ios_metadata[:devcert]
end
- log_info "I will be using Certificate: '#{@certificate_name}'."
+
+ log_info "I will be using certificate: '#{@certificate_name}'."
end
def idevice_id_cli_app
@@ -41838,24 +43017,6 @@ Follows is a source code listing for all files that have been open sourced. This
"xcodebuild"
end
- def valid_certs
- certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|
- if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))
- l.strip
- else
- nil
- end
- end.reject_nil.map do |l|
- number, id, name = l.split(' ', 3)
- name = name.gsub("\"", "") if name
- {
- number: 1,
- id: id,
- name: name
- }
- end
- end
-
def connected_devices
sh("idevice_id -l").strip.each_line.map do |l|
l.strip
@@ -42385,6 +43546,9 @@ Follows is a source code listing for all files that have been open sourced. This
end
def stage_app
+ log_info "Staging."
+ sh "mkdir -p #{tmp_directory}"
+ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""
sh %Q[cp -r "#{root_folder}/app/" "#{app_path}/app/"]
sh %Q[cp -r "#{root_folder}/sounds/" "#{app_path}/sounds/"]
sh %Q[cp -r "#{root_folder}/sprites/" "#{app_path}/sprites/"]
@@ -44222,26 +45386,6 @@ Follows is a source code listing for all files that have been open sourced. This
(0..self).to_a
end
- def >= other
- return false if !other
- return gte other
- end
-
- def > other
- return false if !other
- return gt other
- end
-
- def <= other
- return false if !other
- return lte other
- end
-
- def < other
- return false if !other
- return gt other
- end
-
# @gtk
def map
unless block_given?
@@ -44327,34 +45471,6 @@ Follows is a source code listing for all files that have been open sourced. This
S
end
- def - other
- return self unless other
- self - other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :-, e
- end
-
- def + other
- return self unless other
- self + other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :+, e
- end
-
- def * other
- return self unless other
- self * other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :*, e
- end
-
- def / other
- return self unless other
- self / other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :/, e
- end
-
def serialize
self
end
@@ -44409,34 +45525,6 @@ Follows is a source code listing for all files that have been open sourced. This
return !even?
end
- def + other
- return self unless other
- self + other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :+, e
- end
-
- def * other
- return self unless other
- self * other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :*, e
- end
-
- def / other
- return self unless other
- self / other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :/, e
- end
-
- def - other
- return self unless other
- self - other
- rescue Exception => e
- __raise_arithmetic_exception__ other, :-, e
- end
-
# Returns `-1` if the number is less than `0`. `+1` if the number
# is greater than `0`. Returns `0` if the number is equal to `0`.
#
@@ -44492,34 +45580,6 @@ Follows is a source code listing for all files that have been open sourced. This
alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__
alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__
- def - other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :-, e
- end
-
- def + other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :+, e
- end
-
- def * other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :*, e
- end
-
- def / other
- return self unless other
- super
- rescue Exception => e
- __raise_arithmetic_exception__ other, :/, e
- end
-
def serialize
self
end
@@ -44569,6 +45629,272 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** recording.rb
+#+begin_src ruby
+ # ./dragon/recording.rb
+ # coding: utf-8
+ # Copyright 2019 DragonRuby LLC
+ # MIT License
+ # recording.rb has been released under MIT (*only this file*).
+
+ module GTK
+ # FIXME: Gross
+ # @gtk
+ class Replay
+ # @gtk
+ def self.start file_name = nil
+ $recording.start_replay file_name
+ end
+
+ # @gtk
+ def self.stop
+ $recording.stop_replay
+ end
+ end
+
+ # @gtk
+ class Recording
+ def initialize runtime
+ @runtime = runtime
+ @tick_count = 0
+ @global_input_order = 1
+ end
+
+ def tick
+ @tick_count += 1
+ end
+
+ def start_recording seed_number = nil
+ if !seed_number
+ log <<-S
+ * ERROR:
+ To start recording, you must provide an integer value to
+ seed random number generation.
+ S
+ $console.set_command "$recording.start SEED_NUMBER"
+ return
+ end
+
+ if @is_recording
+ log <<-S
+ * ERROR:
+ You are already recording, first cancel (or stop) the current recording.
+ S
+ $console.set_command "$recording.cancel"
+ return
+ end
+
+ if @is_replaying
+ log <<-S
+ * ERROR:
+ You are currently replaying a recording, first stop the replay.
+ S
+ return
+ end
+
+ log_info <<-S
+ Recording has begun with RNG seed value set to #{seed_number}.
+ To stop recording use stop_recording(filename).
+ The recording will stop without saving a file if a filename is nil.
+ S
+
+ $console.set_command "$recording.stop 'replay.txt'"
+ @runtime.__reset__
+ @seed_number = seed_number
+ @runtime.set_rng seed_number
+
+ @tick_count = 0
+ @global_input_order = 1
+ @is_recording = true
+ @input_history = []
+ @runtime.notify! "Recording started. When completed, open the console to save it using $recording.stop FILE_NAME (or cancel).", 300
+ end
+
+ # @gtk
+ def start seed_number = nil
+ start_recording seed_number
+ end
+
+ def is_replaying?
+ @is_replaying
+ end
+
+ def is_recording?
+ @is_recording
+ end
+
+ # @gtk
+ def stop file_name = nil
+ stop_recording file_name
+ end
+
+ # @gtk
+ def cancel
+ stop_recording_core
+ @runtime.notify! "Recording cancelled."
+ end
+
+ def stop_recording file_name = nil
+ if !file_name
+ log <<-S
+ * ERROR:
+ To please specify a file name when calling:
+ $recording.stop FILE_NAME
+
+ If you do NOT want to save the recording, call:
+ $recording.cancel
+ S
+ $console.set_command "$recording.stop 'replay.txt'"
+ return
+ end
+
+ if !@is_recording
+ log_info "You are not currently recording. Use start_recording(seed_number) to start recording."
+ $console.set_command "$recording.start"
+ return
+ end
+
+ if file_name
+ text = "replay_version 2.0\n"
+ text << "stopped_at #{@tick_count}\n"
+ text << "seed #{@seed_number}\n"
+ text << "recorded_at #{Time.now.to_s}\n"
+ @input_history.each do |items|
+ text << "#{items}\n"
+ end
+ @runtime.write_file file_name, text
+ @runtime.write_file 'last_replay.txt', text
+ log_info "The recording has been saved successfully at #{file_name}. You can use start_replay(\"#{file_name}\") to replay the recording."
+ end
+
+ $console.set_command "$replay.start '#{file_name}'"
+ stop_recording_core
+ @runtime.notify! "Recording saved to #{file_name}. To replay it: $replay.start \"#{file_name}\"."
+ log_info "You can run the replay later on startup using: ./dragonruby mygame --replay #{@replay_file_name}"
+ nil
+ end
+
+ def stop_recording_core
+ @is_recording = false
+ @input_history = nil
+ @last_history = nil
+ @runtime.__reset__
+ end
+
+ def start_replay file_name = nil
+ if !file_name
+ log <<-S
+ * ERROR:
+ Please provide a file name to $recording.start.
+ S
+ $console.set_command "$replay.start 'replay.txt'"
+ return
+ end
+
+ text = @runtime.read_file file_name
+ return false unless text
+
+ if text.each_line.first.strip != "replay_version 2.0"
+ raise "The replay file #{file_name} is not compatible with this version of DragonRuby Game Toolkit. Please recreate the replay (sorry)."
+ end
+
+ @replay_file_name = file_name
+
+ $replay_data = { input_history: { } }
+ text.each_line do |l|
+ if l.strip.length == 0
+ next
+ elsif l.start_with? 'replay_version'
+ next
+ elsif l.start_with? 'seed'
+ $replay_data[:seed] = l.split(' ').last.to_i
+ elsif l.start_with? 'stopped_at'
+ $replay_data[:stopped_at] = l.split(' ').last.to_i
+ elsif l.start_with? 'recorded_at'
+ $replay_data[:recorded_at] = l.split(' ')[1..-1].join(' ')
+ elsif l.start_with? '['
+ name, value_1, value_2, value_count, id, tick_count = l.strip.gsub('[', '').gsub(']', '').split(',')
+ $replay_data[:input_history][tick_count.to_i] ||= []
+ $replay_data[:input_history][tick_count.to_i] << {
+ id: id.to_i,
+ name: name.gsub(':', '').to_sym,
+ value_1: value_1.to_f,
+ value_2: value_2.to_f,
+ value_count: value_count.to_i
+ }
+ else
+ raise "Replay data seems corrupt. I don't know how to parse #{l}."
+ end
+ end
+
+ $replay_data[:input_history].keys.each do |key|
+ $replay_data[:input_history][key] = $replay_data[:input_history][key].sort_by {|input| input[:id]}
+ end
+
+ @runtime.__reset__
+ @runtime.set_rng $replay_data[:seed]
+ @tick_count = 0
+ @is_replaying = true
+ log_info "Replay has been started."
+ @runtime.notify! "Replay started [#{@replay_file_name}]."
+ end
+
+ def stop_replay notification_message = "Replay has been stopped."
+ if !is_replaying?
+ log <<-S
+ * ERROR:
+ No replay is currently running. Call $replay.start FILE_NAME to start a replay.
+ S
+
+ $console.set_command "$replay.start 'replay.txt'"
+ return
+ end
+ log_info notification_message
+ @is_replaying = false
+ $replay_data = nil
+ @tick_count = 0
+ @global_input_order = 1
+ $console.set_command_silent "$replay.start '#{@replay_file_name}'"
+ @runtime.__reset__
+ @runtime.notify! notification_message
+ end
+
+ def record_input_history name, value_1, value_2, value_count, clear_cache = false
+ return if @is_replaying
+ return unless @is_recording
+ @input_history << [name, value_1, value_2, value_count, @global_input_order, @tick_count]
+ @global_input_order += 1
+ end
+
+ def stage_replay_values
+ return unless @is_replaying
+ return unless $replay_data
+
+ if $replay_data[:stopped_at] <= @tick_count
+ stop_replay "Replay completed [#{@replay_file_name}]. To rerun, bring up the Console and press enter."
+ return
+ end
+
+ inputs_this_tick = $replay_data[:input_history][@tick_count]
+
+ if @tick_count.zmod? 60
+ log_info "Replay ends in #{($replay_data[:stopped_at] - @tick_count).idiv 60} second(s)."
+ end
+
+ return unless inputs_this_tick
+ inputs_this_tick.each do |v|
+ args = []
+ args << v[:value_1] if v[:value_count] >= 1
+ args << v[:value_2] if v[:value_count] >= 2
+ args << :replay
+ $gtk.send v[:name], *args
+ end
+ end
+ end
+ end
+
+#+end_src
+
*** remote_hotload_client.rb
#+begin_src ruby
# ./dragon/remote_hotload_client.rb
@@ -44940,14 +46266,13 @@ Follows is a source code listing for all files that have been open sourced. This
log <<-S
** Invoking :#{name}...
S
- time_start = Time.now
idx = 0
r = nil
+ time_start = Time.now
while idx < iterations
r = proc.call
idx += 1
end
-
result = (Time.now - time_start).round 3
{ name: name,
@@ -45072,7 +46397,7 @@ Follows is a source code listing for all files that have been open sourced. This
fn.each_send pass.borders, self, :draw_border
fn.each_send pass.static_borders, self, :draw_border
- if !$gtk.production
+ if !self.production
fn.each_send pass.debug, self, :draw_primitive
fn.each_send pass.static_debug, self, :draw_primitive
end
@@ -45089,6 +46414,7 @@ Follows is a source code listing for all files that have been open sourced. This
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_solid_2 s.x, s.y, s.w, s.h,
s.r, s.g, s.b, s.a,
(s.blendmode_enum || 1)
@@ -45102,6 +46428,7 @@ Follows is a source code listing for all files that have been open sourced. This
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,
(s.path || '').to_s,
s.angle,
@@ -45121,6 +46448,7 @@ Follows is a source code listing for all files that have been open sourced. This
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_screenshot (s.path || '').to_s,
s.x, s.y, s.w, s.h,
s.angle,
@@ -45139,6 +46467,7 @@ Follows is a source code listing for all files that have been open sourced. This
if l.respond_to? :draw_override
l.draw_override @ffi_draw
else
+ l = l.as_hash if l.is_a? OpenEntity
@ffi_draw.draw_label_3 l.x, l.y,
(l.text || '').to_s,
l.size_enum, l.alignment_enum,
@@ -45156,6 +46485,7 @@ Follows is a source code listing for all files that have been open sourced. This
if l.respond_to? :draw_override
l.draw_override @ffi_draw
else
+ l = l.as_hash if l.is_a? OpenEntity
if l.x2
@ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,
l.r, l.g, l.b, l.a,
@@ -45181,6 +46511,7 @@ Follows is a source code listing for all files that have been open sourced. This
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
+ s = s.as_hash if s.is_a? OpenEntity
@ffi_draw.draw_border_2 s.x, s.y, s.w, s.h,
s.r, s.g, s.b, s.a,
(s.blendmode_enum || 1)
@@ -45248,13 +46579,8 @@ Follows is a source code listing for all files that have been open sourced. This
if @tick_speed_count > 60 * 2
if framerate_below_threshold?
@last_framerate = current_framerate
- if !@framerate_important_notification_happened
- log_important framerate_warning_message
- else
- log framerate_warning_message
- end
- @framerate_important_notification_happened = true
+ log framerate_warning_message
end
end
@@ -46130,6 +47456,114 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** tweetcart.rb
+#+begin_src ruby
+ # ./dragon/tweetcart.rb
+ # coding: utf-8
+ # Copyright 2019 DragonRuby LLC
+ # MIT License
+ # tweetcart.rb has been released under MIT (*only this file*).
+
+ def $top_level.TICK &block
+ $top_level.define_method(:tick) do |args|
+ args.outputs[:scene].w = 160
+ args.outputs[:scene].h = 90
+ args.outputs[:scene].background_color = [0, 0, 0, 0]
+ block.call args
+ args.outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :scene }
+ end
+
+ def $top_level.bg! *rgb
+ r,g,b = rgb
+ r ||= 255
+ g ||= r
+ b ||= g
+ $args.outputs.background_color = [r, g, b]
+ end
+
+ def $top_level.slds
+ $args.outputs[:scene].sprites
+ end
+
+ def $top_level.slds! *os
+ if (os.first.is_a? Numeric)
+ sld!(*os)
+ else
+ os.each { |o| sld!(*o) }
+ end
+ end
+
+ def $top_level.sld! *params
+ x, y, w, h, r, g, b, a = nil
+ if params.length == 2
+ x, y = params
+ elsif params.length == 3 && (params.last.is_a? Array)
+ x = params[0]
+ y = params[1]
+ r, g, b, a = params[2]
+ r ||= 255
+ g ||= r
+ b ||= g
+ a ||= 255
+ elsif params.length == 4
+ x, y, w, h = params
+ elsif params.length == 5 && (params.last.is_a? Array)
+ x = params[0]
+ y = params[1]
+ w = params[2]
+ h = params[3]
+ r,g,b,a = params[4]
+ r ||= 255
+ g ||= r
+ b ||= g
+ a ||= 255
+ elsif params.length >= 7
+ x, y, w, h, r, g, b = params
+ else
+ raise "I don't know how to render #{params} with reasonable defaults."
+ end
+
+ w ||= 1
+ h ||= 1
+ r ||= 255
+ g ||= 255
+ b ||= 255
+ a ||= 255
+
+ slds << { x: x, y: y,
+ w: w, h: h,
+ r: r, g: g, b: b, a: a,
+ path: :pixel }
+ end
+ end
+
+ =begin
+ wht = [255] * 3
+ red = [255, 0, 0]
+ blu = [0, 130, 255]
+ purp = [150, 80, 255]
+
+ TICK {
+ bg! 0
+
+ slds << [0, 0, 3, 3, 0, 255, 0, 255]
+
+ sld! 10, 10
+ sld! 20, 20, 3, 2
+ sld! 30, 30, 2, 2, red
+ sld! 35, 35, blu
+
+ slds! 40, 40
+
+ slds! [50, 50],
+ [60, 60, purp],
+ [70, 70, 10, 10, wht],
+ [80, 80, 4, 4, 255, 0, 255]
+ }
+ =end
+
+#+end_src
+
*** wizards.rb
#+begin_src ruby
# ./dragon/wizards.rb
diff --git a/docs/parse_log.txt b/docs/parse_log.txt
index 07e163d..047852d 100644
--- a/docs/parse_log.txt
+++ b/docs/parse_log.txt
@@ -5269,11 +5269,18 @@ Shows the mouse cursor.
*** True Line Result
*** ~.hide_cursor~
** Processing line: ~Hides the mouse cursor.~
-** Processing line: ~*** ~.cursor_shown?~~
+** Processing line: ~*** ~.set_cursor path, dx, dy~~
- Header detected.
*** True Line Result
Hides the mouse cursor.
*** True Line Result
+*** ~.set_cursor path, dx, dy~
+** Processing line: ~Sets the system cursor to a sprite ~path~ with an offset of ~dx~ and ~dy~.~
+** Processing line: ~*** ~.cursor_shown?~~
+- Header detected.
+*** True Line Result
+Sets the system cursor to a sprite ~path~ with an offset of ~dx~ and ~dy~.
+*** True Line Result
*** ~.cursor_shown?~
** Processing line: ~Returns ~true~ if the mouse cursor is shown.~
** Processing line: ~*** ~.set_window_fullscreen enabled~~
@@ -5407,6 +5414,119 @@ This function takes in two parameters. The first parameter is the file path and
- End of paragraph detected.
*** True Line Result
+** Processing line: ~* DOCS: ~GTK::Runtime#benchmark~~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+* DOCS: ~GTK::Runtime#benchmark~
+** Processing line: ~You can use this function to compare the relative performance of methods.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+You can use this function to compare the relative performance of methods.
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # press r to run benchmark~
+- Inside source: true
+*** True Line Result
+ # press r to run benchmark
+** Processing line: ~ if args.inputs.keyboard.key_down.r~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.r
+** Processing line: ~ args.gtk.console.show~
+- Inside source: true
+*** True Line Result
+ args.gtk.console.show
+** Processing line: ~ args.gtk.benchmark iterations: 1000, # number of iterations~
+- Inside source: true
+*** True Line Result
+ args.gtk.benchmark iterations: 1000, # number of iterations
+** Processing line: ~ # label for experiment~
+- Inside source: true
+*** True Line Result
+ # label for experiment
+** Processing line: ~ using_numeric_map: -> () {~
+- Inside source: true
+*** True Line Result
+ using_numeric_map: -> () {
+** Processing line: ~ # experiment body~
+- Inside source: true
+*** True Line Result
+ # experiment body
+** Processing line: ~ v = 100.map do |i|~
+- Inside source: true
+*** True Line Result
+ v = 100.map do |i|
+** Processing line: ~ i * 100~
+- Inside source: true
+*** True Line Result
+ i * 100
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ },~
+- Inside source: true
+*** True Line Result
+ },
+** Processing line: ~ # label for experiment~
+- Inside source: true
+*** True Line Result
+ # label for experiment
+** Processing line: ~ using_numeric_times: -> () {~
+- Inside source: true
+*** True Line Result
+ using_numeric_times: -> () {
+** Processing line: ~ # experiment body~
+- Inside source: true
+*** True Line Result
+ # experiment body
+** Processing line: ~ v = []~
+- Inside source: true
+*** True Line Result
+ v = []
+** Processing line: ~ 100.times do |i|~
+- Inside source: true
+*** True Line Result
+ 100.times do |i|
+** Processing line: ~ v << i * 100~
+- Inside source: true
+*** True Line Result
+ v << i * 100
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~* DOCS: ~Array~~
- Header detected.
*** True Line Result
@@ -15439,10 +15559,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# To see how many frames its been since the click occurred
-** Processing line: ~ # Use args.inputs.mouse.click.creat_at_elapsed~
+** Processing line: ~ # Use args.inputs.mouse.click.created_at_elapsed~
- Inside source: true
*** True Line Result
- # Use args.inputs.mouse.click.creat_at_elapsed
+ # Use args.inputs.mouse.click.created_at_elapsed
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -26059,18 +26179,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def calc_player_dx
-** Processing line: ~ player.y += player.dy~
+** Processing line: ~ player.dx = player.dx.clamp(-5, 5)~
- Inside source: true
*** True Line Result
- player.y += player.dy
-** Processing line: ~ player.dy += state.gravity~
+ player.dx = player.dx.clamp(-5, 5)
+** Processing line: ~ player.dx *= 0.9~
- Inside source: true
*** True Line Result
- player.dy += state.gravity
-** Processing line: ~ player.dy += player.dy * state.drag ** 2 * -1~
+ player.dx *= 0.9
+** Processing line: ~ player.x += player.dx~
- Inside source: true
*** True Line Result
- player.dy += player.dy * state.drag ** 2 * -1
+ player.x += player.dx
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -26083,18 +26203,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def calc_player_dy
-** Processing line: ~ player.dx = player.dx.clamp(-5, 5)~
+** Processing line: ~ player.y += player.dy~
- Inside source: true
*** True Line Result
- player.dx = player.dx.clamp(-5, 5)
-** Processing line: ~ player.dx *= 0.9~
+ player.y += player.dy
+** Processing line: ~ player.dy += state.gravity~
- Inside source: true
*** True Line Result
- player.dx *= 0.9
-** Processing line: ~ player.x += player.dx~
+ player.dy += state.gravity
+** Processing line: ~ player.dy += player.dy * state.drag ** 2 * -1~
- Inside source: true
*** True Line Result
- player.x += player.dx
+ player.dy += player.dy * state.drag ** 2 * -1
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -26679,14 +26799,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # Sets default values~
+** Processing line: ~ def init_game~
- Inside source: true
*** True Line Result
- # Sets default values
-** Processing line: ~ def defaults~
-- Inside source: true
-*** True Line Result
- def defaults
+ def init_game
** Processing line: ~ s.platforms ||= [ # initializes platforms collection with two platforms using hashes~
- Inside source: true
*** True Line Result
@@ -26775,6 +26891,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ # Sets default values~
+- Inside source: true
+*** True Line Result
+ # Sets default values
+** Processing line: ~ def defaults~
+- Inside source: true
+*** True Line Result
+ def defaults
+** Processing line: ~ init_game~
+- Inside source: true
+*** True Line Result
+ init_game
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ # Outputs objects onto the screen~
- Inside source: true
*** True Line Result
@@ -27123,10 +27259,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ # game over~
+- Inside source: true
+*** True Line Result
+ # game over
** Processing line: ~ s.as_hash.clear # otherwise clear the hash (no new platform is necessary)~
- Inside source: true
*** True Line Result
s.as_hash.clear # otherwise clear the hash (no new platform is necessary)
+** Processing line: ~ init_game~
+- Inside source: true
+*** True Line Result
+ init_game
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -38011,14 +38155,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def tick
-** Processing line: ~ state.current_turn ||= :x~
-- Inside source: true
-*** True Line Result
- state.current_turn ||= :x
-** Processing line: ~ state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a~
+** Processing line: ~ init_new_game~
- Inside source: true
*** True Line Result
- state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a
+ init_new_game
** Processing line: ~ render_board~
- Inside source: true
*** True Line Result
@@ -38035,6 +38175,54 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def init_new_game~
+- Inside source: true
+*** True Line Result
+ def init_new_game
+** Processing line: ~ state.current_turn ||= :x~
+- Inside source: true
+*** True Line Result
+ state.current_turn ||= :x
+** Processing line: ~ state.space_combinations ||= [-1, 0, 1].product([-1, 0, 1]).to_a~
+- Inside source: true
+*** True Line Result
+ state.space_combinations ||= [-1, 0, 1].product([-1, 0, 1]).to_a
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ state.spaces ||= {}~
+- Inside source: true
+*** True Line Result
+ state.spaces ||= {}
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ state.space_combinations.each do |x, y|~
+- Inside source: true
+*** True Line Result
+ state.space_combinations.each do |x, y|
+** Processing line: ~ state.spaces[x] ||= {}~
+- Inside source: true
+*** True Line Result
+ state.spaces[x] ||= {}
+** Processing line: ~ state.spaces[x][y] ||= state.new_entity(:space)~
+- Inside source: true
+*** True Line Result
+ state.spaces[x][y] ||= state.new_entity(:space)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.~
- Inside source: true
*** True Line Result
@@ -38335,6 +38523,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
gtk.reset
+** Processing line: ~ init_new_game~
+- Inside source: true
+*** True Line Result
+ init_new_game
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -39603,10 +39795,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Find all zombies that intersect with the player. They are considered killed.
-** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }~
+** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite && (z.sprite.intersect_rect? state.player_sprite) }~
- Inside source: true
*** True Line Result
- killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }
+ killed_this_frame = state.zombies.find_all { |z| z.sprite && (z.sprite.intersect_rect? state.player_sprite) }
** Processing line: ~ state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection~
- Inside source: true
*** True Line Result
@@ -43235,6 +43427,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def playtime_str t
+** Processing line: ~ return "" unless t~
+- Inside source: true
+*** True Line Result
+ return "" unless t
** Processing line: ~ minutes = (t / 60.0).floor~
- Inside source: true
*** True Line Result
@@ -43683,10 +43879,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
col: 2,
-** Processing line: ~ percentage: audio_entry.playtime / audio_entry.length_,~
+** Processing line: ~ percentage: (audio_entry.playtime || 1) / (audio_entry.length_ || 1),~
- Inside source: true
*** True Line Result
- percentage: audio_entry.playtime / audio_entry.length_,
+ percentage: (audio_entry.playtime || 1) / (audio_entry.length_ || 1),
** Processing line: ~ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")~
- Inside source: true
*** True Line Result
@@ -44231,10 +44427,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
{ name: :splash, path: "sounds/splash.wav" },
-** Processing line: ~ { name: :drum, path: "sounds/drum.wav" },~
+** Processing line: ~ { name: :drum, path: "sounds/drum.mp3" },~
- Inside source: true
*** True Line Result
- { name: :drum, path: "sounds/drum.wav" },
+ { name: :drum, path: "sounds/drum.mp3" },
** Processing line: ~ { name: :spring, path: "sounds/spring.wav" },~
- Inside source: true
*** True Line Result
@@ -44487,70 +44683,6 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
-** Processing line: ~*** Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt~
-- Header detected.
-*** True Line Result
-
-*** True Line Result
-*** Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt
-** Processing line: ~#+begin_src ruby~
-- Line was identified as the beginning of a code block.
-*** True Line Result
-
-*** True Line Result
-#+begin_src ruby
-** Processing line: ~ # ./samples/07_advanced_audio/01_audio_mixer/metadata/ios_metadata.txt~
-- Inside source: true
-*** True Line Result
- # ./samples/07_advanced_audio/01_audio_mixer/metadata/ios_metadata.txt
-** Processing line: ~ # ios_metadata.txt is used by the Pro version of DragonRuby Game Toolkit to create iOS apps.~
-- Inside source: true
-*** True Line Result
- # ios_metadata.txt is used by the Pro version of DragonRuby Game Toolkit to create iOS apps.
-** Processing line: ~ # Information about the Pro version can be found at: http://dragonruby.org/toolkit/game#purchase~
-- Inside source: true
-*** True Line Result
- # Information about the Pro version can be found at: http://dragonruby.org/toolkit/game#purchase
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # teamid needs to be set to your assigned Team Id which can be found at https://developer.apple.com/account/#/membership/~
-- Inside source: true
-*** True Line Result
- # teamid needs to be set to your assigned Team Id which can be found at https://developer.apple.com/account/#/membership/
-** Processing line: ~ teamid=~
-- Inside source: true
-*** True Line Result
- teamid=
-** Processing line: ~ # appid needs to be set to your application identifier which can be found at https://developer.apple.com/account/resources/identifiers/list~
-- Inside source: true
-*** True Line Result
- # appid needs to be set to your application identifier which can be found at https://developer.apple.com/account/resources/identifiers/list
-** Processing line: ~ appid=~
-- Inside source: true
-*** True Line Result
- appid=
-** Processing line: ~ # appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.~
-- Inside source: true
-*** True Line Result
- # appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.
-** Processing line: ~ appname=~
-- Inside source: true
-*** True Line Result
- appname=
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~#+end_src~
-- Line was identified as the end of a code block.
-*** True Line Result
-#+end_src
-** Processing line: ~~
-- End of paragraph detected.
-*** True Line Result
-
** Processing line: ~*** Advanced Audio - Sound Synthesis - main.rb~
- Header detected.
*** True Line Result
@@ -46951,6 +47083,542 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** Advanced Rendering - Labels With Wrapped Text - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Rendering - Labels With Wrapped Text - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/07_advanced_rendering/00_labels_with_wrapped_text/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_rendering/00_labels_with_wrapped_text/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # defaults~
+- Inside source: true
+*** True Line Result
+ # defaults
+** Processing line: ~ args.state.scroll_location ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.scroll_location ||= 0
+** Processing line: ~ args.state.textbox.messages ||= []~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.messages ||= []
+** Processing line: ~ args.state.textbox.scroll ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.scroll ||= 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # render~
+- Inside source: true
+*** True Line Result
+ # render
+** Processing line: ~ args.outputs.background_color = [0, 0, 0, 255]~
+- Inside source: true
+*** True Line Result
+ args.outputs.background_color = [0, 0, 0, 255]
+** Processing line: ~ render_messages args~
+- Inside source: true
+*** True Line Result
+ render_messages args
+** Processing line: ~ render_instructions args~
+- Inside source: true
+*** True Line Result
+ render_instructions args
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # inputs~
+- Inside source: true
+*** True Line Result
+ # inputs
+** Processing line: ~ if args.inputs.keyboard.key_down.one~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.one
+** Processing line: ~ queue_message args, "Hello there neighbour! my name is mark, how is your day today?"~
+- Inside source: true
+*** True Line Result
+ queue_message args, "Hello there neighbour! my name is mark, how is your day today?"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.keyboard.key_down.two~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.two
+** Processing line: ~ queue_message args, "I'm doing great sir, actually I'm having a picnic today"~
+- Inside source: true
+*** True Line Result
+ queue_message args, "I'm doing great sir, actually I'm having a picnic today"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.keyboard.key_down.three~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.three
+** Processing line: ~ queue_message args, "Well that sounds wonderful!"~
+- Inside source: true
+*** True Line Result
+ queue_message args, "Well that sounds wonderful!"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.keyboard.key_down.home~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.home
+** Processing line: ~ args.state.scroll_location = 1~
+- Inside source: true
+*** True Line Result
+ args.state.scroll_location = 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.keyboard.key_down.delete~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.delete
+** Processing line: ~ clear_message_queue args~
+- Inside source: true
+*** True Line Result
+ clear_message_queue args
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def queue_message args, msg~
+- Inside source: true
+*** True Line Result
+ def queue_message args, msg
+** Processing line: ~ args.state.textbox.messages.concat msg.wrapped_lines 50~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.messages.concat msg.wrapped_lines 50
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def clear_message_queue args~
+- Inside source: true
+*** True Line Result
+ def clear_message_queue args
+** Processing line: ~ args.state.textbox.messages = nil~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.messages = nil
+** Processing line: ~ args.state.textbox.scroll = 0~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.scroll = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_messages args~
+- Inside source: true
+*** True Line Result
+ def render_messages args
+** Processing line: ~ args.outputs[:textbox].w = 400~
+- Inside source: true
+*** True Line Result
+ args.outputs[:textbox].w = 400
+** Processing line: ~ args.outputs[:textbox].h = 720~
+- Inside source: true
+*** True Line Result
+ args.outputs[:textbox].h = 720
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.primitives << args.state.textbox.messages.each_with_index.map do |s, idx|~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << args.state.textbox.messages.each_with_index.map do |s, idx|
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ x: 0,~
+- Inside source: true
+*** True Line Result
+ x: 0,
+** Processing line: ~ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,~
+- Inside source: true
+*** True Line Result
+ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,
+** Processing line: ~ text: s,~
+- Inside source: true
+*** True Line Result
+ text: s,
+** Processing line: ~ size_enum: -3,~
+- Inside source: true
+*** True Line Result
+ size_enum: -3,
+** Processing line: ~ alignment_enum: 0,~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 0,
+** Processing line: ~ r: 255, g:255, b: 255, a: 255~
+- Inside source: true
+*** True Line Result
+ r: 255, g:255, b: 255, a: 255
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs[:textbox].labels << args.state.textbox.messages.each_with_index.map do |s, idx|~
+- Inside source: true
+*** True Line Result
+ args.outputs[:textbox].labels << args.state.textbox.messages.each_with_index.map do |s, idx|
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ x: 0,~
+- Inside source: true
+*** True Line Result
+ x: 0,
+** Processing line: ~ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,~
+- Inside source: true
+*** True Line Result
+ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,
+** Processing line: ~ text: s,~
+- Inside source: true
+*** True Line Result
+ text: s,
+** Processing line: ~ size_enum: -3,~
+- Inside source: true
+*** True Line Result
+ size_enum: -3,
+** Processing line: ~ alignment_enum: 0,~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 0,
+** Processing line: ~ r: 255, g:255, b: 255, a: 255~
+- Inside source: true
+*** True Line Result
+ r: 255, g:255, b: 255, a: 255
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs[:textbox].borders << [0, 0, args.outputs[:textbox].w, 720]~
+- Inside source: true
+*** True Line Result
+ args.outputs[:textbox].borders << [0, 0, args.outputs[:textbox].w, 720]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.textbox.scroll += args.inputs.mouse.wheel.y unless args.inputs.mouse.wheel.nil?~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.scroll += args.inputs.mouse.wheel.y unless args.inputs.mouse.wheel.nil?
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.state.scroll_location > 0~
+- Inside source: true
+*** True Line Result
+ if args.state.scroll_location > 0
+** Processing line: ~ args.state.textbox.scroll = 0~
+- Inside source: true
+*** True Line Result
+ args.state.textbox.scroll = 0
+** Processing line: ~ args.state.scroll_location = 0~
+- Inside source: true
+*** True Line Result
+ args.state.scroll_location = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.sprites << [900, 0, args.outputs[:textbox].w, 720, :textbox]~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << [900, 0, args.outputs[:textbox].w, 720, :textbox]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_instructions args~
+- Inside source: true
+*** True Line Result
+ def render_instructions args
+** Processing line: ~ args.outputs.labels << [30,~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << [30,
+** Processing line: ~ 30.from_top,~
+- Inside source: true
+*** True Line Result
+ 30.from_top,
+** Processing line: ~ "press 1, 2, 3 to display messages, MOUSE WHEEL to scroll, HOME to go to top, BACKSPACE to delete.",~
+- Inside source: true
+*** True Line Result
+ "press 1, 2, 3 to display messages, MOUSE WHEEL to scroll, HOME to go to top, BACKSPACE to delete.",
+** Processing line: ~ 0, 255, 255]~
+- Inside source: true
+*** True Line Result
+ 0, 255, 255]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.primitives << [0, 55.from_top, 1280, 30, :pixel, 0, 255, 0, 0, 0].sprite~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << [0, 55.from_top, 1280, 30, :pixel, 0, 255, 0, 0, 0].sprite
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~*** Advanced Rendering - Rotating Label - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Rendering - Rotating Label - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/07_advanced_rendering/00_rotating_label/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_rendering/00_rotating_label/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # set the render target width and height to match the label~
+- Inside source: true
+*** True Line Result
+ # set the render target width and height to match the label
+** Processing line: ~ args.outputs[:scene].w = 220~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].w = 220
+** Processing line: ~ args.outputs[:scene].h = 30~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].h = 30
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # make the background transparent~
+- Inside source: true
+*** True Line Result
+ # make the background transparent
+** Processing line: ~ args.outputs[:scene].background_color = [255, 255, 255, 0]~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].background_color = [255, 255, 255, 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # set the blendmode of the label to 0 (no blending)~
+- Inside source: true
+*** True Line Result
+ # set the blendmode of the label to 0 (no blending)
+** Processing line: ~ # center it inside of the scene~
+- Inside source: true
+*** True Line Result
+ # center it inside of the scene
+** Processing line: ~ # set the vertical_alignment_enum to 1 (center)~
+- Inside source: true
+*** True Line Result
+ # set the vertical_alignment_enum to 1 (center)
+** Processing line: ~ args.outputs[:scene].labels << { x: 0,~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].labels << { x: 0,
+** Processing line: ~ y: 15,~
+- Inside source: true
+*** True Line Result
+ y: 15,
+** Processing line: ~ text: "label in render target",~
+- Inside source: true
+*** True Line Result
+ text: "label in render target",
+** Processing line: ~ blendmode_enum: 0,~
+- Inside source: true
+*** True Line Result
+ blendmode_enum: 0,
+** Processing line: ~ vertical_alignment_enum: 1 }~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 1 }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # add a border to the render target~
+- Inside source: true
+*** True Line Result
+ # add a border to the render target
+** Processing line: ~ args.outputs[:scene].borders << { x: 0,~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].borders << { x: 0,
+** Processing line: ~ y: 0,~
+- Inside source: true
+*** True Line Result
+ y: 0,
+** Processing line: ~ w: args.outputs[:scene].w,~
+- Inside source: true
+*** True Line Result
+ w: args.outputs[:scene].w,
+** Processing line: ~ h: args.outputs[:scene].h }~
+- Inside source: true
+*** True Line Result
+ h: args.outputs[:scene].h }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # add the rendertarget to the main output as a sprite~
+- Inside source: true
+*** True Line Result
+ # add the rendertarget to the main output as a sprite
+** Processing line: ~ args.outputs.sprites << { x: 640 - args.outputs[:scene].w.half,~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << { x: 640 - args.outputs[:scene].w.half,
+** Processing line: ~ y: 360 - args.outputs[:scene].h.half,~
+- Inside source: true
+*** True Line Result
+ y: 360 - args.outputs[:scene].h.half,
+** Processing line: ~ w: args.outputs[:scene].w,~
+- Inside source: true
+*** True Line Result
+ w: args.outputs[:scene].w,
+** Processing line: ~ h: args.outputs[:scene].h,~
+- Inside source: true
+*** True Line Result
+ h: args.outputs[:scene].h,
+** Processing line: ~ angle: args.state.tick_count,~
+- Inside source: true
+*** True Line Result
+ angle: args.state.tick_count,
+** Processing line: ~ path: :scene }~
+- Inside source: true
+*** True Line Result
+ path: :scene }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** Advanced Rendering - Simple Render Targets - main.rb~
- Header detected.
*** True Line Result
@@ -51995,6 +52663,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def new_room~
- Inside source: true
*** True Line Result
@@ -56503,6 +57175,362 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** Performance - Sprites As Struct - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Performance - Sprites As Struct - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/09_performance/03_sprites_as_struct/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/09_performance/03_sprites_as_struct/app/main.rb
+** Processing line: ~ # create a Struct variant that allows for named parameters on construction.~
+- Inside source: true
+*** True Line Result
+ # create a Struct variant that allows for named parameters on construction.
+** Processing line: ~ class NamedStruct < Struct~
+- Inside source: true
+*** True Line Result
+ class NamedStruct < Struct
+** Processing line: ~ def initialize **opts~
+- Inside source: true
+*** True Line Result
+ def initialize **opts
+** Processing line: ~ super(*members.map { |k| opts[k] })~
+- Inside source: true
+*** True Line Result
+ super(*members.map { |k| opts[k] })
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # create a Star NamedStruct~
+- Inside source: true
+*** True Line Result
+ # create a Star NamedStruct
+** Processing line: ~ Star = NamedStruct.new(:x, :y, :w, :h, :path, :s,~
+- Inside source: true
+*** True Line Result
+ Star = NamedStruct.new(:x, :y, :w, :h, :path, :s,
+** Processing line: ~ :angle, :angle_anchor_x, :angle_anchor_y,~
+- Inside source: true
+*** True Line Result
+ :angle, :angle_anchor_x, :angle_anchor_y,
+** Processing line: ~ :r, :g, :b, :a,~
+- Inside source: true
+*** True Line Result
+ :r, :g, :b, :a,
+** Processing line: ~ :tile_x, :tile_y,~
+- Inside source: true
+*** True Line Result
+ :tile_x, :tile_y,
+** Processing line: ~ :tile_w, :tile_h,~
+- Inside source: true
+*** True Line Result
+ :tile_w, :tile_h,
+** Processing line: ~ :source_x, :source_y,~
+- Inside source: true
+*** True Line Result
+ :source_x, :source_y,
+** Processing line: ~ :source_w, :source_h,~
+- Inside source: true
+*** True Line Result
+ :source_w, :source_h,
+** Processing line: ~ :flip_horizontally, :flip_vertically,~
+- Inside source: true
+*** True Line Result
+ :flip_horizontally, :flip_vertically,
+** Processing line: ~ :blendmode_enum)~
+- Inside source: true
+*** True Line Result
+ :blendmode_enum)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Sprites represented as Structs. They require a little bit more code than Hashes,~
+- Inside source: true
+*** True Line Result
+ # Sprites represented as Structs. They require a little bit more code than Hashes,
+** Processing line: ~ # but are the a little faster to render too.~
+- Inside source: true
+*** True Line Result
+ # but are the a little faster to render too.
+** Processing line: ~ def random_x args~
+- Inside source: true
+*** True Line Result
+ def random_x args
+** Processing line: ~ (args.grid.w.randomize :ratio) * -1~
+- Inside source: true
+*** True Line Result
+ (args.grid.w.randomize :ratio) * -1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def random_y args~
+- Inside source: true
+*** True Line Result
+ def random_y args
+** Processing line: ~ (args.grid.h.randomize :ratio) * -1~
+- Inside source: true
+*** True Line Result
+ (args.grid.h.randomize :ratio) * -1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def random_speed~
+- Inside source: true
+*** True Line Result
+ def random_speed
+** Processing line: ~ 1 + (4.randomize :ratio)~
+- Inside source: true
+*** True Line Result
+ 1 + (4.randomize :ratio)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def new_star args~
+- Inside source: true
+*** True Line Result
+ def new_star args
+** Processing line: ~ Star.new x: (random_x args),~
+- Inside source: true
+*** True Line Result
+ Star.new x: (random_x args),
+** Processing line: ~ y: (random_y args),~
+- Inside source: true
+*** True Line Result
+ y: (random_y args),
+** Processing line: ~ w: 4, h: 4,~
+- Inside source: true
+*** True Line Result
+ w: 4, h: 4,
+** Processing line: ~ path: 'sprites/tiny-star.png',~
+- Inside source: true
+*** True Line Result
+ path: 'sprites/tiny-star.png',
+** Processing line: ~ s: random_speed~
+- Inside source: true
+*** True Line Result
+ s: random_speed
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def move_star args, star~
+- Inside source: true
+*** True Line Result
+ def move_star args, star
+** Processing line: ~ star.x += star[:s]~
+- Inside source: true
+*** True Line Result
+ star.x += star[:s]
+** Processing line: ~ star.y += star[:s]~
+- Inside source: true
+*** True Line Result
+ star.y += star[:s]
+** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~
+- Inside source: true
+*** True Line Result
+ if star.x > args.grid.w || star.y > args.grid.h
+** Processing line: ~ star.x = (random_x args)~
+- Inside source: true
+*** True Line Result
+ star.x = (random_x args)
+** Processing line: ~ star.y = (random_y args)~
+- Inside source: true
+*** True Line Result
+ star.y = (random_y args)
+** Processing line: ~ star[:s] = random_speed~
+- Inside source: true
+*** True Line Result
+ star[:s] = random_speed
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ args.state.star_count ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.star_count ||= 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # sets console command when sample app initially opens~
+- Inside source: true
+*** True Line Result
+ # sets console command when sample app initially opens
+** Processing line: ~ if Kernel.global_tick_count == 0~
+- Inside source: true
+*** True Line Result
+ if Kernel.global_tick_count == 0
+** Processing line: ~ puts ""~
+- Inside source: true
+*** True Line Result
+ puts ""
+** Processing line: ~ puts ""~
+- Inside source: true
+*** True Line Result
+ puts ""
+** Processing line: ~ puts "========================================================="~
+- Inside source: true
+*** True Line Result
+ puts "========================================================="
+** Processing line: ~ puts "* INFO: Sprites, Structs"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Sprites, Structs"
+** Processing line: ~ puts "* INFO: Please specify the number of sprites to render."~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Please specify the number of sprites to render."
+** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~
+- Inside source: true
+*** True Line Result
+ args.gtk.console.set_command "reset_with count: 100"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # init~
+- Inside source: true
+*** True Line Result
+ # init
+** Processing line: ~ if args.state.tick_count == 0~
+- Inside source: true
+*** True Line Result
+ if args.state.tick_count == 0
+** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~
+- Inside source: true
+*** True Line Result
+ args.state.stars = args.state.star_count.map { |i| new_star args }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # update~
+- Inside source: true
+*** True Line Result
+ # update
+** Processing line: ~ args.state.stars.each { |s| move_star args, s }~
+- Inside source: true
+*** True Line Result
+ args.state.stars.each { |s| move_star args, s }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # render~
+- Inside source: true
+*** True Line Result
+ # render
+** Processing line: ~ args.outputs.sprites << args.state.stars~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << args.state.stars
+** Processing line: ~ args.outputs.background_color = [0, 0, 0]~
+- Inside source: true
+*** True Line Result
+ args.outputs.background_color = [0, 0, 0]
+** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << args.gtk.current_framerate_primitives
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # resets game, and assigns star count given by user~
+- Inside source: true
+*** True Line Result
+ # resets game, and assigns star count given by user
+** Processing line: ~ def reset_with count: count~
+- Inside source: true
+*** True Line Result
+ def reset_with count: count
+** Processing line: ~ $gtk.reset~
+- Inside source: true
+*** True Line Result
+ $gtk.reset
+** Processing line: ~ $gtk.args.state.star_count = count~
+- Inside source: true
+*** True Line Result
+ $gtk.args.state.star_count = count
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** Performance - Sprites As Strict Entities - main.rb~
- Header detected.
*** True Line Result
@@ -56515,10 +57543,10 @@ Follows is a source code listing for all files that have been open sourced. This
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/04_sprites_as_strict_entities/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb
+ # ./samples/09_performance/04_sprites_as_strict_entities/app/main.rb
** Processing line: ~ # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~~
- Inside source: true
*** True Line Result
@@ -56831,10 +57859,10 @@ Follows is a source code listing for all files that have been open sourced. This
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/09_performance/04_sprites_as_classes/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/05_sprites_as_classes/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/09_performance/04_sprites_as_classes/app/main.rb
+ # ./samples/09_performance/05_sprites_as_classes/app/main.rb
** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.sprites~.~
- Inside source: true
*** True Line Result
@@ -57079,10 +58107,10 @@ Follows is a source code listing for all files that have been open sourced. This
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb
+ # ./samples/09_performance/06_static_sprites_as_classes/app/main.rb
** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.static_sprites~.~
- Inside source: true
*** True Line Result
@@ -57331,10 +58359,10 @@ Follows is a source code listing for all files that have been open sourced. This
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/07_static_sprites_as_classes_with_custom_drawing/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb
+ # ./samples/09_performance/07_static_sprites_as_classes_with_custom_drawing/app/main.rb
** Processing line: ~ # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.~
- Inside source: true
*** True Line Result
@@ -57711,10 +58739,10 @@ Follows is a source code listing for all files that have been open sourced. This
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/09_performance/07_collision_limits/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/08_collision_limits/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/09_performance/07_collision_limits/app/main.rb
+ # ./samples/09_performance/08_collision_limits/app/main.rb
** Processing line: ~ =begin~
- Inside source: true
*** True Line Result
@@ -57947,6 +58975,110 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** Advanced Debugging - Logging - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Debugging - Logging - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/10_advanced_debugging/00_logging/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/10_advanced_debugging/00_logging/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ args.outputs.background_color = [255, 255, 255, 0]~
+- Inside source: true
+*** True Line Result
+ args.outputs.background_color = [255, 255, 255, 0]
+** Processing line: ~ if args.state.tick_count == 0~
+- Inside source: true
+*** True Line Result
+ if args.state.tick_count == 0
+** Processing line: ~ args.gtk.log_spam "log level spam"~
+- Inside source: true
+*** True Line Result
+ args.gtk.log_spam "log level spam"
+** Processing line: ~ args.gtk.log_debug "log level debug"~
+- Inside source: true
+*** True Line Result
+ args.gtk.log_debug "log level debug"
+** Processing line: ~ args.gtk.log_info "log level info"~
+- Inside source: true
+*** True Line Result
+ args.gtk.log_info "log level info"
+** Processing line: ~ args.gtk.log_warn "log level warn"~
+- Inside source: true
+*** True Line Result
+ args.gtk.log_warn "log level warn"
+** Processing line: ~ args.gtk.log_error "log level error"~
+- Inside source: true
+*** True Line Result
+ args.gtk.log_error "log level error"
+** Processing line: ~ args.gtk.log_unfiltered "log level unfiltered"~
+- Inside source: true
+*** True Line Result
+ args.gtk.log_unfiltered "log level unfiltered"
+** Processing line: ~ puts "This is a puts call"~
+- Inside source: true
+*** True Line Result
+ puts "This is a puts call"
+** Processing line: ~ args.gtk.console.show~
+- Inside source: true
+*** True Line Result
+ args.gtk.console.show
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.state.tick_count == 60~
+- Inside source: true
+*** True Line Result
+ if args.state.tick_count == 60
+** Processing line: ~ puts "This is a puts call on tick 60"~
+- Inside source: true
+*** True Line Result
+ puts "This is a puts call on tick 60"
+** Processing line: ~ elsif args.state.tick_count == 120~
+- Inside source: true
+*** True Line Result
+ elsif args.state.tick_count == 120
+** Processing line: ~ puts "This is a puts call on tick 120"~
+- Inside source: true
+*** True Line Result
+ puts "This is a puts call on tick 120"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** Advanced Debugging - Trace Debugging - main.rb~
- Header detected.
*** True Line Result
@@ -62527,6 +63659,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# ./samples/11_http/01_retrieve_images/app/main.rb
+** Processing line: ~ $gtk.register_cvar 'app.warn_seconds', "seconds to wait before starting", :uint, 11~
+- Inside source: true
+*** True Line Result
+ $gtk.register_cvar 'app.warn_seconds', "seconds to wait before starting", :uint, 11
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def tick args~
- Inside source: true
*** True Line Result
@@ -62543,10 +63683,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Show a warning at the start.
-** Processing line: ~ args.state.warning_debounce ||= 11 * 60~
+** Processing line: ~ args.state.warning_debounce ||= args.cvars['app.warn_seconds'].value * 60~
- Inside source: true
*** True Line Result
- args.state.warning_debounce ||= 11 * 60
+ args.state.warning_debounce ||= args.cvars['app.warn_seconds'].value * 60
** Processing line: ~ if args.state.warning_debounce > 0~
- Inside source: true
*** True Line Result
@@ -62751,22 +63891,22 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
-** Processing line: ~*** Http - Web Server - main.rb~
+** Processing line: ~*** Http - In Game Web Server Http Get - main.rb~
- Header detected.
*** True Line Result
*** True Line Result
-*** Http - Web Server - main.rb
+*** Http - In Game Web Server Http Get - main.rb
** Processing line: ~#+begin_src ruby~
- Line was identified as the beginning of a code block.
*** True Line Result
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/11_http/02_web_server/app/main.rb~
+** Processing line: ~ # ./samples/11_http/02_in_game_web_server_http_get/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/11_http/02_web_server/app/main.rb
+ # ./samples/11_http/02_in_game_web_server_http_get/app/main.rb
** Processing line: ~ def tick args~
- Inside source: true
*** True Line Result
@@ -62775,6 +63915,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
args.state.port ||= 3000
+** Processing line: ~ args.state.reqnum ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.reqnum ||= 0
** Processing line: ~ # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build~
- Inside source: true
*** True Line Result
@@ -62887,6 +64031,322 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** Http - In Game Web Server Http Post - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Http - In Game Web Server Http Post - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/11_http/03_in_game_web_server_http_post/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/11_http/03_in_game_web_server_http_post/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # defaults~
+- Inside source: true
+*** True Line Result
+ # defaults
+** Processing line: ~ args.state.post_button = args.layout.rect(row: 0, col: 0, w: 5, h: 1).merge(text: "execute http_post")~
+- Inside source: true
+*** True Line Result
+ args.state.post_button = args.layout.rect(row: 0, col: 0, w: 5, h: 1).merge(text: "execute http_post")
+** Processing line: ~ args.state.post_body_button = args.layout.rect(row: 1, col: 0, w: 5, h: 1).merge(text: "execute http_post_body")~
+- Inside source: true
+*** True Line Result
+ args.state.post_body_button = args.layout.rect(row: 1, col: 0, w: 5, h: 1).merge(text: "execute http_post_body")
+** Processing line: ~ args.state.request_to_s ||= ""~
+- Inside source: true
+*** True Line Result
+ args.state.request_to_s ||= ""
+** Processing line: ~ args.state.request_body ||= ""~
+- Inside source: true
+*** True Line Result
+ args.state.request_body ||= ""
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # render~
+- Inside source: true
+*** True Line Result
+ # render
+** Processing line: ~ args.state.post_button.yield_self do |b|~
+- Inside source: true
+*** True Line Result
+ args.state.post_button.yield_self do |b|
+** Processing line: ~ args.outputs.borders << b~
+- Inside source: true
+*** True Line Result
+ args.outputs.borders << b
+** Processing line: ~ args.outputs.labels << b.merge(text: b.text,~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << b.merge(text: b.text,
+** Processing line: ~ y: b.y + 30,~
+- Inside source: true
+*** True Line Result
+ y: b.y + 30,
+** Processing line: ~ x: b.x + 10)~
+- Inside source: true
+*** True Line Result
+ x: b.x + 10)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.post_body_button.yield_self do |b|~
+- Inside source: true
+*** True Line Result
+ args.state.post_body_button.yield_self do |b|
+** Processing line: ~ args.outputs.borders << b~
+- Inside source: true
+*** True Line Result
+ args.outputs.borders << b
+** Processing line: ~ args.outputs.labels << b.merge(text: b.text,~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << b.merge(text: b.text,
+** Processing line: ~ y: b.y + 30,~
+- Inside source: true
+*** True Line Result
+ y: b.y + 30,
+** Processing line: ~ x: b.x + 10)~
+- Inside source: true
+*** True Line Result
+ x: b.x + 10)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ draw_label args, 0, 6, "Request:", args.state.request_to_s~
+- Inside source: true
+*** True Line Result
+ draw_label args, 0, 6, "Request:", args.state.request_to_s
+** Processing line: ~ draw_label args, 0, 14, "Request Body Unaltered:", args.state.request_body~
+- Inside source: true
+*** True Line Result
+ draw_label args, 0, 14, "Request Body Unaltered:", args.state.request_body
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # input~
+- Inside source: true
+*** True Line Result
+ # input
+** Processing line: ~ if args.inputs.mouse.click~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.click
+** Processing line: ~ # ============= HTTP_POST =============~
+- Inside source: true
+*** True Line Result
+ # ============= HTTP_POST =============
+** Processing line: ~ if (args.inputs.mouse.inside_rect? args.state.post_button)~
+- Inside source: true
+*** True Line Result
+ if (args.inputs.mouse.inside_rect? args.state.post_button)
+** Processing line: ~ # ========= DATA TO SEND ===========~
+- Inside source: true
+*** True Line Result
+ # ========= DATA TO SEND ===========
+** Processing line: ~ form_fields = { "userId" => "#{Time.now.to_i}" }~
+- Inside source: true
+*** True Line Result
+ form_fields = { "userId" => "#{Time.now.to_i}" }
+** Processing line: ~ # ==================================~
+- Inside source: true
+*** True Line Result
+ # ==================================
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.gtk.http_post "http://localhost:9001/testing",~
+- Inside source: true
+*** True Line Result
+ args.gtk.http_post "http://localhost:9001/testing",
+** Processing line: ~ form_fields,~
+- Inside source: true
+*** True Line Result
+ form_fields,
+** Processing line: ~ ["Content-Type: application/x-www-form-urlencoded"]~
+- Inside source: true
+*** True Line Result
+ ["Content-Type: application/x-www-form-urlencoded"]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.gtk.notify! "http_post"~
+- Inside source: true
+*** True Line Result
+ args.gtk.notify! "http_post"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # ============= HTTP_POST_BODY =============~
+- Inside source: true
+*** True Line Result
+ # ============= HTTP_POST_BODY =============
+** Processing line: ~ if (args.inputs.mouse.inside_rect? args.state.post_body_button)~
+- Inside source: true
+*** True Line Result
+ if (args.inputs.mouse.inside_rect? args.state.post_body_button)
+** Processing line: ~ # =========== DATA TO SEND ==============~
+- Inside source: true
+*** True Line Result
+ # =========== DATA TO SEND ==============
+** Processing line: ~ json = "{ \"userId\": \"#{Time.now.to_i}\"}"~
+- Inside source: true
+*** True Line Result
+ json = "{ \"userId\": \"#{Time.now.to_i}\"}"
+** Processing line: ~ # ==================================~
+- Inside source: true
+*** True Line Result
+ # ==================================
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.gtk.http_post_body "http://localhost:9001/testing",~
+- Inside source: true
+*** True Line Result
+ args.gtk.http_post_body "http://localhost:9001/testing",
+** Processing line: ~ json,~
+- Inside source: true
+*** True Line Result
+ json,
+** Processing line: ~ ["Content-Type: application/json", "Content-Length: #{json.length}"]~
+- Inside source: true
+*** True Line Result
+ ["Content-Type: application/json", "Content-Length: #{json.length}"]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.gtk.notify! "http_post_body"~
+- Inside source: true
+*** True Line Result
+ args.gtk.notify! "http_post_body"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # calc~
+- Inside source: true
+*** True Line Result
+ # calc
+** Processing line: ~ args.inputs.http_requests.each do |r|~
+- Inside source: true
+*** True Line Result
+ args.inputs.http_requests.each do |r|
+** Processing line: ~ puts "#{r}"~
+- Inside source: true
+*** True Line Result
+ puts "#{r}"
+** Processing line: ~ if r.uri == "/testing"~
+- Inside source: true
+*** True Line Result
+ if r.uri == "/testing"
+** Processing line: ~ puts r~
+- Inside source: true
+*** True Line Result
+ puts r
+** Processing line: ~ args.state.request_to_s = "#{r}"~
+- Inside source: true
+*** True Line Result
+ args.state.request_to_s = "#{r}"
+** Processing line: ~ args.state.request_body = r.raw_body~
+- Inside source: true
+*** True Line Result
+ args.state.request_body = r.raw_body
+** Processing line: ~ r.respond 200, "ok"~
+- Inside source: true
+*** True Line Result
+ r.respond 200, "ok"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def draw_label args, row, col, header, text~
+- Inside source: true
+*** True Line Result
+ def draw_label args, row, col, header, text
+** Processing line: ~ label_pos = args.layout.rect(row: row, col: col, w: 0, h: 0)~
+- Inside source: true
+*** True Line Result
+ label_pos = args.layout.rect(row: row, col: col, w: 0, h: 0)
+** Processing line: ~ args.outputs.labels << "#{header}\n\n#{text}".wrapped_lines(80).map_with_index do |l, i|~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << "#{header}\n\n#{text}".wrapped_lines(80).map_with_index do |l, i|
+** Processing line: ~ { x: label_pos.x, y: label_pos.y - (i * 15), text: l, size_enum: -2 }~
+- Inside source: true
+*** True Line Result
+ { x: label_pos.x, y: label_pos.y - (i * 15), text: l, size_enum: -2 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** C Extensions - Basics - main.rb~
- Header detected.
*** True Line Result
@@ -70687,10 +72147,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Every tick, new args are passed, and the Breadth First Search tick is called
-** Processing line: ~ $breadcrumbs ||= Breadcrumbs.new(args)~
+** Processing line: ~ $breadcrumbs ||= Breadcrumbs.new~
- Inside source: true
*** True Line Result
- $breadcrumbs ||= Breadcrumbs.new(args)
+ $breadcrumbs ||= Breadcrumbs.new
** Processing line: ~ $breadcrumbs.args = args~
- Inside source: true
*** True Line Result
@@ -73295,10 +74755,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Every tick, new args are passed, and the Breadth First Search tick is called
-** Processing line: ~ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)~
+** Processing line: ~ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new~
- Inside source: true
*** True Line Result
- $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)
+ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new
** Processing line: ~ $early_exit_breadth_first_search.args = args~
- Inside source: true
*** True Line Result
@@ -76699,10 +78159,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Every tick, new args are passed, and the Dijkstra tick method is called
-** Processing line: ~ $movement_costs ||= Movement_Costs.new(args)~
+** Processing line: ~ $movement_costs ||= Movement_Costs.new~
- Inside source: true
*** True Line Result
- $movement_costs ||= Movement_Costs.new(args)
+ $movement_costs ||= Movement_Costs.new
** Processing line: ~ $movement_costs.args = args~
- Inside source: true
*** True Line Result
@@ -80647,10 +82107,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Every tick, new args are passed, and the Breadth First Search tick is called
-** Processing line: ~ $heuristic_with_walls ||= Heuristic_With_Walls.new(args)~
+** Processing line: ~ $heuristic_with_walls ||= Heuristic_With_Walls.new~
- Inside source: true
*** True Line Result
- $heuristic_with_walls ||= Heuristic_With_Walls.new(args)
+ $heuristic_with_walls ||= Heuristic_With_Walls.new
** Processing line: ~ $heuristic_with_walls.args = args~
- Inside source: true
*** True Line Result
@@ -84727,10 +86187,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Every tick, new args are passed, and the Breadth First Search tick is called
-** Processing line: ~ $heuristic ||= Heuristic.new(args)~
+** Processing line: ~ $heuristic ||= Heuristic.new~
- Inside source: true
*** True Line Result
- $heuristic ||= Heuristic.new(args)
+ $heuristic ||= Heuristic.new
** Processing line: ~ $heuristic.args = args~
- Inside source: true
*** True Line Result
@@ -88871,10 +90331,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Every tick, new args are passed, and the Breadth First Search tick is called
-** Processing line: ~ $a_star_algorithm ||= A_Star_Algorithm.new(args)~
+** Processing line: ~ $a_star_algorithm ||= A_Star_Algorithm.new~
- Inside source: true
*** True Line Result
- $a_star_algorithm ||= A_Star_Algorithm.new(args)
+ $a_star_algorithm ||= A_Star_Algorithm.new
** Processing line: ~ $a_star_algorithm.args = args~
- Inside source: true
*** True Line Result
@@ -91031,6 +92491,1438 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** 3d - Yaw Pitch Roll - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** 3d - Yaw Pitch Roll - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/99_genre_3d/03_yaw_pitch_roll/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_3d/03_yaw_pitch_roll/app/main.rb
+** Processing line: ~ class Game~
+- Inside source: true
+*** True Line Result
+ class Game
+** Processing line: ~ attr_gtk~
+- Inside source: true
+*** True Line Result
+ attr_gtk
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick~
+- Inside source: true
+*** True Line Result
+ def tick
+** Processing line: ~ defaults~
+- Inside source: true
+*** True Line Result
+ defaults
+** Processing line: ~ render~
+- Inside source: true
+*** True Line Result
+ render
+** Processing line: ~ input~
+- Inside source: true
+*** True Line Result
+ input
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def matrix_mul m, v~
+- Inside source: true
+*** True Line Result
+ def matrix_mul m, v
+** Processing line: ~ (hmap x: ((m.x.x * v.x) + (m.x.y * v.y) + (m.x.z * v.z) + (m.x.w * v.w)),~
+- Inside source: true
+*** True Line Result
+ (hmap x: ((m.x.x * v.x) + (m.x.y * v.y) + (m.x.z * v.z) + (m.x.w * v.w)),
+** Processing line: ~ y: ((m.y.x * v.x) + (m.y.y * v.y) + (m.y.z * v.z) + (m.y.w * v.w)),~
+- Inside source: true
+*** True Line Result
+ y: ((m.y.x * v.x) + (m.y.y * v.y) + (m.y.z * v.z) + (m.y.w * v.w)),
+** Processing line: ~ z: ((m.z.x * v.x) + (m.z.y * v.y) + (m.z.z * v.z) + (m.z.w * v.w)),~
+- Inside source: true
+*** True Line Result
+ z: ((m.z.x * v.x) + (m.z.y * v.y) + (m.z.z * v.z) + (m.z.w * v.w)),
+** Processing line: ~ w: ((m.w.x * v.x) + (m.w.y * v.y) + (m.w.z * v.z) + (m.w.w * v.w)))~
+- Inside source: true
+*** True Line Result
+ w: ((m.w.x * v.x) + (m.w.y * v.y) + (m.w.z * v.z) + (m.w.w * v.w)))
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_ship~
+- Inside source: true
+*** True Line Result
+ def player_ship
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ # engine back~
+- Inside source: true
+*** True Line Result
+ # engine back
+** Processing line: ~ { x: -1, y: -1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -1, z: 1, w: 0 },
+** Processing line: ~ { x: -1, y: 1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 1, z: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, y: 1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 1, z: 1, w: 0 },
+** Processing line: ~ { x: 1, y: 1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 1, z: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, y: 1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 1, z: 1, w: 0 },
+** Processing line: ~ { x: 1, y: -1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -1, z: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, y: -1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -1, z: 1, w: 0 },
+** Processing line: ~ { x: -1, y: -1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -1, z: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # engine front~
+- Inside source: true
+*** True Line Result
+ # engine front
+** Processing line: ~ { x: -1, y: -1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -1, z: -1, w: 0 },
+** Processing line: ~ { x: -1, y: 1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 1, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, y: 1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 1, z: -1, w: 0 },
+** Processing line: ~ { x: 1, y: 1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 1, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, y: 1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 1, z: -1, w: 0 },
+** Processing line: ~ { x: 1, y: -1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -1, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, y: -1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -1, z: -1, w: 0 },
+** Processing line: ~ { x: -1, y: -1, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -1, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # engine left~
+- Inside source: true
+*** True Line Result
+ # engine left
+** Processing line: ~ { x: -1, z: -1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: -1, y: -1, w: 0 },
+** Processing line: ~ { x: -1, z: -1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: -1, y: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, z: -1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: -1, y: 1, w: 0 },
+** Processing line: ~ { x: -1, z: 1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: 1, y: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, z: 1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: 1, y: 1, w: 0 },
+** Processing line: ~ { x: -1, z: 1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: 1, y: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, z: 1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: 1, y: -1, w: 0 },
+** Processing line: ~ { x: -1, z: -1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, z: -1, y: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # engine right~
+- Inside source: true
+*** True Line Result
+ # engine right
+** Processing line: ~ { x: 1, z: -1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: -1, y: -1, w: 0 },
+** Processing line: ~ { x: 1, z: -1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: -1, y: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, z: -1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: -1, y: 1, w: 0 },
+** Processing line: ~ { x: 1, z: 1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: 1, y: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, z: 1, y: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: 1, y: 1, w: 0 },
+** Processing line: ~ { x: 1, z: 1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: 1, y: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, z: 1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: 1, y: -1, w: 0 },
+** Processing line: ~ { x: 1, z: -1, y: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, z: -1, y: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # top front of engine to front of ship~
+- Inside source: true
+*** True Line Result
+ # top front of engine to front of ship
+** Processing line: ~ { x: 1, y: 1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 1, z: 1, w: 0 },
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 0, y: -1, z: 9, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 0, y: -1, z: 9, w: 0 },
+** Processing line: ~ { x: -1, y: 1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 1, z: 1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # bottom front of engine~
+- Inside source: true
+*** True Line Result
+ # bottom front of engine
+** Processing line: ~ { x: 1, y: -1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -1, z: 1, w: 0 },
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 0, y: -1, z: 9, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, y: -1, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -1, z: 1, w: 0 },
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 0, y: -1, z: 9, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # right wing~
+- Inside source: true
+*** True Line Result
+ # right wing
+** Processing line: ~ # front of wing~
+- Inside source: true
+*** True Line Result
+ # front of wing
+** Processing line: ~ { x: 1, y: 0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 0.10, z: 1, w: 0 },
+** Processing line: ~ { x: 9, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 9, y: 0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 9, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 9, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 10, y: 0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 10, y: 0.10, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # back of wing~
+- Inside source: true
+*** True Line Result
+ # back of wing
+** Processing line: ~ { x: 1, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 9, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 9, y: 0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 10, y: 0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 10, y: 0.10, z: -2, w: 0 },
+** Processing line: ~ { x: 8, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 8, y: 0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # front of wing~
+- Inside source: true
+*** True Line Result
+ # front of wing
+** Processing line: ~ { x: 1, y: -0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -0.10, z: 1, w: 0 },
+** Processing line: ~ { x: 9, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 9, y: -0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 9, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 9, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 10, y: -0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 10, y: -0.10, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # back of wing~
+- Inside source: true
+*** True Line Result
+ # back of wing
+** Processing line: ~ { x: 1, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 9, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 9, y: -0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 10, y: -0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 10, y: -0.10, z: -2, w: 0 },
+** Processing line: ~ { x: 8, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 8, y: -0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # left wing~
+- Inside source: true
+*** True Line Result
+ # left wing
+** Processing line: ~ # front of wing~
+- Inside source: true
+*** True Line Result
+ # front of wing
+** Processing line: ~ { x: -1, y: 0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 0.10, z: 1, w: 0 },
+** Processing line: ~ { x: -9, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -9, y: 0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -9, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -9, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -10, y: 0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -10, y: 0.10, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # back of wing~
+- Inside source: true
+*** True Line Result
+ # back of wing
+** Processing line: ~ { x: -1, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -9, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -9, y: 0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -10, y: 0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -10, y: 0.10, z: -2, w: 0 },
+** Processing line: ~ { x: -8, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -8, y: 0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # front of wing~
+- Inside source: true
+*** True Line Result
+ # front of wing
+** Processing line: ~ { x: -1, y: -0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -0.10, z: 1, w: 0 },
+** Processing line: ~ { x: -9, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -9, y: -0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -9, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -9, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -10, y: -0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -10, y: -0.10, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # back of wing~
+- Inside source: true
+*** True Line Result
+ # back of wing
+** Processing line: ~ { x: -1, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -9, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -9, y: -0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -10, y: -0.10, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -10, y: -0.10, z: -2, w: 0 },
+** Processing line: ~ { x: -8, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -8, y: -0.10, z: -1, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # left fin~
+- Inside source: true
+*** True Line Result
+ # left fin
+** Processing line: ~ # top~
+- Inside source: true
+*** True Line Result
+ # top
+** Processing line: ~ { x: -1, y: 0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 0.10, z: 1, w: 0 },
+** Processing line: ~ { x: -1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1.1, y: 0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: 0.10, z: 1, w: 0 },
+** Processing line: ~ { x: -1.1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1.1, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -1.1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # bottom~
+- Inside source: true
+*** True Line Result
+ # bottom
+** Processing line: ~ { x: -1, y: -0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -0.10, z: 1, w: 0 },
+** Processing line: ~ { x: -1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1.1, y: -0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: -0.10, z: 1, w: 0 },
+** Processing line: ~ { x: -1.1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: -1.1, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: -1.1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: -1.1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # right fin~
+- Inside source: true
+*** True Line Result
+ # right fin
+** Processing line: ~ { x: 1, y: 0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 0.10, z: 1, w: 0 },
+** Processing line: ~ { x: 1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1.1, y: 0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: 0.10, z: 1, w: 0 },
+** Processing line: ~ { x: 1.1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1.1, y: 0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: 0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 1.1, y: 3, z: -3, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: 3, z: -3, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # bottom~
+- Inside source: true
+*** True Line Result
+ # bottom
+** Processing line: ~ { x: 1, y: -0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -0.10, z: 1, w: 0 },
+** Processing line: ~ { x: 1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1.1, y: -0.10, z: 1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: -0.10, z: 1, w: 0 },
+** Processing line: ~ { x: 1.1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: -2, z: -2, w: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { x: 1.1, y: -0.10, z: -1, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: -0.10, z: -1, w: 0 },
+** Processing line: ~ { x: 1.1, y: -2, z: -2, w: 0 },~
+- Inside source: true
+*** True Line Result
+ { x: 1.1, y: -2, z: -2, w: 0 },
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def defaults~
+- Inside source: true
+*** True Line Result
+ def defaults
+** Processing line: ~ state.points ||= player_ship~
+- Inside source: true
+*** True Line Result
+ state.points ||= player_ship
+** Processing line: ~ state.shifted_points ||= state.points.map { |point| point }~
+- Inside source: true
+*** True Line Result
+ state.shifted_points ||= state.points.map { |point| point }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ state.scale ||= 1~
+- Inside source: true
+*** True Line Result
+ state.scale ||= 1
+** Processing line: ~ state.angle_x ||= 0~
+- Inside source: true
+*** True Line Result
+ state.angle_x ||= 0
+** Processing line: ~ state.angle_y ||= 0~
+- Inside source: true
+*** True Line Result
+ state.angle_y ||= 0
+** Processing line: ~ state.angle_z ||= 0~
+- Inside source: true
+*** True Line Result
+ state.angle_z ||= 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def matrix_new x0, y0, z0, w0, x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3~
+- Inside source: true
+*** True Line Result
+ def matrix_new x0, y0, z0, w0, x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3
+** Processing line: ~ (hmap x: (hmap x: x0, y: y0, z: z0, w: w0),~
+- Inside source: true
+*** True Line Result
+ (hmap x: (hmap x: x0, y: y0, z: z0, w: w0),
+** Processing line: ~ y: (hmap x: x1, y: y1, z: z1, w: w1),~
+- Inside source: true
+*** True Line Result
+ y: (hmap x: x1, y: y1, z: z1, w: w1),
+** Processing line: ~ z: (hmap x: x2, y: y2, z: z2, w: w2),~
+- Inside source: true
+*** True Line Result
+ z: (hmap x: x2, y: y2, z: z2, w: w2),
+** Processing line: ~ w: (hmap x: x3, y: y3, z: z3, w: w3))~
+- Inside source: true
+*** True Line Result
+ w: (hmap x: x3, y: y3, z: z3, w: w3))
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def angle_z_matrix degrees~
+- Inside source: true
+*** True Line Result
+ def angle_z_matrix degrees
+** Processing line: ~ cos_t = Math.cos degrees.to_radians~
+- Inside source: true
+*** True Line Result
+ cos_t = Math.cos degrees.to_radians
+** Processing line: ~ sin_t = Math.sin degrees.to_radians~
+- Inside source: true
+*** True Line Result
+ sin_t = Math.sin degrees.to_radians
+** Processing line: ~ (matrix_new cos_t, -sin_t, 0, 0,~
+- Inside source: true
+*** True Line Result
+ (matrix_new cos_t, -sin_t, 0, 0,
+** Processing line: ~ sin_t, cos_t, 0, 0,~
+- Inside source: true
+*** True Line Result
+ sin_t, cos_t, 0, 0,
+** Processing line: ~ 0, 0, 1, 0,~
+- Inside source: true
+*** True Line Result
+ 0, 0, 1, 0,
+** Processing line: ~ 0, 0, 0, 1)~
+- Inside source: true
+*** True Line Result
+ 0, 0, 0, 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def angle_y_matrix degrees~
+- Inside source: true
+*** True Line Result
+ def angle_y_matrix degrees
+** Processing line: ~ cos_t = Math.cos degrees.to_radians~
+- Inside source: true
+*** True Line Result
+ cos_t = Math.cos degrees.to_radians
+** Processing line: ~ sin_t = Math.sin degrees.to_radians~
+- Inside source: true
+*** True Line Result
+ sin_t = Math.sin degrees.to_radians
+** Processing line: ~ (matrix_new cos_t, 0, sin_t, 0,~
+- Inside source: true
+*** True Line Result
+ (matrix_new cos_t, 0, sin_t, 0,
+** Processing line: ~ 0, 1, 0, 0,~
+- Inside source: true
+*** True Line Result
+ 0, 1, 0, 0,
+** Processing line: ~ -sin_t, 0, cos_t, 0,~
+- Inside source: true
+*** True Line Result
+ -sin_t, 0, cos_t, 0,
+** Processing line: ~ 0, 0, 0, 1)~
+- Inside source: true
+*** True Line Result
+ 0, 0, 0, 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def angle_x_matrix degrees~
+- Inside source: true
+*** True Line Result
+ def angle_x_matrix degrees
+** Processing line: ~ cos_t = Math.cos degrees.to_radians~
+- Inside source: true
+*** True Line Result
+ cos_t = Math.cos degrees.to_radians
+** Processing line: ~ sin_t = Math.sin degrees.to_radians~
+- Inside source: true
+*** True Line Result
+ sin_t = Math.sin degrees.to_radians
+** Processing line: ~ (matrix_new 1, 0, 0, 0,~
+- Inside source: true
+*** True Line Result
+ (matrix_new 1, 0, 0, 0,
+** Processing line: ~ 0, cos_t, -sin_t, 0,~
+- Inside source: true
+*** True Line Result
+ 0, cos_t, -sin_t, 0,
+** Processing line: ~ 0, sin_t, cos_t, 0,~
+- Inside source: true
+*** True Line Result
+ 0, sin_t, cos_t, 0,
+** Processing line: ~ 0, 0, 0, 1)~
+- Inside source: true
+*** True Line Result
+ 0, 0, 0, 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def scale_matrix factor~
+- Inside source: true
+*** True Line Result
+ def scale_matrix factor
+** Processing line: ~ (matrix_new factor, 0, 0, 0,~
+- Inside source: true
+*** True Line Result
+ (matrix_new factor, 0, 0, 0,
+** Processing line: ~ 0, factor, 0, 0,~
+- Inside source: true
+*** True Line Result
+ 0, factor, 0, 0,
+** Processing line: ~ 0, 0, factor, 0,~
+- Inside source: true
+*** True Line Result
+ 0, 0, factor, 0,
+** Processing line: ~ 0, 0, 0, 1)~
+- Inside source: true
+*** True Line Result
+ 0, 0, 0, 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def input~
+- Inside source: true
+*** True Line Result
+ def input
+** Processing line: ~ if (inputs.keyboard.shift && inputs.keyboard.p)~
+- Inside source: true
+*** True Line Result
+ if (inputs.keyboard.shift && inputs.keyboard.p)
+** Processing line: ~ state.scale -= 0.1~
+- Inside source: true
+*** True Line Result
+ state.scale -= 0.1
+** Processing line: ~ elsif inputs.keyboard.p~
+- Inside source: true
+*** True Line Result
+ elsif inputs.keyboard.p
+** Processing line: ~ state.scale += 0.1~
+- Inside source: true
+*** True Line Result
+ state.scale += 0.1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if inputs.mouse.wheel~
+- Inside source: true
+*** True Line Result
+ if inputs.mouse.wheel
+** Processing line: ~ state.scale += inputs.mouse.wheel.y~
+- Inside source: true
+*** True Line Result
+ state.scale += inputs.mouse.wheel.y
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ state.scale = state.scale.clamp(0.1, 1000)~
+- Inside source: true
+*** True Line Result
+ state.scale = state.scale.clamp(0.1, 1000)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (inputs.keyboard.shift && inputs.keyboard.y) || inputs.keyboard.right~
+- Inside source: true
+*** True Line Result
+ if (inputs.keyboard.shift && inputs.keyboard.y) || inputs.keyboard.right
+** Processing line: ~ state.angle_y += 1~
+- Inside source: true
+*** True Line Result
+ state.angle_y += 1
+** Processing line: ~ elsif (inputs.keyboard.y) || inputs.keyboard.left~
+- Inside source: true
+*** True Line Result
+ elsif (inputs.keyboard.y) || inputs.keyboard.left
+** Processing line: ~ state.angle_y -= 1~
+- Inside source: true
+*** True Line Result
+ state.angle_y -= 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (inputs.keyboard.shift && inputs.keyboard.x) || inputs.keyboard.down~
+- Inside source: true
+*** True Line Result
+ if (inputs.keyboard.shift && inputs.keyboard.x) || inputs.keyboard.down
+** Processing line: ~ state.angle_x -= 1~
+- Inside source: true
+*** True Line Result
+ state.angle_x -= 1
+** Processing line: ~ elsif (inputs.keyboard.x || inputs.keyboard.up)~
+- Inside source: true
+*** True Line Result
+ elsif (inputs.keyboard.x || inputs.keyboard.up)
+** Processing line: ~ state.angle_x += 1~
+- Inside source: true
+*** True Line Result
+ state.angle_x += 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if inputs.keyboard.shift && inputs.keyboard.z~
+- Inside source: true
+*** True Line Result
+ if inputs.keyboard.shift && inputs.keyboard.z
+** Processing line: ~ state.angle_z += 1~
+- Inside source: true
+*** True Line Result
+ state.angle_z += 1
+** Processing line: ~ elsif inputs.keyboard.z~
+- Inside source: true
+*** True Line Result
+ elsif inputs.keyboard.z
+** Processing line: ~ state.angle_z -= 1~
+- Inside source: true
+*** True Line Result
+ state.angle_z -= 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if inputs.keyboard.zero~
+- Inside source: true
+*** True Line Result
+ if inputs.keyboard.zero
+** Processing line: ~ state.angle_x = 0~
+- Inside source: true
+*** True Line Result
+ state.angle_x = 0
+** Processing line: ~ state.angle_y = 0~
+- Inside source: true
+*** True Line Result
+ state.angle_y = 0
+** Processing line: ~ state.angle_z = 0~
+- Inside source: true
+*** True Line Result
+ state.angle_z = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ angle_x = state.angle_x~
+- Inside source: true
+*** True Line Result
+ angle_x = state.angle_x
+** Processing line: ~ angle_y = state.angle_y~
+- Inside source: true
+*** True Line Result
+ angle_y = state.angle_y
+** Processing line: ~ angle_z = state.angle_z~
+- Inside source: true
+*** True Line Result
+ angle_z = state.angle_z
+** Processing line: ~ scale = state.scale~
+- Inside source: true
+*** True Line Result
+ scale = state.scale
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ s_matrix = scale_matrix state.scale~
+- Inside source: true
+*** True Line Result
+ s_matrix = scale_matrix state.scale
+** Processing line: ~ x_matrix = angle_z_matrix angle_z~
+- Inside source: true
+*** True Line Result
+ x_matrix = angle_z_matrix angle_z
+** Processing line: ~ y_matrix = angle_y_matrix angle_y~
+- Inside source: true
+*** True Line Result
+ y_matrix = angle_y_matrix angle_y
+** Processing line: ~ z_matrix = angle_x_matrix angle_x~
+- Inside source: true
+*** True Line Result
+ z_matrix = angle_x_matrix angle_x
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ state.shifted_points = state.points.map do |point|~
+- Inside source: true
+*** True Line Result
+ state.shifted_points = state.points.map do |point|
+** Processing line: ~ (matrix_mul s_matrix,~
+- Inside source: true
+*** True Line Result
+ (matrix_mul s_matrix,
+** Processing line: ~ (matrix_mul z_matrix,~
+- Inside source: true
+*** True Line Result
+ (matrix_mul z_matrix,
+** Processing line: ~ (matrix_mul x_matrix,~
+- Inside source: true
+*** True Line Result
+ (matrix_mul x_matrix,
+** Processing line: ~ (matrix_mul y_matrix, point)))).merge(original: point)~
+- Inside source: true
+*** True Line Result
+ (matrix_mul y_matrix, point)))).merge(original: point)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def thick_line line~
+- Inside source: true
+*** True Line Result
+ def thick_line line
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ line.merge(y: line.y - 1, y2: line.y2 - 1, r: 0, g: 0, b: 0),~
+- Inside source: true
+*** True Line Result
+ line.merge(y: line.y - 1, y2: line.y2 - 1, r: 0, g: 0, b: 0),
+** Processing line: ~ line.merge(x: line.x - 1, x2: line.x2 - 1, r: 0, g: 0, b: 0),~
+- Inside source: true
+*** True Line Result
+ line.merge(x: line.x - 1, x2: line.x2 - 1, r: 0, g: 0, b: 0),
+** Processing line: ~ line.merge(x: line.x - 0, x2: line.x2 - 0, r: 0, g: 0, b: 0),~
+- Inside source: true
+*** True Line Result
+ line.merge(x: line.x - 0, x2: line.x2 - 0, r: 0, g: 0, b: 0),
+** Processing line: ~ line.merge(y: line.y + 1, y2: line.y2 + 1, r: 0, g: 0, b: 0),~
+- Inside source: true
+*** True Line Result
+ line.merge(y: line.y + 1, y2: line.y2 + 1, r: 0, g: 0, b: 0),
+** Processing line: ~ line.merge(x: line.x + 1, x2: line.x2 + 1, r: 0, g: 0, b: 0)~
+- Inside source: true
+*** True Line Result
+ line.merge(x: line.x + 1, x2: line.x2 + 1, r: 0, g: 0, b: 0)
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render~
+- Inside source: true
+*** True Line Result
+ def render
+** Processing line: ~ outputs.lines << state.shifted_points.each_slice(2).map do |(p1, p2)|~
+- Inside source: true
+*** True Line Result
+ outputs.lines << state.shifted_points.each_slice(2).map do |(p1, p2)|
+** Processing line: ~ perc = 0~
+- Inside source: true
+*** True Line Result
+ perc = 0
+** Processing line: ~ thick_line({ x: p1.x.*(10) + 640, y: p1.y.*(10) + 320,~
+- Inside source: true
+*** True Line Result
+ thick_line({ x: p1.x.*(10) + 640, y: p1.y.*(10) + 320,
+** Processing line: ~ x2: p2.x.*(10) + 640, y2: p2.y.*(10) + 320,~
+- Inside source: true
+*** True Line Result
+ x2: p2.x.*(10) + 640, y2: p2.y.*(10) + 320,
+** Processing line: ~ r: 255 * perc,~
+- Inside source: true
+*** True Line Result
+ r: 255 * perc,
+** Processing line: ~ g: 255 * perc,~
+- Inside source: true
+*** True Line Result
+ g: 255 * perc,
+** Processing line: ~ b: 255 * perc })~
+- Inside source: true
+*** True Line Result
+ b: 255 * perc })
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.labels << [ 10, 700, "angle_x: #{state.angle_x.to_sf}", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [ 10, 700, "angle_x: #{state.angle_x.to_sf}", 0]
+** Processing line: ~ outputs.labels << [ 10, 670, "x, shift+x", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [ 10, 670, "x, shift+x", 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.labels << [210, 700, "angle_y: #{state.angle_y.to_sf}", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [210, 700, "angle_y: #{state.angle_y.to_sf}", 0]
+** Processing line: ~ outputs.labels << [210, 670, "y, shift+y", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [210, 670, "y, shift+y", 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.labels << [410, 700, "angle_z: #{state.angle_z.to_sf}", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [410, 700, "angle_z: #{state.angle_z.to_sf}", 0]
+** Processing line: ~ outputs.labels << [410, 670, "z, shift+z", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [410, 670, "z, shift+z", 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.labels << [610, 700, "scale: #{state.scale.to_sf}", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [610, 700, "scale: #{state.scale.to_sf}", 0]
+** Processing line: ~ outputs.labels << [610, 670, "p, shift+p", 0]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [610, 670, "p, shift+p", 0]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $game = Game.new~
+- Inside source: true
+*** True Line Result
+ $game = Game.new
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ $game.args = args~
+- Inside source: true
+*** True Line Result
+ $game.args = args
+** Processing line: ~ $game.tick~
+- Inside source: true
+*** True Line Result
+ $game.tick
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def set_angles x, y, z~
+- Inside source: true
+*** True Line Result
+ def set_angles x, y, z
+** Processing line: ~ $game.state.angle_x = x~
+- Inside source: true
+*** True Line Result
+ $game.state.angle_x = x
+** Processing line: ~ $game.state.angle_y = y~
+- Inside source: true
+*** True Line Result
+ $game.state.angle_y = y
+** Processing line: ~ $game.state.angle_z = z~
+- Inside source: true
+*** True Line Result
+ $game.state.angle_z = z
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $gtk.reset~
+- Inside source: true
+*** True Line Result
+ $gtk.reset
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** Arcade - Bullet Hell - main.rb~
- Header detected.
*** True Line Result
@@ -93519,18 +96411,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def render_score
-** Processing line: ~ outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label~
+** Processing line: ~ outputs.primitives << { x: 10, y: 710, text: "HI SCORE: #{state.hi_score}", **large_white_typeset }~
- Inside source: true
*** True Line Result
- outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label
-** Processing line: ~ outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label~
+ outputs.primitives << { x: 10, y: 710, text: "HI SCORE: #{state.hi_score}", **large_white_typeset }
+** Processing line: ~ outputs.primitives << { x: 10, y: 680, text: "SCORE: #{state.score}", **large_white_typeset }~
- Inside source: true
*** True Line Result
- outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label
-** Processing line: ~ outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label~
+ outputs.primitives << { x: 10, y: 680, text: "SCORE: #{state.score}", **large_white_typeset }
+** Processing line: ~ outputs.primitives << { x: 10, y: 650, text: "DIFFICULTY: #{state.difficulty.upcase}", **large_white_typeset }~
- Inside source: true
*** True Line Result
- outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label
+ outputs.primitives << { x: 10, y: 650, text: "DIFFICULTY: #{state.difficulty.upcase}", **large_white_typeset }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -93555,54 +96447,54 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]~
+** Processing line: ~ outputs.labels << { x: 640, y: 700, text: "Flappy Dragon", size_enum: 50, alignment_enum: 1, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]
-** Processing line: ~ outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]~
+ outputs.labels << { x: 640, y: 700, text: "Flappy Dragon", size_enum: 50, alignment_enum: 1, **white }
+** Processing line: ~ outputs.labels << { x: 640, y: 500, text: "Instructions: Press Spacebar to flap. Don't die.", size_enum: 4, alignment_enum: 1, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]
-** Processing line: ~ outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]~
+ outputs.labels << { x: 640, y: 500, text: "Instructions: Press Spacebar to flap. Don't die.", size_enum: 4, alignment_enum: 1, **white }
+** Processing line: ~ outputs.labels << { x: 430, y: 430, text: "[Tab] Change difficulty", size_enum: 4, alignment_enum: 0, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]
-** Processing line: ~ outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]~
+ outputs.labels << { x: 430, y: 430, text: "[Tab] Change difficulty", size_enum: 4, alignment_enum: 0, **white }
+** Processing line: ~ outputs.labels << { x: 430, y: 400, text: "[Enter] Start at New Difficulty ", size_enum: 4, alignment_enum: 0, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]
-** Processing line: ~ outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]~
+ outputs.labels << { x: 430, y: 400, text: "[Enter] Start at New Difficulty ", size_enum: 4, alignment_enum: 0, **white }
+** Processing line: ~ outputs.labels << { x: 430, y: 370, text: "[Escape] Cancel/Resume ", size_enum: 4, alignment_enum: 0, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]
-** Processing line: ~ outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]~
+ outputs.labels << { x: 430, y: 370, text: "[Escape] Cancel/Resume ", size_enum: 4, alignment_enum: 0, **white }
+** Processing line: ~ outputs.labels << { x: 640, y: 300, text: "(mouse, touch, and game controllers work, too!) ", size_enum: 4, alignment_enum: 1, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]
-** Processing line: ~ outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]~
+ outputs.labels << { x: 640, y: 300, text: "(mouse, touch, and game controllers work, too!) ", size_enum: 4, alignment_enum: 1, **white }
+** Processing line: ~ outputs.labels << { x: 640, y: 200, text: "Difficulty: #{state.new_difficulty.capitalize}", size_enum: 4, alignment_enum: 1, **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]
+ outputs.labels << { x: 640, y: 200, text: "Difficulty: #{state.new_difficulty.capitalize}", size_enum: 4, alignment_enum: 1, **white }
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]~
+** Processing line: ~ outputs.labels << { x: 10, y: 100, text: "Code: @amirrajan", **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]
-** Processing line: ~ outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]~
+ outputs.labels << { x: 10, y: 100, text: "Code: @amirrajan", **white }
+** Processing line: ~ outputs.labels << { x: 10, y: 80, text: "Art: @mobypixel", **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]
-** Processing line: ~ outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]~
+ outputs.labels << { x: 10, y: 80, text: "Art: @mobypixel", **white }
+** Processing line: ~ outputs.labels << { x: 10, y: 60, text: "Music: @mobypixel", **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]
-** Processing line: ~ outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]~
+ outputs.labels << { x: 10, y: 60, text: "Music: @mobypixel", **white }
+** Processing line: ~ outputs.labels << { x: 10, y: 40, text: "Engine: DragonRuby GTK", **white }~
- Inside source: true
*** True Line Result
- outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]
+ outputs.labels << { x: 10, y: 40, text: "Engine: DragonRuby GTK", **white }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -93615,10 +96507,30 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def render_overlay
-** Processing line: ~ outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid~
+** Processing line: ~ overlay_rect = grid.rect.scale_rect(1.1, 0, 0)~
+- Inside source: true
+*** True Line Result
+ overlay_rect = grid.rect.scale_rect(1.1, 0, 0)
+** Processing line: ~ outputs.primitives << { x: overlay_rect.x,~
+- Inside source: true
+*** True Line Result
+ outputs.primitives << { x: overlay_rect.x,
+** Processing line: ~ y: overlay_rect.y,~
+- Inside source: true
+*** True Line Result
+ y: overlay_rect.y,
+** Processing line: ~ w: overlay_rect.w,~
- Inside source: true
*** True Line Result
- outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid
+ w: overlay_rect.w,
+** Processing line: ~ h: overlay_rect.h,~
+- Inside source: true
+*** True Line Result
+ h: overlay_rect.h,
+** Processing line: ~ r: 0, g: 0, b: 0, a: 230 }.solid!~
+- Inside source: true
+*** True Line Result
+ r: 0, g: 0, b: 0, a: 230 }.solid!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -93667,22 +96579,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
return unless state.scene == :game
-** Processing line: ~ outputs.labels << [638, 358, score_text, 20, 1]~
+** Processing line: ~ outputs.labels << { x: 638, y: 358, text: score_text, size_enum: 20, alignment_enum: 1 }~
- Inside source: true
*** True Line Result
- outputs.labels << [638, 358, score_text, 20, 1]
-** Processing line: ~ outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]~
+ outputs.labels << { x: 638, y: 358, text: score_text, size_enum: 20, alignment_enum: 1 }
+** Processing line: ~ outputs.labels << { x: 635, y: 360, text: score_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }~
- Inside source: true
*** True Line Result
- outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]
-** Processing line: ~ outputs.labels << [638, 428, countdown_text, 20, 1]~
+ outputs.labels << { x: 635, y: 360, text: score_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }
+** Processing line: ~ outputs.labels << { x: 638, y: 428, text: countdown_text, size_enum: 20, alignment_enum: 1 }~
- Inside source: true
*** True Line Result
- outputs.labels << [638, 428, countdown_text, 20, 1]
-** Processing line: ~ outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]~
+ outputs.labels << { x: 638, y: 428, text: countdown_text, size_enum: 20, alignment_enum: 1 }
+** Processing line: ~ outputs.labels << { x: 635, y: 430, text: countdown_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }~
- Inside source: true
*** True Line Result
- outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]
+ outputs.labels << { x: 635, y: 430, text: countdown_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -93695,10 +96607,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def render_background
-** Processing line: ~ outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']~
+** Processing line: ~ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: 'sprites/background.png' }~
- Inside source: true
*** True Line Result
- outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']
+ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: 'sprites/background.png' }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -93743,6 +96655,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def scrolling_background at, path, rate, y = 0~
+- Inside source: true
+*** True Line Result
+ def scrolling_background at, path, rate, y = 0
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ { x: 0 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path },~
+- Inside source: true
+*** True Line Result
+ { x: 0 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path },
+** Processing line: ~ { x: 1440 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path }~
+- Inside source: true
+*** True Line Result
+ { x: 1440 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path }
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def render_walls~
- Inside source: true
*** True Line Result
@@ -93755,14 +96695,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
w.sprites = [
-** Processing line: ~ [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],~
+** Processing line: ~ { x: w.x, y: w.bottom_height - 720, w: 100, h: 720, path: 'sprites/wall.png', angle: 180 },~
- Inside source: true
*** True Line Result
- [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],
-** Processing line: ~ [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]~
+ { x: w.x, y: w.bottom_height - 720, w: 100, h: 720, path: 'sprites/wall.png', angle: 180 },
+** Processing line: ~ { x: w.x, y: w.top_y, w: 100, h: 720, path: 'sprites/wallbottom.png', angle: 0 }~
- Inside source: true
*** True Line Result
- [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]
+ { x: w.x, y: w.top_y, w: 100, h: 720, path: 'sprites/wallbottom.png', angle: 0 }
** Processing line: ~ ]~
- Inside source: true
*** True Line Result
@@ -93795,14 +96735,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ render_debug_hitbox false~
-- Inside source: true
-*** True Line Result
- render_debug_hitbox false
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ if state.show_death == false || !state.death_at~
- Inside source: true
*** True Line Result
@@ -93815,10 +96747,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png"
-** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~
+** Processing line: ~ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }~
- Inside source: true
*** True Line Result
- state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]
+ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }
** Processing line: ~ else~
- Inside source: true
*** True Line Result
@@ -93827,10 +96759,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
sprite_name = "sprites/dragon_die.png"
-** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~
+** Processing line: ~ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }~
- Inside source: true
*** True Line Result
- state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]
+ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }
** Processing line: ~ sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds~
- Inside source: true
*** True Line Result
@@ -93867,38 +96799,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def render_debug_hitbox show~
-- Inside source: true
-*** True Line Result
- def render_debug_hitbox show
-** Processing line: ~ return unless show~
-- Inside source: true
-*** True Line Result
- return unless show
-** Processing line: ~ outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite~
-- Inside source: true
-*** True Line Result
- outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite
-** Processing line: ~ outputs.borders << state.walls.flat_map do |w|~
-- Inside source: true
-*** True Line Result
- outputs.borders << state.walls.flat_map do |w|
-** Processing line: ~ w.sprites.map { |s| [s.rect, 255, 0, 0] }~
-- Inside source: true
-*** True Line Result
- w.sprites.map { |s| [s.rect, 255, 0, 0] }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ def render_flash~
- Inside source: true
*** True Line Result
@@ -93911,18 +96811,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ outputs.primitives << [grid.rect,~
+** Processing line: ~ outputs.primitives << { **grid.rect.to_hash,~
- Inside source: true
*** True Line Result
- outputs.primitives << [grid.rect,
-** Processing line: ~ white,~
+ outputs.primitives << { **grid.rect.to_hash,
+** Processing line: ~ **white,~
- Inside source: true
*** True Line Result
- white,
-** Processing line: ~ 255 * state.flash_at.ease(20, :flip)].solid~
+ **white,
+** Processing line: ~ a: 255 * state.flash_at.ease(20, :flip) }.solid!~
- Inside source: true
*** True Line Result
- 255 * state.flash_at.ease(20, :flip)].solid
+ a: 255 * state.flash_at.ease(20, :flip) }.solid!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -94399,42 +97299,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def scrolling_background at, path, rate, y = 0~
-- Inside source: true
-*** True Line Result
- def scrolling_background at, path, rate, y = 0
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ [ 0 - at.*(rate) % 1440, y, 1440, 720, path],~
-- Inside source: true
-*** True Line Result
- [ 0 - at.*(rate) % 1440, y, 1440, 720, path],
-** Processing line: ~ [1440 - at.*(rate) % 1440, y, 1440, 720, path]~
-- Inside source: true
-*** True Line Result
- [1440 - at.*(rate) % 1440, y, 1440, 720, path]
-** Processing line: ~ ]~
-- Inside source: true
-*** True Line Result
- ]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ def white~
- Inside source: true
*** True Line Result
def white
-** Processing line: ~ [255, 255, 255]~
+** Processing line: ~ { r: 255, g: 255, b: 255 }~
- Inside source: true
*** True Line Result
- [255, 255, 255]
+ { r: 255, g: 255, b: 255 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -94447,10 +97319,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def large_white_typeset
-** Processing line: ~ [5, 0, 255, 255, 255]~
+** Processing line: ~ { size_enum: 5, alignment_enum: 0, r: 255, g: 255, b: 255 }~
- Inside source: true
*** True Line Result
- [5, 0, 255, 255, 255]
+ { size_enum: 5, alignment_enum: 0, r: 255, g: 255, b: 255 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -94483,18 +97355,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
state.dragon_sprite
-** Processing line: ~ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)~
+** Processing line: ~ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)~
- Inside source: true
*** True Line Result
- .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)
-** Processing line: ~ .rect_shift_right(10)~
+ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)
+** Processing line: ~ .rect_shift_right(10)~
- Inside source: true
*** True Line Result
- .rect_shift_right(10)
-** Processing line: ~ .rect_shift_up(state.dy * 2)~
+ .rect_shift_right(10)
+** Processing line: ~ .rect_shift_up(state.dy * 2)~
- Inside source: true
*** True Line Result
- .rect_shift_up(state.dy * 2)
+ .rect_shift_up(state.dy * 2)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -94527,10 +97399,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
.any? do |s|
-** Processing line: ~ s.intersect_rect?(dragon_collision_box)~
+** Processing line: ~ s && s.intersect_rect?(dragon_collision_box)~
- Inside source: true
*** True Line Result
- s.intersect_rect?(dragon_collision_box)
+ s && s.intersect_rect?(dragon_collision_box)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -100123,1262 +102995,6 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
-** Processing line: ~*** Crafting - Farming Game Starting Point - repl.rb~
-- Header detected.
-*** True Line Result
-
-*** True Line Result
-*** Crafting - Farming Game Starting Point - repl.rb
-** Processing line: ~#+begin_src ruby~
-- Line was identified as the beginning of a code block.
-*** True Line Result
-
-*** True Line Result
-#+begin_src ruby
-** Processing line: ~ # ./samples/99_genre_crafting/farming_game_starting_point/app/repl.rb~
-- Inside source: true
-*** True Line Result
- # ./samples/99_genre_crafting/farming_game_starting_point/app/repl.rb
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~ # Welcome to repl.rb~
-- Inside source: true
-*** True Line Result
- # Welcome to repl.rb
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~ # You can experiement with code within this file. Code in this~
-- Inside source: true
-*** True Line Result
- # You can experiement with code within this file. Code in this
-** Processing line: ~ # file is only executed when you save (and only excecuted ONCE).~
-- Inside source: true
-*** True Line Result
- # file is only executed when you save (and only excecuted ONCE).
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~ # REMOVE the "x" from the word "xrepl" and save the file to RUN~
-- Inside source: true
-*** True Line Result
- # REMOVE the "x" from the word "xrepl" and save the file to RUN
-** Processing line: ~ # the code in between the do/end block delimiters.~
-- Inside source: true
-*** True Line Result
- # the code in between the do/end block delimiters.
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~ # ADD the "x" to the word "repl" (make it xrepl) and save the~
-- Inside source: true
-*** True Line Result
- # ADD the "x" to the word "repl" (make it xrepl) and save the
-** Processing line: ~ # file to IGNORE the code in between the do/end block delimiters.~
-- Inside source: true
-*** True Line Result
- # file to IGNORE the code in between the do/end block delimiters.
-** Processing line: ~ # ===============================================================~
-- Inside source: true
-*** True Line Result
- # ===============================================================
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ puts "The result of 1 + 2 is: #{1 + 2}"~
-- Inside source: true
-*** True Line Result
- puts "The result of 1 + 2 is: #{1 + 2}"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Ruby Crash Course:~
-- Inside source: true
-*** True Line Result
- # Ruby Crash Course:
-** Processing line: ~ # Strings, Numeric, Booleans, Conditionals, Looping, Enumerables, Arrays~
-- Inside source: true
-*** True Line Result
- # Strings, Numeric, Booleans, Conditionals, Looping, Enumerables, Arrays
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Strings~
-- Inside source: true
-*** True Line Result
- # Strings
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ message = "Hello World"~
-- Inside source: true
-*** True Line Result
- message = "Hello World"
-** Processing line: ~ puts "The value of message is: " + message~
-- Inside source: true
-*** True Line Result
- puts "The value of message is: " + message
-** Processing line: ~ puts "Any value can be interpolated within a string using \#{}."~
-- Inside source: true
-*** True Line Result
- puts "Any value can be interpolated within a string using \#{}."
-** Processing line: ~ puts "Interpolated message: #{message}."~
-- Inside source: true
-*** True Line Result
- puts "Interpolated message: #{message}."
-** Processing line: ~ puts 'This #{message} is not interpolated because the string uses single quotes.'~
-- Inside source: true
-*** True Line Result
- puts 'This #{message} is not interpolated because the string uses single quotes.'
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Numerics~
-- Inside source: true
-*** True Line Result
- # Numerics
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ a = 10~
-- Inside source: true
-*** True Line Result
- a = 10
-** Processing line: ~ puts "The value of a is: #{a}"~
-- Inside source: true
-*** True Line Result
- puts "The value of a is: #{a}"
-** Processing line: ~ puts "a + 1 is: #{a + 1}"~
-- Inside source: true
-*** True Line Result
- puts "a + 1 is: #{a + 1}"
-** Processing line: ~ puts "a / 3 is: #{a / 3}"~
-- Inside source: true
-*** True Line Result
- puts "a / 3 is: #{a / 3}"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ b = 10.12~
-- Inside source: true
-*** True Line Result
- b = 10.12
-** Processing line: ~ puts "The value of b is: #{b}"~
-- Inside source: true
-*** True Line Result
- puts "The value of b is: #{b}"
-** Processing line: ~ puts "b + 1 is: #{b + 1}"~
-- Inside source: true
-*** True Line Result
- puts "b + 1 is: #{b + 1}"
-** Processing line: ~ puts "b as an integer is: #{b.to_i}"~
-- Inside source: true
-*** True Line Result
- puts "b as an integer is: #{b.to_i}"
-** Processing line: ~ puts ''~
-- Inside source: true
-*** True Line Result
- puts ''
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Booleans~
-- Inside source: true
-*** True Line Result
- # Booleans
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ c = 30~
-- Inside source: true
-*** True Line Result
- c = 30
-** Processing line: ~ puts "The value of c is #{c}."~
-- Inside source: true
-*** True Line Result
- puts "The value of c is #{c}."
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if c~
-- Inside source: true
-*** True Line Result
- if c
-** Processing line: ~ puts "This if statement ran because c is truthy."~
-- Inside source: true
-*** True Line Result
- puts "This if statement ran because c is truthy."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ d = false~
-- Inside source: true
-*** True Line Result
- d = false
-** Processing line: ~ puts "The value of d is #{d}."~
-- Inside source: true
-*** True Line Result
- puts "The value of d is #{d}."
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if !d~
-- Inside source: true
-*** True Line Result
- if !d
-** Processing line: ~ puts "This if statement ran because d is falsey, using the not operator (!) makes d evaluate to true."~
-- Inside source: true
-*** True Line Result
- puts "This if statement ran because d is falsey, using the not operator (!) makes d evaluate to true."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ e = nil~
-- Inside source: true
-*** True Line Result
- e = nil
-** Processing line: ~ puts "Nil is also considered falsey. The value of e is: #{e}."~
-- Inside source: true
-*** True Line Result
- puts "Nil is also considered falsey. The value of e is: #{e}."
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if !e~
-- Inside source: true
-*** True Line Result
- if !e
-** Processing line: ~ puts "This if statement ran because e is nil (a falsey value)."~
-- Inside source: true
-*** True Line Result
- puts "This if statement ran because e is nil (a falsey value)."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Conditionals~
-- Inside source: true
-*** True Line Result
- # Conditionals
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ i_am_true = true~
-- Inside source: true
-*** True Line Result
- i_am_true = true
-** Processing line: ~ i_am_nil = nil~
-- Inside source: true
-*** True Line Result
- i_am_nil = nil
-** Processing line: ~ i_am_false = false~
-- Inside source: true
-*** True Line Result
- i_am_false = false
-** Processing line: ~ i_am_hi = "hi"~
-- Inside source: true
-*** True Line Result
- i_am_hi = "hi"
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== if statement"~
-- Inside source: true
-*** True Line Result
- puts "======== if statement"
-** Processing line: ~ i_am_one = 1~
-- Inside source: true
-*** True Line Result
- i_am_one = 1
-** Processing line: ~ if i_am_one~
-- Inside source: true
-*** True Line Result
- if i_am_one
-** Processing line: ~ puts "This was printed because i_am_one is truthy."~
-- Inside source: true
-*** True Line Result
- puts "This was printed because i_am_one is truthy."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== if/else statement"~
-- Inside source: true
-*** True Line Result
- puts "======== if/else statement"
-** Processing line: ~ if i_am_false~
-- Inside source: true
-*** True Line Result
- if i_am_false
-** Processing line: ~ puts "This will NOT get printed because i_am_false is false."~
-- Inside source: true
-*** True Line Result
- puts "This will NOT get printed because i_am_false is false."
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ puts "This was printed because i_am_false is false."~
-- Inside source: true
-*** True Line Result
- puts "This was printed because i_am_false is false."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== if/elsif/else statement"~
-- Inside source: true
-*** True Line Result
- puts "======== if/elsif/else statement"
-** Processing line: ~ if i_am_false~
-- Inside source: true
-*** True Line Result
- if i_am_false
-** Processing line: ~ puts "This will NOT get printed because i_am_false is false."~
-- Inside source: true
-*** True Line Result
- puts "This will NOT get printed because i_am_false is false."
-** Processing line: ~ elsif i_am_true~
-- Inside source: true
-*** True Line Result
- elsif i_am_true
-** Processing line: ~ puts "This was printed because i_am_true is true."~
-- Inside source: true
-*** True Line Result
- puts "This was printed because i_am_true is true."
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ puts "This will NOT get printed i_am_true was true."~
-- Inside source: true
-*** True Line Result
- puts "This will NOT get printed i_am_true was true."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== case statement "~
-- Inside source: true
-*** True Line Result
- puts "======== case statement "
-** Processing line: ~ i_am_one = 1~
-- Inside source: true
-*** True Line Result
- i_am_one = 1
-** Processing line: ~ case i_am_one~
-- Inside source: true
-*** True Line Result
- case i_am_one
-** Processing line: ~ when 10~
-- Inside source: true
-*** True Line Result
- when 10
-** Processing line: ~ puts "case equaled: 10"~
-- Inside source: true
-*** True Line Result
- puts "case equaled: 10"
-** Processing line: ~ when 9~
-- Inside source: true
-*** True Line Result
- when 9
-** Processing line: ~ puts "case equaled: 9"~
-- Inside source: true
-*** True Line Result
- puts "case equaled: 9"
-** Processing line: ~ when 5~
-- Inside source: true
-*** True Line Result
- when 5
-** Processing line: ~ puts "case equaled: 5"~
-- Inside source: true
-*** True Line Result
- puts "case equaled: 5"
-** Processing line: ~ when 1~
-- Inside source: true
-*** True Line Result
- when 1
-** Processing line: ~ puts "case equaled: 1"~
-- Inside source: true
-*** True Line Result
- puts "case equaled: 1"
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ puts "Value wasn't cased."~
-- Inside source: true
-*** True Line Result
- puts "Value wasn't cased."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== different types of comparisons"~
-- Inside source: true
-*** True Line Result
- puts "======== different types of comparisons"
-** Processing line: ~ if 4 == 4~
-- Inside source: true
-*** True Line Result
- if 4 == 4
-** Processing line: ~ puts "equal (4 == 4)"~
-- Inside source: true
-*** True Line Result
- puts "equal (4 == 4)"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if 4 != 3~
-- Inside source: true
-*** True Line Result
- if 4 != 3
-** Processing line: ~ puts "not equal (4 != 3)"~
-- Inside source: true
-*** True Line Result
- puts "not equal (4 != 3)"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if 3 < 4~
-- Inside source: true
-*** True Line Result
- if 3 < 4
-** Processing line: ~ puts "less than (3 < 4)"~
-- Inside source: true
-*** True Line Result
- puts "less than (3 < 4)"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if 4 > 3~
-- Inside source: true
-*** True Line Result
- if 4 > 3
-** Processing line: ~ puts "greater than (4 > 3)"~
-- Inside source: true
-*** True Line Result
- puts "greater than (4 > 3)"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if ((4 > 3) || (3 < 4) || false)~
-- Inside source: true
-*** True Line Result
- if ((4 > 3) || (3 < 4) || false)
-** Processing line: ~ puts "or statement ((4 > 3) || (3 < 4) || false)"~
-- Inside source: true
-*** True Line Result
- puts "or statement ((4 > 3) || (3 < 4) || false)"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if ((4 > 3) && (3 < 4))~
-- Inside source: true
-*** True Line Result
- if ((4 > 3) && (3 < 4))
-** Processing line: ~ puts "and statement ((4 > 3) && (3 < 4))"~
-- Inside source: true
-*** True Line Result
- puts "and statement ((4 > 3) && (3 < 4))"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Looping~
-- Inside source: true
-*** True Line Result
- # Looping
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ puts "======== times block"~
-- Inside source: true
-*** True Line Result
- puts "======== times block"
-** Processing line: ~ 3.times do |i|~
-- Inside source: true
-*** True Line Result
- 3.times do |i|
-** Processing line: ~ puts i~
-- Inside source: true
-*** True Line Result
- puts i
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ puts "======== range block exclusive"~
-- Inside source: true
-*** True Line Result
- puts "======== range block exclusive"
-** Processing line: ~ (0...3).each do |i|~
-- Inside source: true
-*** True Line Result
- (0...3).each do |i|
-** Processing line: ~ puts i~
-- Inside source: true
-*** True Line Result
- puts i
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ puts "======== range block inclusive"~
-- Inside source: true
-*** True Line Result
- puts "======== range block inclusive"
-** Processing line: ~ (0..3).each do |i|~
-- Inside source: true
-*** True Line Result
- (0..3).each do |i|
-** Processing line: ~ puts i~
-- Inside source: true
-*** True Line Result
- puts i
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Enumerables~
-- Inside source: true
-*** True Line Result
- # Enumerables
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ puts "======== array each"~
-- Inside source: true
-*** True Line Result
- puts "======== array each"
-** Processing line: ~ colors = ["red", "blue", "yellow"]~
-- Inside source: true
-*** True Line Result
- colors = ["red", "blue", "yellow"]
-** Processing line: ~ colors.each do |color|~
-- Inside source: true
-*** True Line Result
- colors.each do |color|
-** Processing line: ~ puts color~
-- Inside source: true
-*** True Line Result
- puts color
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts '======== array each_with_index'~
-- Inside source: true
-*** True Line Result
- puts '======== array each_with_index'
-** Processing line: ~ colors = ["red", "blue", "yellow"]~
-- Inside source: true
-*** True Line Result
- colors = ["red", "blue", "yellow"]
-** Processing line: ~ colors.each_with_index do |color, i|~
-- Inside source: true
-*** True Line Result
- colors.each_with_index do |color, i|
-** Processing line: ~ puts "#{color} at index #{i}"~
-- Inside source: true
-*** True Line Result
- puts "#{color} at index #{i}"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ puts "======== single parameter function"~
-- Inside source: true
-*** True Line Result
- puts "======== single parameter function"
-** Processing line: ~ def add_one_to n~
-- Inside source: true
-*** True Line Result
- def add_one_to n
-** Processing line: ~ n + 5~
-- Inside source: true
-*** True Line Result
- n + 5
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts add_one_to(3)~
-- Inside source: true
-*** True Line Result
- puts add_one_to(3)
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== function with default value"~
-- Inside source: true
-*** True Line Result
- puts "======== function with default value"
-** Processing line: ~ def function_with_default_value v = 10~
-- Inside source: true
-*** True Line Result
- def function_with_default_value v = 10
-** Processing line: ~ v * 10~
-- Inside source: true
-*** True Line Result
- v * 10
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "passing three: #{function_with_default_value(3)}"~
-- Inside source: true
-*** True Line Result
- puts "passing three: #{function_with_default_value(3)}"
-** Processing line: ~ puts "passing nil: #{function_with_default_value}"~
-- Inside source: true
-*** True Line Result
- puts "passing nil: #{function_with_default_value}"
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== Or Equal (||=) operator for nil values"~
-- Inside source: true
-*** True Line Result
- puts "======== Or Equal (||=) operator for nil values"
-** Processing line: ~ def function_with_nil_default_with_local a = nil~
-- Inside source: true
-*** True Line Result
- def function_with_nil_default_with_local a = nil
-** Processing line: ~ result = a~
-- Inside source: true
-*** True Line Result
- result = a
-** Processing line: ~ result ||= "or equal operator was exected and set a default value"~
-- Inside source: true
-*** True Line Result
- result ||= "or equal operator was exected and set a default value"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "passing 'hi': #{function_with_nil_default_with_local 'hi'}"~
-- Inside source: true
-*** True Line Result
- puts "passing 'hi': #{function_with_nil_default_with_local 'hi'}"
-** Processing line: ~ puts "passing nil: #{function_with_nil_default_with_local}"~
-- Inside source: true
-*** True Line Result
- puts "passing nil: #{function_with_nil_default_with_local}"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Arrays~
-- Inside source: true
-*** True Line Result
- # Arrays
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ puts "======== Create an array with the numbers 1 to 10."~
-- Inside source: true
-*** True Line Result
- puts "======== Create an array with the numbers 1 to 10."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ puts one_to_ten~
-- Inside source: true
-*** True Line Result
- puts one_to_ten
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== Create a new array that only contains even numbers from the previous array."~
-- Inside source: true
-*** True Line Result
- puts "======== Create a new array that only contains even numbers from the previous array."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ evens = one_to_ten.find_all do |number|~
-- Inside source: true
-*** True Line Result
- evens = one_to_ten.find_all do |number|
-** Processing line: ~ number % 2 == 0~
-- Inside source: true
-*** True Line Result
- number % 2 == 0
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ puts evens~
-- Inside source: true
-*** True Line Result
- puts evens
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== Create a new array that rejects odd numbers."~
-- Inside source: true
-*** True Line Result
- puts "======== Create a new array that rejects odd numbers."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ also_even = one_to_ten.reject do |number|~
-- Inside source: true
-*** True Line Result
- also_even = one_to_ten.reject do |number|
-** Processing line: ~ number % 2 != 0~
-- Inside source: true
-*** True Line Result
- number % 2 != 0
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ puts also_even~
-- Inside source: true
-*** True Line Result
- puts also_even
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== Create an array that doubles every number."~
-- Inside source: true
-*** True Line Result
- puts "======== Create an array that doubles every number."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ doubled = one_to_ten.map do |number|~
-- Inside source: true
-*** True Line Result
- doubled = one_to_ten.map do |number|
-** Processing line: ~ number * 2~
-- Inside source: true
-*** True Line Result
- number * 2
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ puts doubled~
-- Inside source: true
-*** True Line Result
- puts doubled
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== Create an array that selects only odd numbers and then multiply those by 10."~
-- Inside source: true
-*** True Line Result
- puts "======== Create an array that selects only odd numbers and then multiply those by 10."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ odd_doubled = one_to_ten.find_all do |number|~
-- Inside source: true
-*** True Line Result
- odd_doubled = one_to_ten.find_all do |number|
-** Processing line: ~ number % 2 != 0~
-- Inside source: true
-*** True Line Result
- number % 2 != 0
-** Processing line: ~ end.map do |odd_number|~
-- Inside source: true
-*** True Line Result
- end.map do |odd_number|
-** Processing line: ~ odd_number * 10~
-- Inside source: true
-*** True Line Result
- odd_number * 10
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ puts odd_doubled~
-- Inside source: true
-*** True Line Result
- puts odd_doubled
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== All combination of numbers 1 to 10."~
-- Inside source: true
-*** True Line Result
- puts "======== All combination of numbers 1 to 10."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ all_combinations = one_to_ten.product(one_to_ten)~
-- Inside source: true
-*** True Line Result
- all_combinations = one_to_ten.product(one_to_ten)
-** Processing line: ~ puts all_combinations~
-- Inside source: true
-*** True Line Result
- puts all_combinations
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ puts "======== All uniq combinations of numbers. For example: [1, 2] is the same as [2, 1]."~
-- Inside source: true
-*** True Line Result
- puts "======== All uniq combinations of numbers. For example: [1, 2] is the same as [2, 1]."
-** Processing line: ~ one_to_ten = (1..10).to_a~
-- Inside source: true
-*** True Line Result
- one_to_ten = (1..10).to_a
-** Processing line: ~ uniq_combinations =~
-- Inside source: true
-*** True Line Result
- uniq_combinations =
-** Processing line: ~ one_to_ten.product(one_to_ten)~
-- Inside source: true
-*** True Line Result
- one_to_ten.product(one_to_ten)
-** Processing line: ~ .map do |unsorted_number|~
-- Inside source: true
-*** True Line Result
- .map do |unsorted_number|
-** Processing line: ~ unsorted_number.sort~
-- Inside source: true
-*** True Line Result
- unsorted_number.sort
-** Processing line: ~ end.uniq~
-- Inside source: true
-*** True Line Result
- end.uniq
-** Processing line: ~ puts uniq_combinations~
-- Inside source: true
-*** True Line Result
- puts uniq_combinations
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Advanced Arrays~
-- Inside source: true
-*** True Line Result
- # Advanced Arrays
-** Processing line: ~ # ====================================================================================~
-- Inside source: true
-*** True Line Result
- # ====================================================================================
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-- Inside source: true
-*** True Line Result
- # Remove the x from xrepl to run the code. Add the x back to ignore to code.
-** Processing line: ~ xrepl do~
-- Inside source: true
-*** True Line Result
- xrepl do
-** Processing line: ~ puts "======== All unique Pythagorean Triples between 1 and 40 sorted by area of the triangle."~
-- Inside source: true
-*** True Line Result
- puts "======== All unique Pythagorean Triples between 1 and 40 sorted by area of the triangle."
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ one_to_hundred = (1..40).to_a~
-- Inside source: true
-*** True Line Result
- one_to_hundred = (1..40).to_a
-** Processing line: ~ triples =~
-- Inside source: true
-*** True Line Result
- triples =
-** Processing line: ~ one_to_hundred.product(one_to_hundred).map do |width, height|~
-- Inside source: true
-*** True Line Result
- one_to_hundred.product(one_to_hundred).map do |width, height|
-** Processing line: ~ [width, height, Math.sqrt(width ** 2 + height ** 2)]~
-- Inside source: true
-*** True Line Result
- [width, height, Math.sqrt(width ** 2 + height ** 2)]
-** Processing line: ~ end.find_all do |_, _, hypotenuse|~
-- Inside source: true
-*** True Line Result
- end.find_all do |_, _, hypotenuse|
-** Processing line: ~ hypotenuse.to_i == hypotenuse~
-- Inside source: true
-*** True Line Result
- hypotenuse.to_i == hypotenuse
-** Processing line: ~ end.map do |triangle|~
-- Inside source: true
-*** True Line Result
- end.map do |triangle|
-** Processing line: ~ triangle.map(&:to_i)~
-- Inside source: true
-*** True Line Result
- triangle.map(&:to_i)
-** Processing line: ~ end.uniq do |triangle|~
-- Inside source: true
-*** True Line Result
- end.uniq do |triangle|
-** Processing line: ~ triangle.sort~
-- Inside source: true
-*** True Line Result
- triangle.sort
-** Processing line: ~ end.map do |width, height, hypotenuse|~
-- Inside source: true
-*** True Line Result
- end.map do |width, height, hypotenuse|
-** Processing line: ~ [width, height, hypotenuse, (width * height) / 2]~
-- Inside source: true
-*** True Line Result
- [width, height, hypotenuse, (width * height) / 2]
-** Processing line: ~ end.sort_by do |_, _, _, area|~
-- Inside source: true
-*** True Line Result
- end.sort_by do |_, _, _, area|
-** Processing line: ~ area~
-- Inside source: true
-*** True Line Result
- area
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ triples.each do |width, height, hypotenuse, area|~
-- Inside source: true
-*** True Line Result
- triples.each do |width, height, hypotenuse, area|
-** Processing line: ~ puts "(#{width}, #{height}, #{hypotenuse}) = #{area}"~
-- Inside source: true
-*** True Line Result
- puts "(#{width}, #{height}, #{hypotenuse}) = #{area}"
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~#+end_src~
-- Line was identified as the end of a code block.
-*** True Line Result
-#+end_src
-** Processing line: ~~
-- End of paragraph detected.
-*** True Line Result
-
** Processing line: ~*** Crafting - Farming Game Starting Point - tests.rb~
- Header detected.
*** True Line Result
@@ -114059,42 +115675,366 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
-** Processing line: ~*** Platformer - Clepto Frog - main.rb~
+** Processing line: ~*** Mario - Jumping - main.rb~
- Header detected.
*** True Line Result
*** True Line Result
-*** Platformer - Clepto Frog - main.rb
+*** Mario - Jumping - main.rb
** Processing line: ~#+begin_src ruby~
- Line was identified as the beginning of a code block.
*** True Line Result
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/main.rb~
+** Processing line: ~ # ./samples/99_genre_mario/01_jumping/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/99_genre_platformer/clepto_frog/app/main.rb
-** Processing line: ~ MAP_FILE_PATH = 'app/map.txt'~
+ # ./samples/99_genre_mario/01_jumping/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ defaults args~
+- Inside source: true
+*** True Line Result
+ defaults args
+** Processing line: ~ render args~
+- Inside source: true
+*** True Line Result
+ render args
+** Processing line: ~ input args~
- Inside source: true
*** True Line Result
- MAP_FILE_PATH = 'app/map.txt'
+ input args
+** Processing line: ~ calc args~
+- Inside source: true
+*** True Line Result
+ calc args
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ require 'app/map.rb'~
+** Processing line: ~ def defaults args~
- Inside source: true
*** True Line Result
- require 'app/map.rb'
+ def defaults args
+** Processing line: ~ args.state.player.x ||= args.grid.w.half~
+- Inside source: true
+*** True Line Result
+ args.state.player.x ||= args.grid.w.half
+** Processing line: ~ args.state.player.y ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.y ||= 0
+** Processing line: ~ args.state.player.size ||= 100~
+- Inside source: true
+*** True Line Result
+ args.state.player.size ||= 100
+** Processing line: ~ args.state.player.dy ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy ||= 0
+** Processing line: ~ args.state.player.action ||= :jumping~
+- Inside source: true
+*** True Line Result
+ args.state.player.action ||= :jumping
+** Processing line: ~ args.state.jump.power = 20~
+- Inside source: true
+*** True Line Result
+ args.state.jump.power = 20
+** Processing line: ~ args.state.jump.increase_frames = 10~
+- Inside source: true
+*** True Line Result
+ args.state.jump.increase_frames = 10
+** Processing line: ~ args.state.jump.increase_power = 1~
+- Inside source: true
+*** True Line Result
+ args.state.jump.increase_power = 1
+** Processing line: ~ args.state.gravity = -1~
+- Inside source: true
+*** True Line Result
+ args.state.gravity = -1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ class CleptoFrog~
+** Processing line: ~ def render args~
- Inside source: true
*** True Line Result
- class CleptoFrog
+ def render args
+** Processing line: ~ args.outputs.sprites << {~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << {
+** Processing line: ~ x: args.state.player.x -~
+- Inside source: true
+*** True Line Result
+ x: args.state.player.x -
+** Processing line: ~ args.state.player.size.half,~
+- Inside source: true
+*** True Line Result
+ args.state.player.size.half,
+** Processing line: ~ y: args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ y: args.state.player.y,
+** Processing line: ~ w: args.state.player.size,~
+- Inside source: true
+*** True Line Result
+ w: args.state.player.size,
+** Processing line: ~ h: args.state.player.size,~
+- Inside source: true
+*** True Line Result
+ h: args.state.player.size,
+** Processing line: ~ path: 'sprites/square/red.png'~
+- Inside source: true
+*** True Line Result
+ path: 'sprites/square/red.png'
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def input args~
+- Inside source: true
+*** True Line Result
+ def input args
+** Processing line: ~ if args.inputs.keyboard.key_down.space~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_down.space
+** Processing line: ~ if args.state.player.action == :standing~
+- Inside source: true
+*** True Line Result
+ if args.state.player.action == :standing
+** Processing line: ~ args.state.player.action = :jumping~
+- Inside source: true
+*** True Line Result
+ args.state.player.action = :jumping
+** Processing line: ~ args.state.player.dy = args.state.jump.power~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy = args.state.jump.power
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # record when the action took place~
+- Inside source: true
+*** True Line Result
+ # record when the action took place
+** Processing line: ~ current_frame = args.state.tick_count~
+- Inside source: true
+*** True Line Result
+ current_frame = args.state.tick_count
+** Processing line: ~ args.state.player.action_at = current_frame~
+- Inside source: true
+*** True Line Result
+ args.state.player.action_at = current_frame
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # if the space bar is being held~
+- Inside source: true
+*** True Line Result
+ # if the space bar is being held
+** Processing line: ~ if args.inputs.keyboard.key_held.space~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_held.space
+** Processing line: ~ # is the player jumping~
+- Inside source: true
+*** True Line Result
+ # is the player jumping
+** Processing line: ~ is_jumping = args.state.player.action == :jumping~
+- Inside source: true
+*** True Line Result
+ is_jumping = args.state.player.action == :jumping
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # when was the jump performed~
+- Inside source: true
+*** True Line Result
+ # when was the jump performed
+** Processing line: ~ time_of_jump = args.state.player.action_at~
+- Inside source: true
+*** True Line Result
+ time_of_jump = args.state.player.action_at
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # how much time has passed since the jump~
+- Inside source: true
+*** True Line Result
+ # how much time has passed since the jump
+** Processing line: ~ jump_elapsed_time = time_of_jump.elapsed_time~
+- Inside source: true
+*** True Line Result
+ jump_elapsed_time = time_of_jump.elapsed_time
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # how much time is allowed for increasing power~
+- Inside source: true
+*** True Line Result
+ # how much time is allowed for increasing power
+** Processing line: ~ time_allowed = args.state.jump.increase_frames~
+- Inside source: true
+*** True Line Result
+ time_allowed = args.state.jump.increase_frames
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # if the player is jumping~
+- Inside source: true
+*** True Line Result
+ # if the player is jumping
+** Processing line: ~ # and the elapsed time is less than~
+- Inside source: true
+*** True Line Result
+ # and the elapsed time is less than
+** Processing line: ~ # the allowed time~
+- Inside source: true
+*** True Line Result
+ # the allowed time
+** Processing line: ~ if is_jumping && jump_elapsed_time < time_allowed~
+- Inside source: true
+*** True Line Result
+ if is_jumping && jump_elapsed_time < time_allowed
+** Processing line: ~ # increase the dy by the increase power~
+- Inside source: true
+*** True Line Result
+ # increase the dy by the increase power
+** Processing line: ~ power_to_add = args.state.jump.increase_power~
+- Inside source: true
+*** True Line Result
+ power_to_add = args.state.jump.increase_power
+** Processing line: ~ args.state.player.dy += power_to_add~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy += power_to_add
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc args~
+- Inside source: true
+*** True Line Result
+ def calc args
+** Processing line: ~ if args.state.player.action == :jumping~
+- Inside source: true
+*** True Line Result
+ if args.state.player.action == :jumping
+** Processing line: ~ args.state.player.y += args.state.player.dy~
+- Inside source: true
+*** True Line Result
+ args.state.player.y += args.state.player.dy
+** Processing line: ~ args.state.player.dy += args.state.gravity~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy += args.state.gravity
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.state.player.y < 0~
+- Inside source: true
+*** True Line Result
+ if args.state.player.y < 0
+** Processing line: ~ args.state.player.y = 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.y = 0
+** Processing line: ~ args.state.player.action = :standing~
+- Inside source: true
+*** True Line Result
+ args.state.player.action = :standing
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~*** Mario - Jumping And Collisions - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Mario - Jumping And Collisions - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/99_genre_mario/02_jumping_and_collisions/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_mario/02_jumping_and_collisions/app/main.rb
+** Processing line: ~ class Game~
+- Inside source: true
+*** True Line Result
+ class Game
** Processing line: ~ attr_gtk~
- Inside source: true
*** True Line Result
@@ -114103,78 +116043,466 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def render_ending~
+** Processing line: ~ def tick~
- Inside source: true
*** True Line Result
- def render_ending
-** Processing line: ~ state.game_over_at ||= state.tick_count~
+ def tick
+** Processing line: ~ defaults~
- Inside source: true
*** True Line Result
- state.game_over_at ||= state.tick_count
+ defaults
+** Processing line: ~ render~
+- Inside source: true
+*** True Line Result
+ render
+** Processing line: ~ input~
+- Inside source: true
+*** True Line Result
+ input
+** Processing line: ~ calc~
+- Inside source: true
+*** True Line Result
+ calc
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~
+** Processing line: ~ def defaults~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 700, "Clepto Frog", 4, 1]
+ def defaults
+** Processing line: ~ return if state.tick_count != 0~
+- Inside source: true
+*** True Line Result
+ return if state.tick_count != 0
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= (state.game_over_at + 120)~
+** Processing line: ~ player.x = 64~
- Inside source: true
*** True Line Result
- if state.tick_count >= (state.game_over_at + 120)
-** Processing line: ~ outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy",~
+ player.x = 64
+** Processing line: ~ player.y = 800~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)]~
+ player.y = 800
+** Processing line: ~ player.size = 50~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)]
+ player.size = 50
+** Processing line: ~ player.dx = 0~
+- Inside source: true
+*** True Line Result
+ player.dx = 0
+** Processing line: ~ player.dy = 0~
+- Inside source: true
+*** True Line Result
+ player.dy = 0
+** Processing line: ~ player.action = :falling~
+- Inside source: true
+*** True Line Result
+ player.action = :falling
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ player.max_speed = 20~
+- Inside source: true
+*** True Line Result
+ player.max_speed = 20
+** Processing line: ~ player.jump_power = 15~
+- Inside source: true
+*** True Line Result
+ player.jump_power = 15
+** Processing line: ~ player.jump_air_time = 15~
+- Inside source: true
+*** True Line Result
+ player.jump_air_time = 15
+** Processing line: ~ player.jump_increase_power = 1~
+- Inside source: true
+*** True Line Result
+ player.jump_increase_power = 1
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ state.gravity = -1~
+- Inside source: true
+*** True Line Result
+ state.gravity = -1
+** Processing line: ~ state.drag = 0.001~
+- Inside source: true
+*** True Line Result
+ state.drag = 0.001
+** Processing line: ~ state.tile_size = 64~
+- Inside source: true
+*** True Line Result
+ state.tile_size = 64
+** Processing line: ~ state.tiles ||= [~
+- Inside source: true
+*** True Line Result
+ state.tiles ||= [
+** Processing line: ~ { ordinal_x: 0, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 0, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 1, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 1, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 2, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 2, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 3, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 3, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 4, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 4, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 5, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 5, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 6, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 6, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 7, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 7, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 8, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 8, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 9, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 9, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 10, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 10, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 11, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 11, ordinal_y: 0 },
+** Processing line: ~ { ordinal_x: 12, ordinal_y: 0 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 12, ordinal_y: 0 },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { ordinal_x: 9, ordinal_y: 3 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 9, ordinal_y: 3 },
+** Processing line: ~ { ordinal_x: 10, ordinal_y: 3 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 10, ordinal_y: 3 },
+** Processing line: ~ { ordinal_x: 11, ordinal_y: 3 },~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 11, ordinal_y: 3 },
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ tiles.each do |t|~
+- Inside source: true
+*** True Line Result
+ tiles.each do |t|
+** Processing line: ~ t.rect = { x: t.ordinal_x * 64,~
+- Inside source: true
+*** True Line Result
+ t.rect = { x: t.ordinal_x * 64,
+** Processing line: ~ y: t.ordinal_y * 64,~
+- Inside source: true
+*** True Line Result
+ y: t.ordinal_y * 64,
+** Processing line: ~ w: 64,~
+- Inside source: true
+*** True Line Result
+ w: 64,
+** Processing line: ~ h: 64 }~
+- Inside source: true
+*** True Line Result
+ h: 64 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= (state.game_over_at + 240)~
+** Processing line: ~ def render~
- Inside source: true
*** True Line Result
- if state.tick_count >= (state.game_over_at + 240)
-** Processing line: ~ outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy",~
+ def render
+** Processing line: ~ render_player~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)]~
+ render_player
+** Processing line: ~ render_tiles~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)]
+ render_tiles
+** Processing line: ~ # render_grid~
+- Inside source: true
+*** True Line Result
+ # render_grid
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def input~
+- Inside source: true
+*** True Line Result
+ def input
+** Processing line: ~ input_jump~
+- Inside source: true
+*** True Line Result
+ input_jump
+** Processing line: ~ input_move~
+- Inside source: true
+*** True Line Result
+ input_move
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc~
+- Inside source: true
+*** True Line Result
+ def calc
+** Processing line: ~ calc_player_rect~
+- Inside source: true
+*** True Line Result
+ calc_player_rect
+** Processing line: ~ calc_left~
+- Inside source: true
+*** True Line Result
+ calc_left
+** Processing line: ~ calc_right~
+- Inside source: true
+*** True Line Result
+ calc_right
+** Processing line: ~ calc_below~
+- Inside source: true
+*** True Line Result
+ calc_below
+** Processing line: ~ calc_above~
+- Inside source: true
+*** True Line Result
+ calc_above
+** Processing line: ~ calc_player_dy~
+- Inside source: true
+*** True Line Result
+ calc_player_dy
+** Processing line: ~ calc_player_dx~
+- Inside source: true
+*** True Line Result
+ calc_player_dx
+** Processing line: ~ calc_game_over~
+- Inside source: true
+*** True Line Result
+ calc_game_over
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_player~
+- Inside source: true
+*** True Line Result
+ def render_player
+** Processing line: ~ outputs.sprites << {~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << {
+** Processing line: ~ x: player.x,~
+- Inside source: true
+*** True Line Result
+ x: player.x,
+** Processing line: ~ y: player.y,~
+- Inside source: true
+*** True Line Result
+ y: player.y,
+** Processing line: ~ w: player.size,~
+- Inside source: true
+*** True Line Result
+ w: player.size,
+** Processing line: ~ h: player.size,~
+- Inside source: true
+*** True Line Result
+ h: player.size,
+** Processing line: ~ path: 'sprites/square/red.png'~
+- Inside source: true
+*** True Line Result
+ path: 'sprites/square/red.png'
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_tiles~
+- Inside source: true
+*** True Line Result
+ def render_tiles
+** Processing line: ~ outputs.sprites << state.tiles.map do |t|~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << state.tiles.map do |t|
+** Processing line: ~ t.merge path: 'sprites/square/white.png',~
+- Inside source: true
+*** True Line Result
+ t.merge path: 'sprites/square/white.png',
+** Processing line: ~ x: t.ordinal_x * 64,~
+- Inside source: true
+*** True Line Result
+ x: t.ordinal_x * 64,
+** Processing line: ~ y: t.ordinal_y * 64,~
+- Inside source: true
+*** True Line Result
+ y: t.ordinal_y * 64,
+** Processing line: ~ w: 64,~
+- Inside source: true
+*** True Line Result
+ w: 64,
+** Processing line: ~ h: 64~
+- Inside source: true
+*** True Line Result
+ h: 64
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= (state.game_over_at + 360)~
+** Processing line: ~ def render_grid~
- Inside source: true
*** True Line Result
- if state.tick_count >= (state.game_over_at + 360)
-** Processing line: ~ outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy",~
+ def render_grid
+** Processing line: ~ if state.tick_count == 0~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)]~
+ if state.tick_count == 0
+** Processing line: ~ outputs[:grid].background_color = [0, 0, 0, 0]~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)]
+ outputs[:grid].background_color = [0, 0, 0, 0]
+** Processing line: ~ outputs[:grid].borders << available_brick_locations~
+- Inside source: true
+*** True Line Result
+ outputs[:grid].borders << available_brick_locations
+** Processing line: ~ outputs[:grid].labels << available_brick_locations.map do |b|~
+- Inside source: true
+*** True Line Result
+ outputs[:grid].labels << available_brick_locations.map do |b|
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ b.merge(text: "#{b.ordinal_x},#{b.ordinal_y}",~
+- Inside source: true
+*** True Line Result
+ b.merge(text: "#{b.ordinal_x},#{b.ordinal_y}",
+** Processing line: ~ x: b.x + 2,~
+- Inside source: true
+*** True Line Result
+ x: b.x + 2,
+** Processing line: ~ y: b.y + 2,~
+- Inside source: true
+*** True Line Result
+ y: b.y + 2,
+** Processing line: ~ size_enum: -3,~
+- Inside source: true
+*** True Line Result
+ size_enum: -3,
+** Processing line: ~ vertical_alignment_enum: 0,~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 0,
+** Processing line: ~ blendmode_enum: 0),~
+- Inside source: true
+*** True Line Result
+ blendmode_enum: 0),
+** Processing line: ~ b.merge(text: "#{b.x},#{b.y}",~
+- Inside source: true
+*** True Line Result
+ b.merge(text: "#{b.x},#{b.y}",
+** Processing line: ~ x: b.x + 2,~
+- Inside source: true
+*** True Line Result
+ x: b.x + 2,
+** Processing line: ~ y: b.y + 2 + 20,~
+- Inside source: true
+*** True Line Result
+ y: b.y + 2 + 20,
+** Processing line: ~ size_enum: -3,~
+- Inside source: true
+*** True Line Result
+ size_enum: -3,
+** Processing line: ~ vertical_alignment_enum: 0,~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 0,
+** Processing line: ~ blendmode_enum: 0)~
+- Inside source: true
+*** True Line Result
+ blendmode_enum: 0)
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -114183,38 +116511,46 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ outputs.sprites << [640 - 50, 360 - 50, 100, 100,~
+** Processing line: ~ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :grid }~
- Inside source: true
*** True Line Result
- outputs.sprites << [640 - 50, 360 - 50, 100, 100,
-** Processing line: ~ "sprites/square-green.png"]~
+ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :grid }
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- "sprites/square-green.png"]
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1]~
+** Processing line: ~ def input_jump~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1]
-** Processing line: ~ outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1]~
+ def input_jump
+** Processing line: ~ if inputs.keyboard.key_down.space~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1]
+ if inputs.keyboard.key_down.space
+** Processing line: ~ player_jump~
+- Inside source: true
+*** True Line Result
+ player_jump
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= (state.game_over_at + 550)~
+** Processing line: ~ if inputs.keyboard.key_held.space~
- Inside source: true
*** True Line Result
- if state.tick_count >= (state.game_over_at + 550)
-** Processing line: ~ restart_game~
+ if inputs.keyboard.key_held.space
+** Processing line: ~ player_jump_increase_air_time~
- Inside source: true
*** True Line Result
- restart_game
+ player_jump_increase_air_time
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -114227,58 +116563,74 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def restart_game~
+** Processing line: ~ def input_move~
- Inside source: true
*** True Line Result
- def restart_game
-** Processing line: ~ state.world = nil~
+ def input_move
+** Processing line: ~ if player.dx.abs < 20~
- Inside source: true
*** True Line Result
- state.world = nil
-** Processing line: ~ state.x = nil~
+ if player.dx.abs < 20
+** Processing line: ~ if inputs.keyboard.left~
- Inside source: true
*** True Line Result
- state.x = nil
-** Processing line: ~ state.y = nil~
+ if inputs.keyboard.left
+** Processing line: ~ player.dx -= 2~
- Inside source: true
*** True Line Result
- state.y = nil
-** Processing line: ~ state.dx = nil~
+ player.dx -= 2
+** Processing line: ~ elsif inputs.keyboard.right~
- Inside source: true
*** True Line Result
- state.dx = nil
-** Processing line: ~ state.dy = nil~
+ elsif inputs.keyboard.right
+** Processing line: ~ player.dx += 2~
- Inside source: true
*** True Line Result
- state.dy = nil
-** Processing line: ~ state.stuff_score = 0~
+ player.dx += 2
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- state.stuff_score = 0
-** Processing line: ~ state.stuff_time = 0~
+ end
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- state.stuff_time = 0
-** Processing line: ~ state.intro_tick_count = nil~
+ end
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- state.intro_tick_count = nil
-** Processing line: ~ defaults~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- defaults
-** Processing line: ~ state.game_start_at = state.tick_count~
+
+** Processing line: ~ def calc_game_over~
- Inside source: true
*** True Line Result
- state.game_start_at = state.tick_count
-** Processing line: ~ state.scene = :game~
+ def calc_game_over
+** Processing line: ~ if player.y < -64~
- Inside source: true
*** True Line Result
- state.scene = :game
-** Processing line: ~ state.game_over_at = nil~
+ if player.y < -64
+** Processing line: ~ player.x = 64~
- Inside source: true
*** True Line Result
- state.game_over_at = nil
+ player.x = 64
+** Processing line: ~ player.y = 800~
+- Inside source: true
+*** True Line Result
+ player.y = 800
+** Processing line: ~ player.dx = 0~
+- Inside source: true
+*** True Line Result
+ player.dx = 0
+** Processing line: ~ player.dy = 0~
+- Inside source: true
+*** True Line Result
+ player.dy = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -114287,66 +116639,610 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def render_intro~
+** Processing line: ~ def calc_player_rect~
- Inside source: true
*** True Line Result
- def render_intro
-** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~
+ def calc_player_rect
+** Processing line: ~ player.rect = player_current_rect~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 700, "Clepto Frog", 4, 1]
-** Processing line: ~ if state.tick_count >= 120~
+ player.rect = player_current_rect
+** Processing line: ~ player.next_rect = player_next_rect~
+- Inside source: true
+*** True Line Result
+ player.next_rect = player_next_rect
+** Processing line: ~ player.prev_rect = player_prev_rect~
- Inside source: true
*** True Line Result
- if state.tick_count >= 120
-** Processing line: ~ outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",~
+ player.prev_rect = player_prev_rect
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_player_dx~
+- Inside source: true
+*** True Line Result
+ def calc_player_dx
+** Processing line: ~ player.dx = player_next_dx~
+- Inside source: true
+*** True Line Result
+ player.dx = player_next_dx
+** Processing line: ~ player.x += player.dx~
+- Inside source: true
+*** True Line Result
+ player.x += player.dx
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 120.ease(60)]~
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_player_dy~
+- Inside source: true
+*** True Line Result
+ def calc_player_dy
+** Processing line: ~ player.y += player.dy~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * 120.ease(60)]
+ player.y += player.dy
+** Processing line: ~ player.dy = player_next_dy~
+- Inside source: true
+*** True Line Result
+ player.dy = player_next_dy
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_below~
+- Inside source: true
+*** True Line Result
+ def calc_below
+** Processing line: ~ return unless player.dy < 0~
+- Inside source: true
+*** True Line Result
+ return unless player.dy < 0
+** Processing line: ~ tiles_below = tiles_find { |t| t.rect.top <= player.prev_rect.y }~
+- Inside source: true
+*** True Line Result
+ tiles_below = tiles_find { |t| t.rect.top <= player.prev_rect.y }
+** Processing line: ~ collision = tiles_find_colliding tiles_below, (player.rect.merge y: player.next_rect.y)~
+- Inside source: true
+*** True Line Result
+ collision = tiles_find_colliding tiles_below, (player.rect.merge y: player.next_rect.y)
+** Processing line: ~ if collision~
+- Inside source: true
+*** True Line Result
+ if collision
+** Processing line: ~ player.y = collision.rect.y + state.tile_size~
+- Inside source: true
+*** True Line Result
+ player.y = collision.rect.y + state.tile_size
+** Processing line: ~ player.dy = 0~
+- Inside source: true
+*** True Line Result
+ player.dy = 0
+** Processing line: ~ player.action = :standing~
+- Inside source: true
+*** True Line Result
+ player.action = :standing
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ player.action = :falling~
+- Inside source: true
+*** True Line Result
+ player.action = :falling
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_left~
+- Inside source: true
+*** True Line Result
+ def calc_left
+** Processing line: ~ return unless player.dx < 0 && player_next_dx < 0~
+- Inside source: true
+*** True Line Result
+ return unless player.dx < 0 && player_next_dx < 0
+** Processing line: ~ tiles_left = tiles_find { |t| t.rect.right <= player.prev_rect.left }~
+- Inside source: true
+*** True Line Result
+ tiles_left = tiles_find { |t| t.rect.right <= player.prev_rect.left }
+** Processing line: ~ collision = tiles_find_colliding tiles_left, (player.rect.merge x: player.next_rect.x)~
+- Inside source: true
+*** True Line Result
+ collision = tiles_find_colliding tiles_left, (player.rect.merge x: player.next_rect.x)
+** Processing line: ~ return unless collision~
+- Inside source: true
+*** True Line Result
+ return unless collision
+** Processing line: ~ player.x = collision.rect.right~
+- Inside source: true
+*** True Line Result
+ player.x = collision.rect.right
+** Processing line: ~ player.dx = 0~
+- Inside source: true
+*** True Line Result
+ player.dx = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_right~
+- Inside source: true
+*** True Line Result
+ def calc_right
+** Processing line: ~ return unless player.dx > 0 && player_next_dx > 0~
+- Inside source: true
+*** True Line Result
+ return unless player.dx > 0 && player_next_dx > 0
+** Processing line: ~ tiles_right = tiles_find { |t| t.rect.left >= player.prev_rect.right }~
+- Inside source: true
+*** True Line Result
+ tiles_right = tiles_find { |t| t.rect.left >= player.prev_rect.right }
+** Processing line: ~ collision = tiles_find_colliding tiles_right, (player.rect.merge x: player.next_rect.x)~
+- Inside source: true
+*** True Line Result
+ collision = tiles_find_colliding tiles_right, (player.rect.merge x: player.next_rect.x)
+** Processing line: ~ return unless collision~
+- Inside source: true
+*** True Line Result
+ return unless collision
+** Processing line: ~ player.x = collision.rect.left - player.rect.w~
+- Inside source: true
+*** True Line Result
+ player.x = collision.rect.left - player.rect.w
+** Processing line: ~ player.dx = 0~
+- Inside source: true
+*** True Line Result
+ player.dx = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_above~
+- Inside source: true
+*** True Line Result
+ def calc_above
+** Processing line: ~ return unless player.dy > 0~
+- Inside source: true
+*** True Line Result
+ return unless player.dy > 0
+** Processing line: ~ tiles_above = tiles_find { |t| t.rect.y >= player.prev_rect.y }~
+- Inside source: true
+*** True Line Result
+ tiles_above = tiles_find { |t| t.rect.y >= player.prev_rect.y }
+** Processing line: ~ collision = tiles_find_colliding tiles_above, (player.rect.merge y: player.next_rect.y)~
+- Inside source: true
+*** True Line Result
+ collision = tiles_find_colliding tiles_above, (player.rect.merge y: player.next_rect.y)
+** Processing line: ~ return unless collision~
+- Inside source: true
+*** True Line Result
+ return unless collision
+** Processing line: ~ player.dy = 0~
+- Inside source: true
+*** True Line Result
+ player.dy = 0
+** Processing line: ~ player.y = collision.rect.bottom - player.rect.h~
+- Inside source: true
+*** True Line Result
+ player.y = collision.rect.bottom - player.rect.h
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_current_rect~
+- Inside source: true
+*** True Line Result
+ def player_current_rect
+** Processing line: ~ { x: player.x, y: player.y, w: player.size, h: player.size }~
+- Inside source: true
+*** True Line Result
+ { x: player.x, y: player.y, w: player.size, h: player.size }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= 240~
+** Processing line: ~ def available_brick_locations~
+- Inside source: true
+*** True Line Result
+ def available_brick_locations
+** Processing line: ~ (0..19).to_a~
- Inside source: true
*** True Line Result
- if state.tick_count >= 240
-** Processing line: ~ outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",~
+ (0..19).to_a
+** Processing line: ~ .product(0..11)~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 240.ease(60)]~
+ .product(0..11)
+** Processing line: ~ .map do |(ordinal_x, ordinal_y)|~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * 240.ease(60)]
+ .map do |(ordinal_x, ordinal_y)|
+** Processing line: ~ { ordinal_x: ordinal_x,~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: ordinal_x,
+** Processing line: ~ ordinal_y: ordinal_y,~
+- Inside source: true
+*** True Line Result
+ ordinal_y: ordinal_y,
+** Processing line: ~ x: ordinal_x * 64,~
+- Inside source: true
+*** True Line Result
+ x: ordinal_x * 64,
+** Processing line: ~ y: ordinal_y * 64,~
+- Inside source: true
+*** True Line Result
+ y: ordinal_y * 64,
+** Processing line: ~ w: 64,~
+- Inside source: true
+*** True Line Result
+ w: 64,
+** Processing line: ~ h: 64 }~
+- Inside source: true
+*** True Line Result
+ h: 64 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player~
+- Inside source: true
+*** True Line Result
+ def player
+** Processing line: ~ state.player ||= args.state.new_entity :player~
+- Inside source: true
+*** True Line Result
+ state.player ||= args.state.new_entity :player
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_next_dy~
+- Inside source: true
+*** True Line Result
+ def player_next_dy
+** Processing line: ~ player.dy + state.gravity + state.drag ** 2 * -1~
+- Inside source: true
+*** True Line Result
+ player.dy + state.gravity + state.drag ** 2 * -1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_next_dx~
+- Inside source: true
+*** True Line Result
+ def player_next_dx
+** Processing line: ~ player.dx * 0.8~
+- Inside source: true
+*** True Line Result
+ player.dx * 0.8
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_next_rect~
+- Inside source: true
+*** True Line Result
+ def player_next_rect
+** Processing line: ~ player.rect.merge x: player.x + player_next_dx,~
+- Inside source: true
+*** True Line Result
+ player.rect.merge x: player.x + player_next_dx,
+** Processing line: ~ y: player.y + player_next_dy~
+- Inside source: true
+*** True Line Result
+ y: player.y + player_next_dy
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_prev_rect~
+- Inside source: true
+*** True Line Result
+ def player_prev_rect
+** Processing line: ~ player.rect.merge x: player.x - player.dx,~
+- Inside source: true
+*** True Line Result
+ player.rect.merge x: player.x - player.dx,
+** Processing line: ~ y: player.y - player.dy~
+- Inside source: true
+*** True Line Result
+ y: player.y - player.dy
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= 360~
+** Processing line: ~ def player_jump~
- Inside source: true
*** True Line Result
- if state.tick_count >= 360
-** Processing line: ~ outputs.labels << [640, 540, "\"Uh...\" - New Guy",~
+ def player_jump
+** Processing line: ~ return if player.action != :standing~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 540, "\"Uh...\" - New Guy",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 360.ease(60)]~
+ return if player.action != :standing
+** Processing line: ~ player.action = :jumping~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * 360.ease(60)]
+ player.action = :jumping
+** Processing line: ~ player.dy = state.player.jump_power~
+- Inside source: true
+*** True Line Result
+ player.dy = state.player.jump_power
+** Processing line: ~ current_frame = state.tick_count~
+- Inside source: true
+*** True Line Result
+ current_frame = state.tick_count
+** Processing line: ~ player.action_at = current_frame~
+- Inside source: true
+*** True Line Result
+ player.action_at = current_frame
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def player_jump_increase_air_time~
+- Inside source: true
+*** True Line Result
+ def player_jump_increase_air_time
+** Processing line: ~ return if player.action != :jumping~
+- Inside source: true
+*** True Line Result
+ return if player.action != :jumping
+** Processing line: ~ return if player.action_at.elapsed_time >= player.jump_air_time~
+- Inside source: true
+*** True Line Result
+ return if player.action_at.elapsed_time >= player.jump_air_time
+** Processing line: ~ player.dy += player.jump_increase_power~
+- Inside source: true
+*** True Line Result
+ player.dy += player.jump_increase_power
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tiles~
+- Inside source: true
+*** True Line Result
+ def tiles
+** Processing line: ~ state.tiles~
+- Inside source: true
+*** True Line Result
+ state.tiles
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tiles_find_colliding tiles, target~
+- Inside source: true
+*** True Line Result
+ def tiles_find_colliding tiles, target
+** Processing line: ~ tiles.find { |t| t.rect.intersect_rect? target }~
+- Inside source: true
+*** True Line Result
+ tiles.find { |t| t.rect.intersect_rect? target }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tiles_find &block~
+- Inside source: true
+*** True Line Result
+ def tiles_find &block
+** Processing line: ~ tiles.find_all(&block)~
+- Inside source: true
+*** True Line Result
+ tiles.find_all(&block)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ $game ||= Game.new~
+- Inside source: true
+*** True Line Result
+ $game ||= Game.new
+** Processing line: ~ $game.args = args~
+- Inside source: true
+*** True Line Result
+ $game.args = args
+** Processing line: ~ $game.tick~
+- Inside source: true
+*** True Line Result
+ $game.tick
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $gtk.reset~
+- Inside source: true
+*** True Line Result
+ $gtk.reset
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~*** Platformer - Clepto Frog - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Platformer - Clepto Frog - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_platformer/clepto_frog/app/main.rb
+** Processing line: ~ MAP_FILE_PATH = 'map.txt'~
+- Inside source: true
+*** True Line Result
+ MAP_FILE_PATH = 'map.txt'
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ require 'app/map.rb'~
+- Inside source: true
+*** True Line Result
+ require 'app/map.rb'
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ class CleptoFrog~
+- Inside source: true
+*** True Line Result
+ class CleptoFrog
+** Processing line: ~ attr_gtk~
+- Inside source: true
+*** True Line Result
+ attr_gtk
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_ending~
+- Inside source: true
+*** True Line Result
+ def render_ending
+** Processing line: ~ state.game_over_at ||= state.tick_count~
+- Inside source: true
+*** True Line Result
+ state.game_over_at ||= state.tick_count
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [640, 700, "Clepto Frog", 4, 1]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if state.tick_count >= (state.game_over_at + 120)~
+- Inside source: true
+*** True Line Result
+ if state.tick_count >= (state.game_over_at + 120)
+** Processing line: ~ outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy",~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [640, 620, "\"I... I.... don't believe it.\" - New Guy",
+** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)]~
+- Inside source: true
+*** True Line Result
+ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 120).ease(60)]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -114355,18 +117251,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= 480~
+** Processing line: ~ if state.tick_count >= (state.game_over_at + 240)~
- Inside source: true
*** True Line Result
- if state.tick_count >= 480
-** Processing line: ~ outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",~
+ if state.tick_count >= (state.game_over_at + 240)
+** Processing line: ~ outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy",~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 480.ease(60)]~
+ outputs.labels << [640, 580, "\"He actually stole all the mugs?\" - New Guy",
+** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)]~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * 480.ease(60)]
+ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 240).ease(60)]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -114375,18 +117271,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count >= 600~
+** Processing line: ~ if state.tick_count >= (state.game_over_at + 360)~
- Inside source: true
*** True Line Result
- if state.tick_count >= 600
-** Processing line: ~ outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",~
+ if state.tick_count >= (state.game_over_at + 360)
+** Processing line: ~ outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy",~
- Inside source: true
*** True Line Result
- outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 600.ease(60)]~
+ outputs.labels << [640, 540, "\"Kind of feel bad STARTING HIM WITH NOTHING again.\" - New Guy",
+** Processing line: ~ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)]~
- Inside source: true
*** True Line Result
- 4, 1, 0, 0, 0, 255 * 600.ease(60)]
+ 4, 1, 0, 0, 0, 255 * (state.game_over_at + 360).ease(60)]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -114407,10 +117303,110 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if state.tick_count == 800~
+** Processing line: ~ outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [640, 300, "Current Time: #{"%.2f" % state.stuff_time}", 4, 1]
+** Processing line: ~ outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [640, 270, "Best Time: #{"%.2f" % state.stuff_best_time}", 4, 1]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if state.tick_count >= (state.game_over_at + 550)~
+- Inside source: true
+*** True Line Result
+ if state.tick_count >= (state.game_over_at + 550)
+** Processing line: ~ restart_game~
+- Inside source: true
+*** True Line Result
+ restart_game
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def restart_game~
+- Inside source: true
+*** True Line Result
+ def restart_game
+** Processing line: ~ state.world = nil~
+- Inside source: true
+*** True Line Result
+ state.world = nil
+** Processing line: ~ state.x = nil~
+- Inside source: true
+*** True Line Result
+ state.x = nil
+** Processing line: ~ state.y = nil~
+- Inside source: true
+*** True Line Result
+ state.y = nil
+** Processing line: ~ state.dx = nil~
+- Inside source: true
+*** True Line Result
+ state.dx = nil
+** Processing line: ~ state.dy = nil~
+- Inside source: true
+*** True Line Result
+ state.dy = nil
+** Processing line: ~ state.stuff_score = 0~
+- Inside source: true
+*** True Line Result
+ state.stuff_score = 0
+** Processing line: ~ state.stuff_time = 0~
+- Inside source: true
+*** True Line Result
+ state.stuff_time = 0
+** Processing line: ~ state.intro_tick_count = nil~
+- Inside source: true
+*** True Line Result
+ state.intro_tick_count = nil
+** Processing line: ~ defaults~
+- Inside source: true
+*** True Line Result
+ defaults
+** Processing line: ~ state.game_start_at = state.tick_count~
+- Inside source: true
+*** True Line Result
+ state.game_start_at = state.tick_count
+** Processing line: ~ state.scene = :game~
+- Inside source: true
+*** True Line Result
+ state.scene = :game
+** Processing line: ~ state.game_over_at = nil~
+- Inside source: true
+*** True Line Result
+ state.game_over_at = nil
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_intro~
+- Inside source: true
+*** True Line Result
+ def render_intro
+** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~
+- Inside source: true
+*** True Line Result
+ outputs.labels << [640, 700, "Clepto Frog", 4, 1]
+** Processing line: ~ if state.tick_count == 120~
- Inside source: true
*** True Line Result
- if state.tick_count == 800
+ if state.tick_count == 120
** Processing line: ~ state.scene = :game~
- Inside source: true
*** True Line Result
@@ -114439,10 +117435,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
defaults
-** Processing line: ~ if state.scene == :intro && state.tick_count <= 800~
+** Processing line: ~ if state.scene == :intro && state.tick_count <= 120~
- Inside source: true
*** True Line Result
- if state.scene == :intro && state.tick_count <= 800
+ if state.scene == :intro && state.tick_count <= 120
** Processing line: ~ render_intro~
- Inside source: true
*** True Line Result
@@ -114851,18 +117847,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# SHOW HIDE COLLISIONS
-** Processing line: ~ outputs.sprites << state.world.map do |x, y, w, h|~
+** Processing line: ~ outputs.sprites << state.world.map do |rect|~
- Inside source: true
*** True Line Result
- outputs.sprites << state.world.map do |x, y, w, h|
-** Processing line: ~ x = vx(x)~
+ outputs.sprites << state.world.map do |rect|
+** Processing line: ~ x = vx(rect.x)~
- Inside source: true
*** True Line Result
- x = vx(x)
-** Processing line: ~ y = vy(y)~
+ x = vx(rect.x)
+** Processing line: ~ y = vy(rect.y)~
- Inside source: true
*** True Line Result
- y = vy(y)
+ y = vy(rect.y)
** Processing line: ~ if x > -80 && x < 1280 && y > -80 && y < 720~
- Inside source: true
*** True Line Result
@@ -114879,14 +117875,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
y: y,
-** Processing line: ~ w: vw(w || state.tile_size),~
+** Processing line: ~ w: vw(rect.w || state.tile_size),~
- Inside source: true
*** True Line Result
- w: vw(w || state.tile_size),
-** Processing line: ~ h: vh(h || state.tile_size),~
+ w: vw(rect.w || state.tile_size),
+** Processing line: ~ h: vh(rect.h || state.tile_size),~
- Inside source: true
*** True Line Result
- h: vh(h || state.tile_size),
+ h: vh(rect.h || state.tile_size),
** Processing line: ~ path: 'sprites/square-gray.png',~
- Inside source: true
*** True Line Result
@@ -114975,14 +117971,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Creates sprite following mouse to help indicate which sprite you have selected
-** Processing line: ~ outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,~
+** Processing line: ~ outputs.primitives << [inputs.mouse.position.x - 32 * state.camera_scale,~
+- Inside source: true
+*** True Line Result
+ outputs.primitives << [inputs.mouse.position.x - 32 * state.camera_scale,
+** Processing line: ~ inputs.mouse.position.y - 32 * state.camera_scale,~
+- Inside source: true
+*** True Line Result
+ inputs.mouse.position.y - 32 * state.camera_scale,
+** Processing line: ~ state.tile_size * state.camera_scale,~
- Inside source: true
*** True Line Result
- outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,
-** Processing line: ~ state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite~
+ state.tile_size * state.camera_scale,
+** Processing line: ~ state.tile_size * state.camera_scale, 'sprites/square-indigo.png', 0, 100].sprite~
- Inside source: true
*** True Line Result
- state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite
+ state.tile_size * state.camera_scale, 'sprites/square-indigo.png', 0, 100].sprite
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -115303,6 +118307,98 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ if inputs.mouse.click~
+- Inside source: true
+*** True Line Result
+ if inputs.mouse.click
+** Processing line: ~ state.id_seed += 1~
+- Inside source: true
+*** True Line Result
+ state.id_seed += 1
+** Processing line: ~ id = state.id_seed~
+- Inside source: true
+*** True Line Result
+ id = state.id_seed
+** Processing line: ~ x = state.camera_x + (inputs.mouse.click.x.fdiv(state.camera_scale) - 32)~
+- Inside source: true
+*** True Line Result
+ x = state.camera_x + (inputs.mouse.click.x.fdiv(state.camera_scale) - 32)
+** Processing line: ~ y = state.camera_y + (inputs.mouse.click.y.fdiv(state.camera_scale) - 32)~
+- Inside source: true
+*** True Line Result
+ y = state.camera_y + (inputs.mouse.click.y.fdiv(state.camera_scale) - 32)
+** Processing line: ~ x = ((x + 2).idiv 4) * 4~
+- Inside source: true
+*** True Line Result
+ x = ((x + 2).idiv 4) * 4
+** Processing line: ~ y = ((y + 2).idiv 4) * 4~
+- Inside source: true
+*** True Line Result
+ y = ((y + 2).idiv 4) * 4
+** Processing line: ~ w = 64~
+- Inside source: true
+*** True Line Result
+ w = 64
+** Processing line: ~ h = 64~
+- Inside source: true
+*** True Line Result
+ h = 64
+** Processing line: ~ candidate_rect = { id: id, x: x, y: y, w: w, h: h }~
+- Inside source: true
+*** True Line Result
+ candidate_rect = { id: id, x: x, y: y, w: w, h: h }
+** Processing line: ~ scaled_candidate_rect = { x: x + 30, y: y + 30, w: w - 60, h: h - 60 }~
+- Inside source: true
+*** True Line Result
+ scaled_candidate_rect = { x: x + 30, y: y + 30, w: w - 60, h: h - 60 }
+** Processing line: ~ to_remove = state.world.find { |r| r.intersect_rect? scaled_candidate_rect }~
+- Inside source: true
+*** True Line Result
+ to_remove = state.world.find { |r| r.intersect_rect? scaled_candidate_rect }
+** Processing line: ~ if to_remove && args.inputs.keyboard.x~
+- Inside source: true
+*** True Line Result
+ if to_remove && args.inputs.keyboard.x
+** Processing line: ~ state.world.reject! { |r| r.id == to_remove.id }~
+- Inside source: true
+*** True Line Result
+ state.world.reject! { |r| r.id == to_remove.id }
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ state.world << candidate_rect~
+- Inside source: true
+*** True Line Result
+ state.world << candidate_rect
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ export_map~
+- Inside source: true
+*** True Line Result
+ export_map
+** Processing line: ~ state.world_lookup = {}~
+- Inside source: true
+*** True Line Result
+ state.world_lookup = {}
+** Processing line: ~ state.world_collision_rects = nil~
+- Inside source: true
+*** True Line Result
+ state.world_collision_rects = nil
+** Processing line: ~ calc_world_lookup~
+- Inside source: true
+*** True Line Result
+ calc_world_lookup
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ if input_up?~
- Inside source: true
*** True Line Result
@@ -115387,30 +118483,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
process_inputs_god_mode
-** Processing line: ~ elsif state.scene == :intro~
-- Inside source: true
-*** True Line Result
- elsif state.scene == :intro
-** Processing line: ~ if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space~
-- Inside source: true
-*** True Line Result
- if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space
-** Processing line: ~ if Kernel.tick_count < 600~
-- Inside source: true
-*** True Line Result
- if Kernel.tick_count < 600
-** Processing line: ~ Kernel.tick_count = 600~
-- Inside source: true
-*** True Line Result
- Kernel.tick_count = 600
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -115799,50 +118871,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def add_floors~
-- Inside source: true
-*** True Line Result
- def add_floors
-** Processing line: ~ # floors~
-- Inside source: true
-*** True Line Result
- # floors
-** Processing line: ~ state.world += [~
-- Inside source: true
-*** True Line Result
- state.world += [
-** Processing line: ~ [0, 0, 10000, 40],~
-- Inside source: true
-*** True Line Result
- [0, 0, 10000, 40],
-** Processing line: ~ [0, 1670, 3250, 60],~
-- Inside source: true
-*** True Line Result
- [0, 1670, 3250, 60],
-** Processing line: ~ [6691, 1653, 3290, 60],~
-- Inside source: true
-*** True Line Result
- [6691, 1653, 3290, 60],
-** Processing line: ~ [1521, 3792, 7370, 60],~
-- Inside source: true
-*** True Line Result
- [1521, 3792, 7370, 60],
-** Processing line: ~ [0, 5137, 3290, 60]~
-- Inside source: true
-*** True Line Result
- [0, 5137, 3290, 60]
-** Processing line: ~ ]~
-- Inside source: true
-*** True Line Result
- ]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ def attempt_load_world_from_file~
- Inside source: true
*** True Line Result
@@ -115871,86 +118899,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if $collisions
-** Processing line: ~ $collisions.map do |x, y, w, h|~
+** Processing line: ~ state.id_seed ||= 0~
- Inside source: true
*** True Line Result
- $collisions.map do |x, y, w, h|
-** Processing line: ~ state.world << [x, y, w, h]~
+ state.id_seed ||= 0
+** Processing line: ~ $collisions.each do |x, y, w, h|~
- Inside source: true
*** True Line Result
- state.world << [x, y, w, h]
-** Processing line: ~ end~
+ $collisions.each do |x, y, w, h|
+** Processing line: ~ state.id_seed += 1~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ add_floors~
+ state.id_seed += 1
+** Processing line: ~ state.world << { id: state.id_seed, x: x, y: y, w: w, h: h }~
- Inside source: true
*** True Line Result
- add_floors
-** Processing line: ~ # elsif exported_world~
-- Inside source: true
-*** True Line Result
- # elsif exported_world
-** Processing line: ~ # exported_world.each_line.map do |l|~
-- Inside source: true
-*** True Line Result
- # exported_world.each_line.map do |l|
-** Processing line: ~ # tokens = l.strip.split(',')~
-- Inside source: true
-*** True Line Result
- # tokens = l.strip.split(',')
-** Processing line: ~ # x = tokens[0].to_i~
-- Inside source: true
-*** True Line Result
- # x = tokens[0].to_i
-** Processing line: ~ # y = tokens[1].to_i~
-- Inside source: true
-*** True Line Result
- # y = tokens[1].to_i
-** Processing line: ~ # type = tokens[2].to_i~
-- Inside source: true
-*** True Line Result
- # type = tokens[2].to_i
-** Processing line: ~ # if type == 1~
-- Inside source: true
-*** True Line Result
- # if type == 1
-** Processing line: ~ # state.world << [x, y, state.tile_size, state.tile_size]~
-- Inside source: true
-*** True Line Result
- # state.world << [x, y, state.tile_size, state.tile_size]
-** Processing line: ~ # elsif type == 2~
-- Inside source: true
-*** True Line Result
- # elsif type == 2
-** Processing line: ~ # w, h, path = tokens[3..-1]~
-- Inside source: true
-*** True Line Result
- # w, h, path = tokens[3..-1]
-** Processing line: ~ # state.objects << [x, y, w.to_i, h.to_i, path]~
-- Inside source: true
-*** True Line Result
- # state.objects << [x, y, w.to_i, h.to_i, path]
-** Processing line: ~ # end~
-- Inside source: true
-*** True Line Result
- # end
-** Processing line: ~ # end~
-- Inside source: true
-*** True Line Result
- # end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # add_floors~
+ state.world << { id: state.id_seed, x: x, y: y, w: w, h: h }
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- # add_floors
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -116031,14 +118999,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
state.world_lookup = {}
-** Processing line: ~ state.world.each do |x, y, w, h|~
+** Processing line: ~ state.world.each do |rect|~
- Inside source: true
*** True Line Result
- state.world.each do |x, y, w, h|
-** Processing line: ~ state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true~
+ state.world.each do |rect|
+** Processing line: ~ state.world_lookup[rect.id] = rect~
- Inside source: true
*** True Line Result
- state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true
+ state.world_lookup[rect.id] = rect
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -116063,42 +119031,46 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
.keys
-** Processing line: ~ .map do |x, y, w, h|~
+** Processing line: ~ .map do |key|~
- Inside source: true
*** True Line Result
- .map do |x, y, w, h|
+ .map do |key|
+** Processing line: ~ rect = state.world_lookup[key]~
+- Inside source: true
+*** True Line Result
+ rect = state.world_lookup[key]
** Processing line: ~ s = state.tile_size~
- Inside source: true
*** True Line Result
s = state.tile_size
-** Processing line: ~ w ||= s~
+** Processing line: ~ rect.w ||= s~
- Inside source: true
*** True Line Result
- w ||= s
-** Processing line: ~ h ||= s~
+ rect.w ||= s
+** Processing line: ~ rect.h ||= s~
- Inside source: true
*** True Line Result
- h ||= s
+ rect.h ||= s
** Processing line: ~ {~
- Inside source: true
*** True Line Result
{
-** Processing line: ~ args: [x, y, w, h],~
+** Processing line: ~ args: rect,~
- Inside source: true
*** True Line Result
- args: [x, y, w, h],
-** Processing line: ~ left_right: [x, y + 4, w, h - 6],~
+ args: rect,
+** Processing line: ~ left_right: { x: rect.x, y: rect.y + 4, w: rect.w, h: rect.h - 6 },~
- Inside source: true
*** True Line Result
- left_right: [x, y + 4, w, h - 6],
-** Processing line: ~ top: [x + 4, y + 6, w - 8, h - 6],~
+ left_right: { x: rect.x, y: rect.y + 4, w: rect.w, h: rect.h - 6 },
+** Processing line: ~ top: { x: rect.x + 4, y: rect.y + 6, w: rect.w - 8, h: rect.h - 6 },~
- Inside source: true
*** True Line Result
- top: [x + 4, y + 6, w - 8, h - 6],
-** Processing line: ~ bottom: [x + 1, y - 1, w - 2, h - 8],~
+ top: { x: rect.x + 4, y: rect.y + 6, w: rect.w - 8, h: rect.h - 6 },
+** Processing line: ~ bottom: { x: rect.x + 1, y: rect.y - 1, w: rect.w - 2, h: rect.h - 8 },~
- Inside source: true
*** True Line Result
- bottom: [x + 1, y - 1, w - 2, h - 8],
+ bottom: { x: rect.x + 1, y: rect.y - 1, w: rect.w - 2, h: rect.h - 8 },
** Processing line: ~ }~
- Inside source: true
*** True Line Result
@@ -116319,10 +119291,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
p = state.tongue_angle.vector(state.tongue_length)
-** Processing line: ~ [start_of_tongue.x + p.x, start_of_tongue.y + p.y]~
+** Processing line: ~ { x: start_of_tongue.x + p.x, y: start_of_tongue.y + p.y }~
- Inside source: true
*** True Line Result
- [start_of_tongue.x + p.x, start_of_tongue.y + p.y]
+ { x: start_of_tongue.x + p.x, y: start_of_tongue.y + p.y }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -116335,14 +119307,50 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def calc_shooting
+** Processing line: ~ calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ calc_shooting_increment
+** Processing line: ~ calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ calc_shooting_increment
+** Processing line: ~ calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ calc_shooting_increment
+** Processing line: ~ calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ calc_shooting_increment
+** Processing line: ~ calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ calc_shooting_increment
+** Processing line: ~ calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ calc_shooting_increment
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_shooting_increment~
+- Inside source: true
+*** True Line Result
+ def calc_shooting_increment
** Processing line: ~ return unless state.action == :shooting~
- Inside source: true
*** True Line Result
return unless state.action == :shooting
-** Processing line: ~ state.tongue_length += 30~
+** Processing line: ~ state.tongue_length += 5~
- Inside source: true
*** True Line Result
- state.tongue_length += 30
+ state.tongue_length += 5
** Processing line: ~ potential_anchor = end_of_tongue~
- Inside source: true
*** True Line Result
@@ -116415,18 +119423,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
-** Processing line: ~ anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]~
+** Processing line: ~ anchor_rect = { x: potential_anchor.x - 5, y: potential_anchor.y - 5, w: 10, h: 10 }~
- Inside source: true
*** True Line Result
- anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]
+ anchor_rect = { x: potential_anchor.x - 5, y: potential_anchor.y - 5, w: 10, h: 10 }
** Processing line: ~ collision = state.world_collision_rects.find_all do |v|~
- Inside source: true
*** True Line Result
collision = state.world_collision_rects.find_all do |v|
-** Processing line: ~ [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)~
+** Processing line: ~ v[:args].intersect_rect?(anchor_rect)~
- Inside source: true
*** True Line Result
- [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)
+ v[:args].intersect_rect?(anchor_rect)
** Processing line: ~ end.first~
- Inside source: true
*** True Line Result
@@ -116807,10 +119815,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
return unless left_side_collisions
-** Processing line: ~ state.x = left_side_collisions[:left_right].right~
+** Processing line: ~ state.x = left_side_collisions[:left_right].right + 1~
- Inside source: true
*** True Line Result
- state.x = left_side_collisions[:left_right].right
+ state.x = left_side_collisions[:left_right].right + 1
** Processing line: ~ state.dx = state.dy.abs * 0.8~
- Inside source: true
*** True Line Result
@@ -116867,10 +119875,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
return unless right_side_collisions
-** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size~
+** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size - 1~
- Inside source: true
*** True Line Result
- state.x = right_side_collisions[:left_right].left - state.tile_size
+ state.x = right_side_collisions[:left_right].left - state.tile_size - 1
** Processing line: ~ state.dx = state.dx.abs * 0.8 * -1~
- Inside source: true
*** True Line Result
@@ -116931,10 +119939,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
return unless ceil_collisions
-** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size~
+** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size - 1~
- Inside source: true
*** True Line Result
- state.y = ceil_collisions[:bottom].y - state.tile_size
+ state.y = ceil_collisions[:bottom].y - state.tile_size - 1
** Processing line: ~ state.dy = state.dy.abs * 0.8 * -1~
- Inside source: true
*** True Line Result
@@ -116983,34 +119991,50 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def export_map
-** Processing line: ~ export_string = state.world.map do |x, y|~
+** Processing line: ~ export_string = "$collisions = [\n"~
- Inside source: true
*** True Line Result
- export_string = state.world.map do |x, y|
-** Processing line: ~ "#{x},#{y},1"~
+ export_string = "$collisions = [\n"
+** Processing line: ~ export_string += state.world.map do |rect|~
- Inside source: true
*** True Line Result
- "#{x},#{y},1"
-** Processing line: ~ end~
+ export_string += state.world.map do |rect|
+** Processing line: ~ "[#{rect.x},#{rect.y},#{rect.w},#{rect.h}],"~
- Inside source: true
*** True Line Result
- end
+ "[#{rect.x},#{rect.y},#{rect.w},#{rect.h}],"
+** Processing line: ~ end.join "\n"~
+- Inside source: true
+*** True Line Result
+ end.join "\n"
+** Processing line: ~ export_string += "\n]\n\n"~
+- Inside source: true
+*** True Line Result
+ export_string += "\n]\n\n"
+** Processing line: ~ export_string += "$mugs = [\n"~
+- Inside source: true
+*** True Line Result
+ export_string += "$mugs = [\n"
** Processing line: ~ export_string += state.objects.map do |x, y, w, h, path|~
- Inside source: true
*** True Line Result
export_string += state.objects.map do |x, y, w, h, path|
-** Processing line: ~ "#{x},#{y},2,#{w},#{h},#{path}"~
+** Processing line: ~ "[#{x},#{y},#{w},#{h},'#{path}'],"~
- Inside source: true
*** True Line Result
- "#{x},#{y},2,#{w},#{h},#{path}"
-** Processing line: ~ end~
+ "[#{x},#{y},#{w},#{h},'#{path}'],"
+** Processing line: ~ end.join "\n"~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))~
+ end.join "\n"
+** Processing line: ~ export_string += "\n]\n\n"~
+- Inside source: true
+*** True Line Result
+ export_string += "\n]\n\n"
+** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string)~
- Inside source: true
*** True Line Result
- gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))
+ gtk.write_file(MAP_FILE_PATH, export_string)
** Processing line: ~ state.map_saved_at = state.tick_count~
- Inside source: true
*** True Line Result
@@ -121523,6 +124547,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
[39, 5217, 64, 64],
+** Processing line: ~ [0, 0, 10000, 40],~
+- Inside source: true
+*** True Line Result
+ [0, 0, 10000, 40],
+** Processing line: ~ [0, 1670, 3250, 60],~
+- Inside source: true
+*** True Line Result
+ [0, 1670, 3250, 60],
+** Processing line: ~ [6691, 1653, 3290, 60],~
+- Inside source: true
+*** True Line Result
+ [6691, 1653, 3290, 60],
+** Processing line: ~ [1521, 3792, 7370, 60],~
+- Inside source: true
+*** True Line Result
+ [1521, 3792, 7370, 60],
+** Processing line: ~ [0, 5137, 3290, 60]~
+- Inside source: true
+*** True Line Result
+ [0, 5137, 3290, 60]
** Processing line: ~ ]~
- Inside source: true
*** True Line Result
@@ -124963,6 +128007,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def load_lines file
+** Processing line: ~ return unless state.snaps~
+- Inside source: true
+*** True Line Result
+ return unless state.snaps
** Processing line: ~ data = gtk.read_file(file) || ""~
- Inside source: true
*** True Line Result
@@ -125195,10 +128243,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
results[:trajectory] = trajectory(results)
-** Processing line: ~ results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~
+** Processing line: ~ results[:impacts] = terrain.find_all { |t| t && (line_near_rect? results[:rect], t) }.map do |t|~
- Inside source: true
*** True Line Result
- results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|
+ results[:impacts] = terrain.find_all { |t| t && (line_near_rect? results[:rect], t) }.map do |t|
** Processing line: ~ {~
- Inside source: true
*** True Line Result
@@ -125207,10 +128255,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
terrain: t,
-** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~
+** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),~
- Inside source: true
*** True Line Result
- point: geometry.line_intersect(results[:trajectory], t),
+ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),
** Processing line: ~ type: :terrain~
- Inside source: true
*** True Line Result
@@ -125239,10 +128287,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
terrain: t,
-** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~
+** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),~
- Inside source: true
*** True Line Result
- point: geometry.line_intersect(results[:trajectory], t),
+ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),
** Processing line: ~ type: :lava~
- Inside source: true
*** True Line Result
@@ -125251,10 +128299,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
}
-** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~
+** Processing line: ~ end.reject { |t| !t || (!point_within_line? t[:point], t[:terrain]) }~
- Inside source: true
*** True Line Result
- end.reject { |t| !point_within_line? t[:point], t[:terrain] }
+ end.reject { |t| !t || (!point_within_line? t[:point], t[:terrain]) }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -125303,6 +128351,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def calc_terrains_to_monitor
+** Processing line: ~ return unless circle.impacts~
+- Inside source: true
+*** True Line Result
+ return unless circle.impacts
** Processing line: ~ circle.impact = nil~
- Inside source: true
*** True Line Result
@@ -147595,6 +150647,590 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** Rpg Topdown - Topdown Casino - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Rpg Topdown - Topdown Casino - main.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./samples/99_genre_rpg_topdown/topdown_casino/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_rpg_topdown/topdown_casino/app/main.rb
+** Processing line: ~ $gtk.reset~
+- Inside source: true
+*** True Line Result
+ $gtk.reset
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def coinflip~
+- Inside source: true
+*** True Line Result
+ def coinflip
+** Processing line: ~ rand < 0.5~
+- Inside source: true
+*** True Line Result
+ rand < 0.5
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ class Game~
+- Inside source: true
+*** True Line Result
+ class Game
+** Processing line: ~ attr_accessor :args~
+- Inside source: true
+*** True Line Result
+ attr_accessor :args
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def text_font~
+- Inside source: true
+*** True Line Result
+ def text_font
+** Processing line: ~ return nil #"rpg.ttf"~
+- Inside source: true
+*** True Line Result
+ return nil #"rpg.ttf"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def text_color~
+- Inside source: true
+*** True Line Result
+ def text_color
+** Processing line: ~ [ 255, 255, 255, 255 ]~
+- Inside source: true
+*** True Line Result
+ [ 255, 255, 255, 255 ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def set_gem_values~
+- Inside source: true
+*** True Line Result
+ def set_gem_values
+** Processing line: ~ @args.state.gem0 = ((coinflip) ? 100 : 20)~
+- Inside source: true
+*** True Line Result
+ @args.state.gem0 = ((coinflip) ? 100 : 20)
+** Processing line: ~ @args.state.gem1 = ((coinflip) ? -10 : -50)~
+- Inside source: true
+*** True Line Result
+ @args.state.gem1 = ((coinflip) ? -10 : -50)
+** Processing line: ~ @args.state.gem2 = ((coinflip) ? -10 : -30)~
+- Inside source: true
+*** True Line Result
+ @args.state.gem2 = ((coinflip) ? -10 : -30)
+** Processing line: ~ if coinflip~
+- Inside source: true
+*** True Line Result
+ if coinflip
+** Processing line: ~ tmp = @args.state.gem0~
+- Inside source: true
+*** True Line Result
+ tmp = @args.state.gem0
+** Processing line: ~ @args.state.gem0 = @args.state.gem1~
+- Inside source: true
+*** True Line Result
+ @args.state.gem0 = @args.state.gem1
+** Processing line: ~ @args.state.gem1 = tmp~
+- Inside source: true
+*** True Line Result
+ @args.state.gem1 = tmp
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ if coinflip~
+- Inside source: true
+*** True Line Result
+ if coinflip
+** Processing line: ~ tmp = @args.state.gem1~
+- Inside source: true
+*** True Line Result
+ tmp = @args.state.gem1
+** Processing line: ~ @args.state.gem1 = @args.state.gem2~
+- Inside source: true
+*** True Line Result
+ @args.state.gem1 = @args.state.gem2
+** Processing line: ~ @args.state.gem2 = tmp~
+- Inside source: true
+*** True Line Result
+ @args.state.gem2 = tmp
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ if coinflip~
+- Inside source: true
+*** True Line Result
+ if coinflip
+** Processing line: ~ tmp = @args.state.gem0~
+- Inside source: true
+*** True Line Result
+ tmp = @args.state.gem0
+** Processing line: ~ @args.state.gem0 = @args.state.gem2~
+- Inside source: true
+*** True Line Result
+ @args.state.gem0 = @args.state.gem2
+** Processing line: ~ @args.state.gem2 = tmp~
+- Inside source: true
+*** True Line Result
+ @args.state.gem2 = tmp
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def initialize args~
+- Inside source: true
+*** True Line Result
+ def initialize args
+** Processing line: ~ @args = args~
+- Inside source: true
+*** True Line Result
+ @args = args
+** Processing line: ~ @args.state.animticks = 0~
+- Inside source: true
+*** True Line Result
+ @args.state.animticks = 0
+** Processing line: ~ @args.state.score = 0~
+- Inside source: true
+*** True Line Result
+ @args.state.score = 0
+** Processing line: ~ @args.state.gem_chosen = false~
+- Inside source: true
+*** True Line Result
+ @args.state.gem_chosen = false
+** Processing line: ~ @args.state.round_finished = false~
+- Inside source: true
+*** True Line Result
+ @args.state.round_finished = false
+** Processing line: ~ @args.state.gem0_x = 197~
+- Inside source: true
+*** True Line Result
+ @args.state.gem0_x = 197
+** Processing line: ~ @args.state.gem0_y = 720-274~
+- Inside source: true
+*** True Line Result
+ @args.state.gem0_y = 720-274
+** Processing line: ~ @args.state.gem1_x = 623~
+- Inside source: true
+*** True Line Result
+ @args.state.gem1_x = 623
+** Processing line: ~ @args.state.gem1_y = 720-274~
+- Inside source: true
+*** True Line Result
+ @args.state.gem1_y = 720-274
+** Processing line: ~ @args.state.gem2_x = 1049~
+- Inside source: true
+*** True Line Result
+ @args.state.gem2_x = 1049
+** Processing line: ~ @args.state.gem2_y = 720-274~
+- Inside source: true
+*** True Line Result
+ @args.state.gem2_y = 720-274
+** Processing line: ~ @args.state.hero_sprite = "sprites/herodown100.png"~
+- Inside source: true
+*** True Line Result
+ @args.state.hero_sprite = "sprites/herodown100.png"
+** Processing line: ~ @args.state.hero_x = 608~
+- Inside source: true
+*** True Line Result
+ @args.state.hero_x = 608
+** Processing line: ~ @args.state.hero_y = 720-656~
+- Inside source: true
+*** True Line Result
+ @args.state.hero_y = 720-656
+** Processing line: ~ set_gem_values~
+- Inside source: true
+*** True Line Result
+ set_gem_values
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_gem_value x, y, gem~
+- Inside source: true
+*** True Line Result
+ def render_gem_value x, y, gem
+** Processing line: ~ if @args.state.gem_chosen~
+- Inside source: true
+*** True Line Result
+ if @args.state.gem_chosen
+** Processing line: ~ @args.outputs.labels << [ x, y + 96, gem.to_s, 1, 1, *text_color, text_font ]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.labels << [ x, y + 96, gem.to_s, 1, 1, *text_color, text_font ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render~
+- Inside source: true
+*** True Line Result
+ def render
+** Processing line: ~ gemsprite = ((@args.state.animticks % 400) < 200) ? 'sprites/gem200.png' : 'sprites/gem400.png'~
+- Inside source: true
+*** True Line Result
+ gemsprite = ((@args.state.animticks % 400) < 200) ? 'sprites/gem200.png' : 'sprites/gem400.png'
+** Processing line: ~ @args.outputs.background_color = [ 0, 0, 0, 255 ]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.background_color = [ 0, 0, 0, 255 ]
+** Processing line: ~ @args.outputs.sprites << [608, 720-150, 64, 64, 'sprites/oldman.png']~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [608, 720-150, 64, 64, 'sprites/oldman.png']
+** Processing line: ~ @args.outputs.sprites << [300, 720-150, 64, 64, 'sprites/fire.png']~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [300, 720-150, 64, 64, 'sprites/fire.png']
+** Processing line: ~ @args.outputs.sprites << [900, 720-150, 64, 64, 'sprites/fire.png']~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [900, 720-150, 64, 64, 'sprites/fire.png']
+** Processing line: ~ @args.outputs.sprites << [@args.state.gem0_x, @args.state.gem0_y, 32, 64, gemsprite]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [@args.state.gem0_x, @args.state.gem0_y, 32, 64, gemsprite]
+** Processing line: ~ @args.outputs.sprites << [@args.state.gem1_x, @args.state.gem1_y, 32, 64, gemsprite]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [@args.state.gem1_x, @args.state.gem1_y, 32, 64, gemsprite]
+** Processing line: ~ @args.outputs.sprites << [@args.state.gem2_x, @args.state.gem2_y, 32, 64, gemsprite]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [@args.state.gem2_x, @args.state.gem2_y, 32, 64, gemsprite]
+** Processing line: ~ @args.outputs.sprites << [@args.state.hero_x, @args.state.hero_y, 64, 64, @args.state.hero_sprite]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sprites << [@args.state.hero_x, @args.state.hero_y, 64, 64, @args.state.hero_sprite]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ @args.outputs.labels << [ 630, 720-30, "IT'S A SECRET TO EVERYONE.", 1, 1, *text_color, text_font ]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.labels << [ 630, 720-30, "IT'S A SECRET TO EVERYONE.", 1, 1, *text_color, text_font ]
+** Processing line: ~ @args.outputs.labels << [ 50, 720-85, @args.state.score.to_s, 1, 1, *text_color, text_font ]~
+- Inside source: true
+*** True Line Result
+ @args.outputs.labels << [ 50, 720-85, @args.state.score.to_s, 1, 1, *text_color, text_font ]
+** Processing line: ~ render_gem_value @args.state.gem0_x, @args.state.gem0_y, @args.state.gem0~
+- Inside source: true
+*** True Line Result
+ render_gem_value @args.state.gem0_x, @args.state.gem0_y, @args.state.gem0
+** Processing line: ~ render_gem_value @args.state.gem1_x, @args.state.gem1_y, @args.state.gem1~
+- Inside source: true
+*** True Line Result
+ render_gem_value @args.state.gem1_x, @args.state.gem1_y, @args.state.gem1
+** Processing line: ~ render_gem_value @args.state.gem2_x, @args.state.gem2_y, @args.state.gem2~
+- Inside source: true
+*** True Line Result
+ render_gem_value @args.state.gem2_x, @args.state.gem2_y, @args.state.gem2
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc~
+- Inside source: true
+*** True Line Result
+ def calc
+** Processing line: ~ @args.state.animticks += 16~
+- Inside source: true
+*** True Line Result
+ @args.state.animticks += 16
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ return unless @args.state.gem_chosen~
+- Inside source: true
+*** True Line Result
+ return unless @args.state.gem_chosen
+** Processing line: ~ @args.state.round_finished_debounce ||= 60 * 3~
+- Inside source: true
+*** True Line Result
+ @args.state.round_finished_debounce ||= 60 * 3
+** Processing line: ~ @args.state.round_finished_debounce -= 1~
+- Inside source: true
+*** True Line Result
+ @args.state.round_finished_debounce -= 1
+** Processing line: ~ return if @args.state.round_finished_debounce > 0~
+- Inside source: true
+*** True Line Result
+ return if @args.state.round_finished_debounce > 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ @args.state.gem_chosen = false~
+- Inside source: true
+*** True Line Result
+ @args.state.gem_chosen = false
+** Processing line: ~ @args.state.hero.sprite[0] = 'sprites/herodown100.png'~
+- Inside source: true
+*** True Line Result
+ @args.state.hero.sprite[0] = 'sprites/herodown100.png'
+** Processing line: ~ @args.state.hero.sprite[1] = 608~
+- Inside source: true
+*** True Line Result
+ @args.state.hero.sprite[1] = 608
+** Processing line: ~ @args.state.hero.sprite[2] = 656~
+- Inside source: true
+*** True Line Result
+ @args.state.hero.sprite[2] = 656
+** Processing line: ~ @args.state.round_finished_debounce = nil~
+- Inside source: true
+*** True Line Result
+ @args.state.round_finished_debounce = nil
+** Processing line: ~ set_gem_values~
+- Inside source: true
+*** True Line Result
+ set_gem_values
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def walk xdir, ydir, anim~
+- Inside source: true
+*** True Line Result
+ def walk xdir, ydir, anim
+** Processing line: ~ @args.state.hero_sprite = "sprites/#{anim}#{(((@args.state.animticks % 200) < 100) ? '100' : '200')}.png"~
+- Inside source: true
+*** True Line Result
+ @args.state.hero_sprite = "sprites/#{anim}#{(((@args.state.animticks % 200) < 100) ? '100' : '200')}.png"
+** Processing line: ~ @args.state.hero_x += 5 * xdir~
+- Inside source: true
+*** True Line Result
+ @args.state.hero_x += 5 * xdir
+** Processing line: ~ @args.state.hero_y += 5 * ydir~
+- Inside source: true
+*** True Line Result
+ @args.state.hero_y += 5 * ydir
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def check_gem_touching gem_x, gem_y, gem~
+- Inside source: true
+*** True Line Result
+ def check_gem_touching gem_x, gem_y, gem
+** Processing line: ~ return if @args.state.gem_chosen~
+- Inside source: true
+*** True Line Result
+ return if @args.state.gem_chosen
+** Processing line: ~ herorect = [ @args.state.hero_x, @args.state.hero_y, 64, 64 ]~
+- Inside source: true
+*** True Line Result
+ herorect = [ @args.state.hero_x, @args.state.hero_y, 64, 64 ]
+** Processing line: ~ return if !herorect.intersect_rect?([gem_x, gem_y, 32, 64])~
+- Inside source: true
+*** True Line Result
+ return if !herorect.intersect_rect?([gem_x, gem_y, 32, 64])
+** Processing line: ~ @args.state.gem_chosen = true~
+- Inside source: true
+*** True Line Result
+ @args.state.gem_chosen = true
+** Processing line: ~ @args.state.score += gem~
+- Inside source: true
+*** True Line Result
+ @args.state.score += gem
+** Processing line: ~ @args.outputs.sounds << ((gem < 0) ? 'sounds/lose.wav' : 'sounds/win.wav')~
+- Inside source: true
+*** True Line Result
+ @args.outputs.sounds << ((gem < 0) ? 'sounds/lose.wav' : 'sounds/win.wav')
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def input~
+- Inside source: true
+*** True Line Result
+ def input
+** Processing line: ~ if @args.inputs.keyboard.key_held.left~
+- Inside source: true
+*** True Line Result
+ if @args.inputs.keyboard.key_held.left
+** Processing line: ~ walk(-1.0, 0.0, 'heroleft')~
+- Inside source: true
+*** True Line Result
+ walk(-1.0, 0.0, 'heroleft')
+** Processing line: ~ elsif @args.inputs.keyboard.key_held.right~
+- Inside source: true
+*** True Line Result
+ elsif @args.inputs.keyboard.key_held.right
+** Processing line: ~ walk(1.0, 0.0, 'heroright')~
+- Inside source: true
+*** True Line Result
+ walk(1.0, 0.0, 'heroright')
+** Processing line: ~ elsif @args.inputs.keyboard.key_held.up~
+- Inside source: true
+*** True Line Result
+ elsif @args.inputs.keyboard.key_held.up
+** Processing line: ~ walk(0.0, 1.0, 'heroup')~
+- Inside source: true
+*** True Line Result
+ walk(0.0, 1.0, 'heroup')
+** Processing line: ~ elsif @args.inputs.keyboard.key_held.down~
+- Inside source: true
+*** True Line Result
+ elsif @args.inputs.keyboard.key_held.down
+** Processing line: ~ walk(0.0, -1.0, 'herodown')~
+- Inside source: true
+*** True Line Result
+ walk(0.0, -1.0, 'herodown')
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ check_gem_touching(@args.state.gem0_x, @args.state.gem0_y, @args.state.gem0)~
+- Inside source: true
+*** True Line Result
+ check_gem_touching(@args.state.gem0_x, @args.state.gem0_y, @args.state.gem0)
+** Processing line: ~ check_gem_touching(@args.state.gem1_x, @args.state.gem1_y, @args.state.gem1)~
+- Inside source: true
+*** True Line Result
+ check_gem_touching(@args.state.gem1_x, @args.state.gem1_y, @args.state.gem1)
+** Processing line: ~ check_gem_touching(@args.state.gem2_x, @args.state.gem2_y, @args.state.gem2)~
+- Inside source: true
+*** True Line Result
+ check_gem_touching(@args.state.gem2_x, @args.state.gem2_y, @args.state.gem2)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick~
+- Inside source: true
+*** True Line Result
+ def tick
+** Processing line: ~ input~
+- Inside source: true
+*** True Line Result
+ input
+** Processing line: ~ calc~
+- Inside source: true
+*** True Line Result
+ calc
+** Processing line: ~ render~
+- Inside source: true
+*** True Line Result
+ render
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ args.state.game ||= Game.new args~
+- Inside source: true
+*** True Line Result
+ args.state.game ||= Game.new args
+** Processing line: ~ args.state.game.args = args~
+- Inside source: true
+*** True Line Result
+ args.state.game.args = args
+** Processing line: ~ args.state.game.tick~
+- Inside source: true
+*** True Line Result
+ args.state.game.tick
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** Rpg Topdown - Topdown Starting Point - main.rb~
- Header detected.
*** True Line Result
@@ -148055,22 +151691,22 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
-** Processing line: ~*** Teentiny - main.rb~
+** Processing line: ~*** Teenytiny - Teenytiny Starting Point - main.rb~
- Header detected.
*** True Line Result
*** True Line Result
-*** Teentiny - main.rb
+*** Teenytiny - Teenytiny Starting Point - main.rb
** Processing line: ~#+begin_src ruby~
- Line was identified as the beginning of a code block.
*** True Line Result
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/99_genre_teentiny/app/main.rb~
+** Processing line: ~ # ./samples/99_genre_teenytiny/teenytiny_starting_point/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/99_genre_teentiny/app/main.rb
+ # ./samples/99_genre_teenytiny/teenytiny_starting_point/app/main.rb
** Processing line: ~ # full documenation is at http://docs.dragonruby.org~
- Inside source: true
*** True Line Result
@@ -148731,22 +152367,22 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
-** Processing line: ~*** Teentiny - license.txt~
+** Processing line: ~*** Teenytiny - Teenytiny Starting Point - license.txt~
- Header detected.
*** True Line Result
*** True Line Result
-*** Teentiny - license.txt
+*** Teenytiny - Teenytiny Starting Point - license.txt
** Processing line: ~#+begin_src ruby~
- Line was identified as the beginning of a code block.
*** True Line Result
*** True Line Result
#+begin_src ruby
-** Processing line: ~ # ./samples/99_genre_teentiny/license.txt~
+** Processing line: ~ # ./samples/99_genre_teenytiny/teenytiny_starting_point/license.txt~
- Inside source: true
*** True Line Result
- # ./samples/99_genre_teentiny/license.txt
+ # ./samples/99_genre_teenytiny/teenytiny_starting_point/license.txt
** Processing line: ~ Copyright 2019 DragonRuby LLC~
- Inside source: true
*** True Line Result
@@ -148802,11 +152438,2575 @@ Follows is a source code listing for all files that have been open sourced. This
*** True Line Result
** OSS
** Processing line: ~Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].~
-** Processing line: ~*** args.rb~
+** Processing line: ~*** api.rb~
- Header detected.
*** True Line Result
Follows is a source code listing for all files that have been open sourced. This code can be found online at [[https://github.com/DragonRuby/dragonruby-game-toolkit-contrib/]].
*** True Line Result
+*** api.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./dragon/api.rb~
+- Inside source: true
+*** True Line Result
+ # ./dragon/api.rb
+** Processing line: ~ # coding: utf-8~
+- Inside source: true
+*** True Line Result
+ # coding: utf-8
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
+- Inside source: true
+*** True Line Result
+ # Copyright 2019 DragonRuby LLC
+** Processing line: ~ # MIT License~
+- Inside source: true
+*** True Line Result
+ # MIT License
+** Processing line: ~ # api.rb has been released under MIT (*only this file*).~
+- Inside source: true
+*** True Line Result
+ # api.rb has been released under MIT (*only this file*).
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ module GTK~
+- Inside source: true
+*** True Line Result
+ module GTK
+** Processing line: ~ class Api~
+- Inside source: true
+*** True Line Result
+ class Api
+** Processing line: ~ def initialize~
+- Inside source: true
+*** True Line Result
+ def initialize
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_autocomplete args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_autocomplete args, req
+** Processing line: ~ html = <<-S~
+- Inside source: true
+*** True Line Result
+ html = <<-S
+** Processing line: ~ <html>~
+- Inside source: true
+*** True Line Result
+ <html>
+** Processing line: ~ <head>~
+- Inside source: true
+*** True Line Result
+ <head>
+** Processing line: ~ <meta charset="UTF-8"/>~
+- Inside source: true
+*** True Line Result
+ <meta charset="UTF-8"/>
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+- Inside source: true
+*** True Line Result
+ <title>DragonRuby Game Toolkit Documentation</title>
+** Processing line: ~ <style>~
+- Inside source: true
+*** True Line Result
+ <style>
+** Processing line: ~ pre {~
+- Inside source: true
+*** True Line Result
+ pre {
+** Processing line: ~ border: solid 1px silver;~
+- Inside source: true
+*** True Line Result
+ border: solid 1px silver;
+** Processing line: ~ padding: 10px;~
+- Inside source: true
+*** True Line Result
+ padding: 10px;
+** Processing line: ~ font-size: 14px;~
+- Inside source: true
+*** True Line Result
+ font-size: 14px;
+** Processing line: ~ white-space: pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: pre-wrap;
+** Processing line: ~ white-space: -moz-pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: -moz-pre-wrap;
+** Processing line: ~ white-space: -pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: -pre-wrap;
+** Processing line: ~ white-space: -o-pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: -o-pre-wrap;
+** Processing line: ~ word-wrap: break-word;~
+- Inside source: true
+*** True Line Result
+ word-wrap: break-word;
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ </style>~
+- Inside source: true
+*** True Line Result
+ </style>
+** Processing line: ~ </head>~
+- Inside source: true
+*** True Line Result
+ </head>
+** Processing line: ~ <body>~
+- Inside source: true
+*** True Line Result
+ <body>
+** Processing line: ~ <script>~
+- Inside source: true
+*** True Line Result
+ <script>
+** Processing line: ~ async function submitForm() {~
+- Inside source: true
+*** True Line Result
+ async function submitForm() {
+** Processing line: ~ const result = await fetch("/dragon/autocomplete/", {~
+- Inside source: true
+*** True Line Result
+ const result = await fetch("/dragon/autocomplete/", {
+** Processing line: ~ method: 'POST',~
+- Inside source: true
+*** True Line Result
+ method: 'POST',
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+- Inside source: true
+*** True Line Result
+ headers: { 'Content-Type': 'application/json' },
+** Processing line: ~ body: JSON.stringify({ index: document.getElementById("index").value,~
+- Inside source: true
+*** True Line Result
+ body: JSON.stringify({ index: document.getElementById("index").value,
+** Processing line: ~ text: document.getElementById("text").value }),~
+- Inside source: true
+*** True Line Result
+ text: document.getElementById("text").value }),
+** Processing line: ~ });~
+- Inside source: true
+*** True Line Result
+ });
+** Processing line: ~ document.getElementById("autocomplete-results").innerHTML = await result.text();~
+- Inside source: true
+*** True Line Result
+ document.getElementById("autocomplete-results").innerHTML = await result.text();
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ </script>~
+- Inside source: true
+*** True Line Result
+ </script>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <div>index</div>~
+- Inside source: true
+*** True Line Result
+ <div>index</div>
+** Processing line: ~ <input name="index" id="index" type="text" value="27" />~
+- Inside source: true
+*** True Line Result
+ <input name="index" id="index" type="text" value="27" />
+** Processing line: ~ <div>code</div>~
+- Inside source: true
+*** True Line Result
+ <div>code</div>
+** Processing line: ~ <textarea name="text" id="text" rows="30" cols="80">def tick args~
+- Inside source: true
+*** True Line Result
+ <textarea name="text" id="text" rows="30" cols="80">def tick args
+** Processing line: ~ args.state.~
+- Inside source: true
+*** True Line Result
+ args.state.
+** Processing line: ~ end</textarea>~
+- Inside source: true
+*** True Line Result
+ end</textarea>
+** Processing line: ~ <br/>~
+- Inside source: true
+*** True Line Result
+ <br/>
+** Processing line: ~ <input type="button" value="Get Suggestions" onclick="submitForm();" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Get Suggestions" onclick="submitForm();" />
+** Processing line: ~ <span id="success-notification"></span>~
+- Inside source: true
+*** True Line Result
+ <span id="success-notification"></span>
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <pre id="autocomplete-results">~
+- Inside source: true
+*** True Line Result
+ <pre id="autocomplete-results">
+** Processing line: ~ </pre>~
+- Inside source: true
+*** True Line Result
+ </pre>
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ #{links}~
+- Inside source: true
+*** True Line Result
+ #{links}
+** Processing line: ~ </body>~
+- Inside source: true
+*** True Line Result
+ </body>
+** Processing line: ~ </html>~
+- Inside source: true
+*** True Line Result
+ </html>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ html,~
+- Inside source: true
+*** True Line Result
+ html,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_autocomplete args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_autocomplete args, req
+** Processing line: ~ json = ($gtk.parse_json req.body)~
+- Inside source: true
+*** True Line Result
+ json = ($gtk.parse_json req.body)
+** Processing line: ~ index = json["index"].to_i~
+- Inside source: true
+*** True Line Result
+ index = json["index"].to_i
+** Processing line: ~ text = json["text"]~
+- Inside source: true
+*** True Line Result
+ text = json["text"]
+** Processing line: ~ suggestions = args.gtk.suggest_autocompletion index: index, text: text~
+- Inside source: true
+*** True Line Result
+ suggestions = args.gtk.suggest_autocompletion index: index, text: text
+** Processing line: ~ list_as_string = suggestions.join("\n")~
+- Inside source: true
+*** True Line Result
+ list_as_string = suggestions.join("\n")
+** Processing line: ~ req.respond 200, list_as_string, { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ req.respond 200, list_as_string, { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ define_method :links do~
+- Inside source: true
+*** True Line Result
+ define_method :links do
+** Processing line: ~ <<-S~
+- Inside source: true
+*** True Line Result
+ <<-S
+** Processing line: ~ <ul>~
+- Inside source: true
+*** True Line Result
+ <ul>
+** Processing line: ~ <li><a href="/">Home</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/">Home</a></li>
+** Processing line: ~ <li><a href="/docs.html">Docs</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/docs.html">Docs</a></li>
+** Processing line: ~ <li><a href="/dragon/control_panel/">Control Panel</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/dragon/control_panel/">Control Panel</a></li>
+** Processing line: ~ <li><a href="/dragon/eval/">Console</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/dragon/eval/">Console</a></li>
+** Processing line: ~ <li><a href="/dragon/log/">Logs</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/dragon/log/">Logs</a></li>
+** Processing line: ~ <li><a href="/dragon/puts/">Puts</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/dragon/puts/">Puts</a></li>
+** Processing line: ~ <li><a href="/dragon/code/">Code</a></li>~
+- Inside source: true
+*** True Line Result
+ <li><a href="/dragon/code/">Code</a></li>
+** Processing line: ~ </ul>~
+- Inside source: true
+*** True Line Result
+ </ul>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_index args, req~
+- Inside source: true
+*** True Line Result
+ def get_index args, req
+** Processing line: ~ req.respond 200, <<-S, { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ req.respond 200, <<-S, { 'Content-Type' => 'text/html' }
+** Processing line: ~ <html>~
+- Inside source: true
+*** True Line Result
+ <html>
+** Processing line: ~ <head>~
+- Inside source: true
+*** True Line Result
+ <head>
+** Processing line: ~ <meta charset="UTF-8"/>~
+- Inside source: true
+*** True Line Result
+ <meta charset="UTF-8"/>
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+- Inside source: true
+*** True Line Result
+ <title>DragonRuby Game Toolkit Documentation</title>
+** Processing line: ~ </head>~
+- Inside source: true
+*** True Line Result
+ </head>
+** Processing line: ~ <body>~
+- Inside source: true
+*** True Line Result
+ <body>
+** Processing line: ~ #{links}~
+- Inside source: true
+*** True Line Result
+ #{links}
+** Processing line: ~ </body>~
+- Inside source: true
+*** True Line Result
+ </body>
+** Processing line: ~ </html>~
+- Inside source: true
+*** True Line Result
+ </html>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def source_code_links args~
+- Inside source: true
+*** True Line Result
+ def source_code_links args
+** Processing line: ~ links = args.gtk.reload_list_history.keys.map do |f|~
+- Inside source: true
+*** True Line Result
+ links = args.gtk.reload_list_history.keys.map do |f|
+** Processing line: ~ "<li><a href=\"/dragon/code/edit/?file=#{f}\">#{f}</a></li>"~
+- Inside source: true
+*** True Line Result
+ "<li><a href=\"/dragon/code/edit/?file=#{f}\">#{f}</a></li>"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ <<-S~
+- Inside source: true
+*** True Line Result
+ <<-S
+** Processing line: ~ <ul>~
+- Inside source: true
+*** True Line Result
+ <ul>
+** Processing line: ~ #{links.join("\n")}~
+- Inside source: true
+*** True Line Result
+ #{links.join("\n")}
+** Processing line: ~ </ul>~
+- Inside source: true
+*** True Line Result
+ </ul>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_code args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_code args, req
+** Processing line: ~ view = <<-S~
+- Inside source: true
+*** True Line Result
+ view = <<-S
+** Processing line: ~ <html>~
+- Inside source: true
+*** True Line Result
+ <html>
+** Processing line: ~ <head>~
+- Inside source: true
+*** True Line Result
+ <head>
+** Processing line: ~ <meta charset="UTF-8"/>~
+- Inside source: true
+*** True Line Result
+ <meta charset="UTF-8"/>
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+- Inside source: true
+*** True Line Result
+ <title>DragonRuby Game Toolkit Documentation</title>
+** Processing line: ~ </head>~
+- Inside source: true
+*** True Line Result
+ </head>
+** Processing line: ~ <body>~
+- Inside source: true
+*** True Line Result
+ <body>
+** Processing line: ~ #{source_code_links args}~
+- Inside source: true
+*** True Line Result
+ #{source_code_links args}
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ #{links}~
+- Inside source: true
+*** True Line Result
+ #{links}
+** Processing line: ~ </body>~
+- Inside source: true
+*** True Line Result
+ </body>
+** Processing line: ~ </html>~
+- Inside source: true
+*** True Line Result
+ </html>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ view,~
+- Inside source: true
+*** True Line Result
+ view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def code_edit_view args, file~
+- Inside source: true
+*** True Line Result
+ def code_edit_view args, file
+** Processing line: ~ view = <<-S~
+- Inside source: true
+*** True Line Result
+ view = <<-S
+** Processing line: ~ <html>~
+- Inside source: true
+*** True Line Result
+ <html>
+** Processing line: ~ <head>~
+- Inside source: true
+*** True Line Result
+ <head>
+** Processing line: ~ <meta charset="UTF-8"/>~
+- Inside source: true
+*** True Line Result
+ <meta charset="UTF-8"/>
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+- Inside source: true
+*** True Line Result
+ <title>DragonRuby Game Toolkit Documentation</title>
+** Processing line: ~ </head>~
+- Inside source: true
+*** True Line Result
+ </head>
+** Processing line: ~ <body>~
+- Inside source: true
+*** True Line Result
+ <body>
+** Processing line: ~ <script>~
+- Inside source: true
+*** True Line Result
+ <script>
+** Processing line: ~ async function submitForm() {~
+- Inside source: true
+*** True Line Result
+ async function submitForm() {
+** Processing line: ~ const result = await fetch("/dragon/code/update/?file=#{file}", {~
+- Inside source: true
+*** True Line Result
+ const result = await fetch("/dragon/code/update/?file=#{file}", {
+** Processing line: ~ method: 'POST',~
+- Inside source: true
+*** True Line Result
+ method: 'POST',
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+- Inside source: true
+*** True Line Result
+ headers: { 'Content-Type': 'application/json' },
+** Processing line: ~ body: JSON.stringify({ code: document.getElementById("code").value }),~
+- Inside source: true
+*** True Line Result
+ body: JSON.stringify({ code: document.getElementById("code").value }),
+** Processing line: ~ });~
+- Inside source: true
+*** True Line Result
+ });
+** Processing line: ~ document.getElementById("success-notification").innerHTML = "update successful";~
+- Inside source: true
+*** True Line Result
+ document.getElementById("success-notification").innerHTML = "update successful";
+** Processing line: ~ setTimeout(function() { document.getElementById("success-notification").innerHTML = ""; }, 3000);~
+- Inside source: true
+*** True Line Result
+ setTimeout(function() { document.getElementById("success-notification").innerHTML = ""; }, 3000);
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ </script>~
+- Inside source: true
+*** True Line Result
+ </script>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <div><code>#{file}:</code></div>~
+- Inside source: true
+*** True Line Result
+ <div><code>#{file}:</code></div>
+** Processing line: ~ <textarea name="code" id="code" rows="30" cols="80">#{args.gtk.read_file file}</textarea>~
+- Inside source: true
+*** True Line Result
+ <textarea name="code" id="code" rows="30" cols="80">#{args.gtk.read_file file}</textarea>
+** Processing line: ~ <br/>~
+- Inside source: true
+*** True Line Result
+ <br/>
+** Processing line: ~ <input type="button" value="Update" onclick="submitForm();" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Update" onclick="submitForm();" />
+** Processing line: ~ <span id="success-notification"></span>~
+- Inside source: true
+*** True Line Result
+ <span id="success-notification"></span>
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ #{source_code_links args}~
+- Inside source: true
+*** True Line Result
+ #{source_code_links args}
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ #{links}~
+- Inside source: true
+*** True Line Result
+ #{links}
+** Processing line: ~ </body>~
+- Inside source: true
+*** True Line Result
+ </body>
+** Processing line: ~ </html>~
+- Inside source: true
+*** True Line Result
+ </html>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_code_edit args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_code_edit args, req
+** Processing line: ~ file = req.uri.split('?').last.gsub("file=", "")~
+- Inside source: true
+*** True Line Result
+ file = req.uri.split('?').last.gsub("file=", "")
+** Processing line: ~ view = code_edit_view args, file~
+- Inside source: true
+*** True Line Result
+ view = code_edit_view args, file
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ view,~
+- Inside source: true
+*** True Line Result
+ view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_code_update args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_code_update args, req
+** Processing line: ~ file = req.uri.split('?').last.gsub("file=", "")~
+- Inside source: true
+*** True Line Result
+ file = req.uri.split('?').last.gsub("file=", "")
+** Processing line: ~ code = ($gtk.parse_json req.body)["code"]~
+- Inside source: true
+*** True Line Result
+ code = ($gtk.parse_json req.body)["code"]
+** Processing line: ~ args.gtk.write_file file, code~
+- Inside source: true
+*** True Line Result
+ args.gtk.write_file file, code
+** Processing line: ~ view = code_edit_view args, file~
+- Inside source: true
+*** True Line Result
+ view = code_edit_view args, file
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ view,~
+- Inside source: true
+*** True Line Result
+ view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_boot args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_boot args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("tmp/src_backup/boot.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("tmp/src_backup/boot.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_trace args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_trace args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("logs/trace.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("logs/trace.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_log args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_log args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("logs/log.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("logs/log.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_log args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_log args, req
+** Processing line: ~ Log.log req.body~
+- Inside source: true
+*** True Line Result
+ Log.log req.body
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ "ok",~
+- Inside source: true
+*** True Line Result
+ "ok",
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_puts args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_puts args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("logs/puts.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("logs/puts.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_changes args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_changes args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("tmp/src_backup/src_backup_changes.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("tmp/src_backup/src_backup_changes.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_favicon_ico args, req~
+- Inside source: true
+*** True Line Result
+ def get_favicon_ico args, req
+** Processing line: ~ @favicon ||= args.gtk.read_file('docs/favicon.ico')~
+- Inside source: true
+*** True Line Result
+ @favicon ||= args.gtk.read_file('docs/favicon.ico')
+** Processing line: ~ req.respond 200, @favicon, { "Content-Type" => 'image/x-icon' }~
+- Inside source: true
+*** True Line Result
+ req.respond 200, @favicon, { "Content-Type" => 'image/x-icon' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_src_backup args, req~
+- Inside source: true
+*** True Line Result
+ def get_src_backup args, req
+** Processing line: ~ file_name = req.uri.gsub("/dragon/", "")~
+- Inside source: true
+*** True Line Result
+ file_name = req.uri.gsub("/dragon/", "")
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("tmp/src_backup/#{file_name}"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("tmp/src_backup/#{file_name}"),
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_not_found args, req~
+- Inside source: true
+*** True Line Result
+ def get_not_found args, req
+** Processing line: ~ puts("METHOD: #{req.method}");~
+- Inside source: true
+*** True Line Result
+ puts("METHOD: #{req.method}");
+** Processing line: ~ puts("URI: #{req.uri}");~
+- Inside source: true
+*** True Line Result
+ puts("URI: #{req.uri}");
+** Processing line: ~ puts("HEADERS:");~
+- Inside source: true
+*** True Line Result
+ puts("HEADERS:");
+** Processing line: ~ req.headers.each { |k,v| puts(" #{k}: #{v}") }~
+- Inside source: true
+*** True Line Result
+ req.headers.each { |k,v| puts(" #{k}: #{v}") }
+** Processing line: ~ req.respond 404, "not found: #{req.uri}", { }~
+- Inside source: true
+*** True Line Result
+ req.respond 404, "not found: #{req.uri}", { }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_docs_html args, req~
+- Inside source: true
+*** True Line Result
+ def get_docs_html args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("docs/docs.html"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("docs/docs.html"),
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_docs_css args, req~
+- Inside source: true
+*** True Line Result
+ def get_docs_css args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("docs/docs.css"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("docs/docs.css"),
+** Processing line: ~ { 'Content-Type' => 'text/css' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/css' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_docs_search_gif args, req~
+- Inside source: true
+*** True Line Result
+ def get_docs_search_gif args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("docs/docs_search.gif"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("docs/docs_search.gif"),
+** Processing line: ~ { 'Content-Type' => 'image/gif' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'image/gif' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_src_backup_index_html args, req~
+- Inside source: true
+*** True Line Result
+ def get_src_backup_index_html args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_index.html"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("/tmp/src_backup/src_backup_index.html"),
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_src_backup_index_txt args, req~
+- Inside source: true
+*** True Line Result
+ def get_src_backup_index_txt args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_index.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("/tmp/src_backup/src_backup_index.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/txt' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/txt' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_src_backup_css args, req~
+- Inside source: true
+*** True Line Result
+ def get_src_backup_css args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup.css"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("/tmp/src_backup/src_backup.css"),
+** Processing line: ~ { 'Content-Type' => 'text/css' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/css' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_src_backup_changes_html args, req~
+- Inside source: true
+*** True Line Result
+ def get_src_backup_changes_html args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_changes.html"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("/tmp/src_backup/src_backup_changes.html"),
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_src_backup_changes_txt args, req~
+- Inside source: true
+*** True Line Result
+ def get_src_backup_changes_txt args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_changes.txt"),~
+- Inside source: true
+*** True Line Result
+ args.gtk.read_file("/tmp/src_backup/src_backup_changes.txt"),
+** Processing line: ~ { 'Content-Type' => 'text/txt' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/txt' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_eval args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_eval args, req
+** Processing line: ~ eval_view = <<-S~
+- Inside source: true
+*** True Line Result
+ eval_view = <<-S
+** Processing line: ~ <html lang="en">~
+- Inside source: true
+*** True Line Result
+ <html lang="en">
+** Processing line: ~ <head><title>Eval</title></head>~
+- Inside source: true
+*** True Line Result
+ <head><title>Eval</title></head>
+** Processing line: ~ <style>~
+- Inside source: true
+*** True Line Result
+ <style>
+** Processing line: ~ pre {~
+- Inside source: true
+*** True Line Result
+ pre {
+** Processing line: ~ border: solid 1px silver;~
+- Inside source: true
+*** True Line Result
+ border: solid 1px silver;
+** Processing line: ~ padding: 10px;~
+- Inside source: true
+*** True Line Result
+ padding: 10px;
+** Processing line: ~ font-size: 14px;~
+- Inside source: true
+*** True Line Result
+ font-size: 14px;
+** Processing line: ~ white-space: pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: pre-wrap;
+** Processing line: ~ white-space: -moz-pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: -moz-pre-wrap;
+** Processing line: ~ white-space: -pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: -pre-wrap;
+** Processing line: ~ white-space: -o-pre-wrap;~
+- Inside source: true
+*** True Line Result
+ white-space: -o-pre-wrap;
+** Processing line: ~ word-wrap: break-word;~
+- Inside source: true
+*** True Line Result
+ word-wrap: break-word;
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ </style>~
+- Inside source: true
+*** True Line Result
+ </style>
+** Processing line: ~ <body>~
+- Inside source: true
+*** True Line Result
+ <body>
+** Processing line: ~ <script>~
+- Inside source: true
+*** True Line Result
+ <script>
+** Processing line: ~ async function submitForm() {~
+- Inside source: true
+*** True Line Result
+ async function submitForm() {
+** Processing line: ~ const result = await fetch("/dragon/eval/", {~
+- Inside source: true
+*** True Line Result
+ const result = await fetch("/dragon/eval/", {
+** Processing line: ~ method: 'POST',~
+- Inside source: true
+*** True Line Result
+ method: 'POST',
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+- Inside source: true
+*** True Line Result
+ headers: { 'Content-Type': 'application/json' },
+** Processing line: ~ body: JSON.stringify({ code: document.getElementById("code").value }),~
+- Inside source: true
+*** True Line Result
+ body: JSON.stringify({ code: document.getElementById("code").value }),
+** Processing line: ~ });~
+- Inside source: true
+*** True Line Result
+ });
+** Processing line: ~ document.getElementById("eval-result").innerHTML = await result.text();~
+- Inside source: true
+*** True Line Result
+ document.getElementById("eval-result").innerHTML = await result.text();
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ </script>~
+- Inside source: true
+*** True Line Result
+ </script>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <textarea name="code" id="code" rows="10" cols="80"># write your code here and set $result.\n$result = $gtk.args.state</textarea>~
+- Inside source: true
+*** True Line Result
+ <textarea name="code" id="code" rows="10" cols="80"># write your code here and set $result.\n$result = $gtk.args.state</textarea>
+** Processing line: ~ <br/>~
+- Inside source: true
+*** True Line Result
+ <br/>
+** Processing line: ~ <input type="button" onclick="submitForm();" value="submit" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" onclick="submitForm();" value="submit" />
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <pre>curl -H "Content-Type: application/json" --data '{ "code": "$result = $args.state" }' -X POST http://localhost:9001/dragon/eval/</pre>~
+- Inside source: true
+*** True Line Result
+ <pre>curl -H "Content-Type: application/json" --data '{ "code": "$result = $args.state" }' -X POST http://localhost:9001/dragon/eval/</pre>
+** Processing line: ~ <div>Eval Result:</div>~
+- Inside source: true
+*** True Line Result
+ <div>Eval Result:</div>
+** Processing line: ~ <pre id="eval-result"></pre>~
+- Inside source: true
+*** True Line Result
+ <pre id="eval-result"></pre>
+** Processing line: ~ #{links}~
+- Inside source: true
+*** True Line Result
+ #{links}
+** Processing line: ~ </body>~
+- Inside source: true
+*** True Line Result
+ </body>
+** Processing line: ~ </html>~
+- Inside source: true
+*** True Line Result
+ </html>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ eval_view,~
+- Inside source: true
+*** True Line Result
+ eval_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_eval args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_eval args, req
+** Processing line: ~ if json? req~
+- Inside source: true
+*** True Line Result
+ if json? req
+** Processing line: ~ code = ($gtk.parse_json req.body)["code"]~
+- Inside source: true
+*** True Line Result
+ code = ($gtk.parse_json req.body)["code"]
+** Processing line: ~ code = code.gsub("$result", "$eval_result")~
+- Inside source: true
+*** True Line Result
+ code = code.gsub("$result", "$eval_result")
+** Processing line: ~ Object.new.instance_eval do~
+- Inside source: true
+*** True Line Result
+ Object.new.instance_eval do
+** Processing line: ~ begin~
+- Inside source: true
+*** True Line Result
+ begin
+** Processing line: ~ Kernel.eval code~
+- Inside source: true
+*** True Line Result
+ Kernel.eval code
+** Processing line: ~ rescue Exception => e~
+- Inside source: true
+*** True Line Result
+ rescue Exception => e
+** Processing line: ~ $eval_result = e~
+- Inside source: true
+*** True Line Result
+ $eval_result = e
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ "#{$eval_result || $eval_results || "nil"}",~
+- Inside source: true
+*** True Line Result
+ "#{$eval_result || $eval_results || "nil"}",
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $eval_result = nil~
+- Inside source: true
+*** True Line Result
+ $eval_result = nil
+** Processing line: ~ $eval_results = nil~
+- Inside source: true
+*** True Line Result
+ $eval_results = nil
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def api_css_string~
+- Inside source: true
+*** True Line Result
+ def api_css_string
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_console args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_console args, req
+** Processing line: ~ html = console_view "# write your code here and set $result.\n$result = $gtk.args.state"~
+- Inside source: true
+*** True Line Result
+ html = console_view "# write your code here and set $result.\n$result = $gtk.args.state"
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ html,~
+- Inside source: true
+*** True Line Result
+ html,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def control_panel_view~
+- Inside source: true
+*** True Line Result
+ def control_panel_view
+** Processing line: ~ <<-S~
+- Inside source: true
+*** True Line Result
+ <<-S
+** Processing line: ~ <html lang="en">~
+- Inside source: true
+*** True Line Result
+ <html lang="en">
+** Processing line: ~ <head><title>console</title></head>~
+- Inside source: true
+*** True Line Result
+ <head><title>console</title></head>
+** Processing line: ~ <body>~
+- Inside source: true
+*** True Line Result
+ <body>
+** Processing line: ~ <script>~
+- Inside source: true
+*** True Line Result
+ <script>
+** Processing line: ~ async function submitForm(url) {~
+- Inside source: true
+*** True Line Result
+ async function submitForm(url) {
+** Processing line: ~ const result = await fetch(url, {~
+- Inside source: true
+*** True Line Result
+ const result = await fetch(url, {
+** Processing line: ~ method: 'POST',~
+- Inside source: true
+*** True Line Result
+ method: 'POST',
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+- Inside source: true
+*** True Line Result
+ headers: { 'Content-Type': 'application/json' },
+** Processing line: ~ body: JSON.stringify({}),~
+- Inside source: true
+*** True Line Result
+ body: JSON.stringify({}),
+** Processing line: ~ });~
+- Inside source: true
+*** True Line Result
+ });
+** Processing line: ~ document.getElementById("success-notification").innerHTML = "successful";~
+- Inside source: true
+*** True Line Result
+ document.getElementById("success-notification").innerHTML = "successful";
+** Processing line: ~ setTimeout(function() { document.getElementById("success-notification").innerHTML = ""; }, 3000);~
+- Inside source: true
+*** True Line Result
+ setTimeout(function() { document.getElementById("success-notification").innerHTML = ""; }, 3000);
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ </script>~
+- Inside source: true
+*** True Line Result
+ </script>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <input type="button" value="Show Console" onclick="submitForm('/dragon/show_console/')" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Show Console" onclick="submitForm('/dragon/show_console/')" />
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <input type="button" value="Reset Game" onclick="submitForm('/dragon/reset/');" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Reset Game" onclick="submitForm('/dragon/reset/');" />
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <input type="button" value="Record Gameplay" onclick="submitForm('/dragon/record/');" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Record Gameplay" onclick="submitForm('/dragon/record/');" />
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <input type="button" value="Stop Recording" onclick="submitForm('/dragon/record_stop/');" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Stop Recording" onclick="submitForm('/dragon/record_stop/');" />
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <form>~
+- Inside source: true
+*** True Line Result
+ <form>
+** Processing line: ~ <input type="button" value="Replay Recording" onclick="submitForm('/dragon/replay/');" />~
+- Inside source: true
+*** True Line Result
+ <input type="button" value="Replay Recording" onclick="submitForm('/dragon/replay/');" />
+** Processing line: ~ </form>~
+- Inside source: true
+*** True Line Result
+ </form>
+** Processing line: ~ <div id="success-notification"></div>~
+- Inside source: true
+*** True Line Result
+ <div id="success-notification"></div>
+** Processing line: ~ #{links}~
+- Inside source: true
+*** True Line Result
+ #{links}
+** Processing line: ~ </body>~
+- Inside source: true
+*** True Line Result
+ </body>
+** Processing line: ~ </html>~
+- Inside source: true
+*** True Line Result
+ </html>
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_api_control_panel args, req~
+- Inside source: true
+*** True Line Result
+ def get_api_control_panel args, req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ control_panel_view,~
+- Inside source: true
+*** True Line Result
+ control_panel_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def json? req~
+- Inside source: true
+*** True Line Result
+ def json? req
+** Processing line: ~ req.headers.find { |k, v| k == "Content-Type" && (v.include? "application/json") }~
+- Inside source: true
+*** True Line Result
+ req.headers.find { |k, v| k == "Content-Type" && (v.include? "application/json") }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_reset args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_reset args, req
+** Processing line: ~ $gtk.reset if json? req~
+- Inside source: true
+*** True Line Result
+ $gtk.reset if json? req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ control_panel_view,~
+- Inside source: true
+*** True Line Result
+ control_panel_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_record args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_record args, req
+** Processing line: ~ $recording.start 100 if json? req~
+- Inside source: true
+*** True Line Result
+ $recording.start 100 if json? req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ control_panel_view,~
+- Inside source: true
+*** True Line Result
+ control_panel_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_record_stop args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_record_stop args, req
+** Processing line: ~ $recording.stop 'replay.txt' if json? req~
+- Inside source: true
+*** True Line Result
+ $recording.stop 'replay.txt' if json? req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ control_panel_view,~
+- Inside source: true
+*** True Line Result
+ control_panel_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_replay args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_replay args, req
+** Processing line: ~ $replay.start 'replay.txt' if json? req~
+- Inside source: true
+*** True Line Result
+ $replay.start 'replay.txt' if json? req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ control_panel_view,~
+- Inside source: true
+*** True Line Result
+ control_panel_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def post_api_show_console args, req~
+- Inside source: true
+*** True Line Result
+ def post_api_show_console args, req
+** Processing line: ~ $gtk.console.show if json? req~
+- Inside source: true
+*** True Line Result
+ $gtk.console.show if json? req
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ control_panel_view,~
+- Inside source: true
+*** True Line Result
+ control_panel_view,
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/html' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ args.inputs.http_requests.each do |req|~
+- Inside source: true
+*** True Line Result
+ args.inputs.http_requests.each do |req|
+** Processing line: ~ match_candidate = { method: req.method.downcase.to_sym,~
+- Inside source: true
+*** True Line Result
+ match_candidate = { method: req.method.downcase.to_sym,
+** Processing line: ~ uri: req.uri,~
+- Inside source: true
+*** True Line Result
+ uri: req.uri,
+** Processing line: ~ uri_without_query_string: (req.uri.split '?').first,~
+- Inside source: true
+*** True Line Result
+ uri_without_query_string: (req.uri.split '?').first,
+** Processing line: ~ query_string: (req.uri.split '?').last,~
+- Inside source: true
+*** True Line Result
+ query_string: (req.uri.split '?').last,
+** Processing line: ~ has_query_string: !!(req.uri.split '?').last,~
+- Inside source: true
+*** True Line Result
+ has_query_string: !!(req.uri.split '?').last,
+** Processing line: ~ has_api_prefix: (req.uri.start_with? "/dragon"),~
+- Inside source: true
+*** True Line Result
+ has_api_prefix: (req.uri.start_with? "/dragon"),
+** Processing line: ~ end_with_rb: (req.uri.end_with? ".rb"),~
+- Inside source: true
+*** True Line Result
+ end_with_rb: (req.uri.end_with? ".rb"),
+** Processing line: ~ has_file_extension: file_extensions.find { |f| req.uri.include? f },~
+- Inside source: true
+*** True Line Result
+ has_file_extension: file_extensions.find { |f| req.uri.include? f },
+** Processing line: ~ has_trailing_slash: (req.uri.split('?').first.end_with? "/") }~
+- Inside source: true
+*** True Line Result
+ has_trailing_slash: (req.uri.split('?').first.end_with? "/") }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if !match_candidate[:has_file_extension]~
+- Inside source: true
+*** True Line Result
+ if !match_candidate[:has_file_extension]
+** Processing line: ~ if !match_candidate[:has_trailing_slash]~
+- Inside source: true
+*** True Line Result
+ if !match_candidate[:has_trailing_slash]
+** Processing line: ~ match_candidate[:uri] = match_candidate[:uri_without_query_string] + "/"~
+- Inside source: true
+*** True Line Result
+ match_candidate[:uri] = match_candidate[:uri_without_query_string] + "/"
+** Processing line: ~ if match_candidate[:query_string]~
+- Inside source: true
+*** True Line Result
+ if match_candidate[:query_string]
+** Processing line: ~ match_candidate[:uri] += "?#{match_candidate[:query_string]}"~
+- Inside source: true
+*** True Line Result
+ match_candidate[:uri] += "?#{match_candidate[:query_string]}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ context = { args: args, req: req, match_candidate: match_candidate }~
+- Inside source: true
+*** True Line Result
+ context = { args: args, req: req, match_candidate: match_candidate }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ process! context: context, routes: routes~
+- Inside source: true
+*** True Line Result
+ process! context: context, routes: routes
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def url_decode args, string~
+- Inside source: true
+*** True Line Result
+ def url_decode args, string
+** Processing line: ~ args.fn.gsub string,~
+- Inside source: true
+*** True Line Result
+ args.fn.gsub string,
+** Processing line: ~ '+', " ",~
+- Inside source: true
+*** True Line Result
+ '+', " ",
+** Processing line: ~ '%27', "'",~
+- Inside source: true
+*** True Line Result
+ '%27', "'",
+** Processing line: ~ '%22', '"',~
+- Inside source: true
+*** True Line Result
+ '%22', '"',
+** Processing line: ~ '%0D%0A', "\n",~
+- Inside source: true
+*** True Line Result
+ '%0D%0A', "\n",
+** Processing line: ~ '%3D', "=",~
+- Inside source: true
+*** True Line Result
+ '%3D', "=",
+** Processing line: ~ '%3B', ";",~
+- Inside source: true
+*** True Line Result
+ '%3B', ";",
+** Processing line: ~ '%7C', "|",~
+- Inside source: true
+*** True Line Result
+ '%7C', "|",
+** Processing line: ~ '%28', "(",~
+- Inside source: true
+*** True Line Result
+ '%28', "(",
+** Processing line: ~ '%29', ")",~
+- Inside source: true
+*** True Line Result
+ '%29', ")",
+** Processing line: ~ '%7B', "{",~
+- Inside source: true
+*** True Line Result
+ '%7B', "{",
+** Processing line: ~ '%7D', "}",~
+- Inside source: true
+*** True Line Result
+ '%7D', "}",
+** Processing line: ~ '%2C', ",",~
+- Inside source: true
+*** True Line Result
+ '%2C', ",",
+** Processing line: ~ '%3A', ":",~
+- Inside source: true
+*** True Line Result
+ '%3A', ":",
+** Processing line: ~ '%5B', "[",~
+- Inside source: true
+*** True Line Result
+ '%5B', "[",
+** Processing line: ~ '%5D', "]",~
+- Inside source: true
+*** True Line Result
+ '%5D', "]",
+** Processing line: ~ '%23', "#",~
+- Inside source: true
+*** True Line Result
+ '%23', "#",
+** Processing line: ~ '%21', "!",~
+- Inside source: true
+*** True Line Result
+ '%21', "!",
+** Processing line: ~ '%3C', "<",~
+- Inside source: true
+*** True Line Result
+ '%3C', "<",
+** Processing line: ~ '%3E', ">",~
+- Inside source: true
+*** True Line Result
+ '%3E', ">",
+** Processing line: ~ '%2B', "+",~
+- Inside source: true
+*** True Line Result
+ '%2B', "+",
+** Processing line: ~ '%2F', "/",~
+- Inside source: true
+*** True Line Result
+ '%2F', "/",
+** Processing line: ~ '%40', "@",~
+- Inside source: true
+*** True Line Result
+ '%40', "@",
+** Processing line: ~ '%3F', "?",~
+- Inside source: true
+*** True Line Result
+ '%3F', "?",
+** Processing line: ~ '%26', "&",~
+- Inside source: true
+*** True Line Result
+ '%26', "&",
+** Processing line: ~ '%24', "$",~
+- Inside source: true
+*** True Line Result
+ '%24', "$",
+** Processing line: ~ '%5C', "\\",~
+- Inside source: true
+*** True Line Result
+ '%5C', "\\",
+** Processing line: ~ '%60', "`",~
+- Inside source: true
+*** True Line Result
+ '%60', "`",
+** Processing line: ~ '%7E', "~",~
+- Inside source: true
+*** True Line Result
+ '%7E', "~",
+** Processing line: ~ '%C2%B2', "²",~
+- Inside source: true
+*** True Line Result
+ '%C2%B2', "²",
+** Processing line: ~ '%5E', "^",~
+- Inside source: true
+*** True Line Result
+ '%5E', "^",
+** Processing line: ~ '%C2%BA', "º",~
+- Inside source: true
+*** True Line Result
+ '%C2%BA', "º",
+** Processing line: ~ '%C2%A7', "§",~
+- Inside source: true
+*** True Line Result
+ '%C2%A7', "§",
+** Processing line: ~ '%20', " ",~
+- Inside source: true
+*** True Line Result
+ '%20', " ",
+** Processing line: ~ '%0A', "\n",~
+- Inside source: true
+*** True Line Result
+ '%0A', "\n",
+** Processing line: ~ '%25', "%",~
+- Inside source: true
+*** True Line Result
+ '%25', "%",
+** Processing line: ~ '%2A', "*"~
+- Inside source: true
+*** True Line Result
+ '%2A', "*"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def file_extensions~
+- Inside source: true
+*** True Line Result
+ def file_extensions
+** Processing line: ~ [".html", ".css", ".gif", ".txt", ".ico", ".rb"]~
+- Inside source: true
+*** True Line Result
+ [".html", ".css", ".gif", ".txt", ".ico", ".rb"]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def routes~
+- Inside source: true
+*** True Line Result
+ def routes
+** Processing line: ~ [{ match_criteria: { method: :get, uri: "/" },~
+- Inside source: true
+*** True Line Result
+ [{ match_criteria: { method: :get, uri: "/" },
+** Processing line: ~ handler: :get_index },~
+- Inside source: true
+*** True Line Result
+ handler: :get_index },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/" },
+** Processing line: ~ handler: :get_index },~
+- Inside source: true
+*** True Line Result
+ handler: :get_index },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/boot/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/boot/" },
+** Processing line: ~ handler: :get_api_boot },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_boot },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/trace/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/trace/" },
+** Processing line: ~ handler: :get_api_trace },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_trace },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/puts/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/puts/" },
+** Processing line: ~ handler: :get_api_puts },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_puts },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/log/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/log/" },
+** Processing line: ~ handler: :get_api_log },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_log },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/log/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/log/" },
+** Processing line: ~ handler: :post_api_log },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_log },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/changes/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/changes/" },
+** Processing line: ~ handler: :get_api_changes },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_changes },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/eval/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/eval/" },
+** Processing line: ~ handler: :get_api_eval },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_eval },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/eval/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/eval/" },
+** Processing line: ~ handler: :post_api_eval },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_eval },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/console/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/console/" },
+** Processing line: ~ handler: :get_api_console },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_console },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/console/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/console/" },
+** Processing line: ~ handler: :post_api_console },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_console },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/control_panel/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/control_panel/" },
+** Processing line: ~ handler: :get_api_control_panel },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_control_panel },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/reset/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/reset/" },
+** Processing line: ~ handler: :post_api_reset },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_reset },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/record/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/record/" },
+** Processing line: ~ handler: :post_api_record },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_record },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/record_stop/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/record_stop/" },
+** Processing line: ~ handler: :post_api_record_stop },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_record_stop },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/replay/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/replay/" },
+** Processing line: ~ handler: :post_api_replay },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_replay },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/show_console/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/show_console/" },
+** Processing line: ~ handler: :post_api_show_console },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_show_console },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/code/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/code/" },
+** Processing line: ~ handler: :get_api_code },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_code },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/autocomplete/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/dragon/autocomplete/" },
+** Processing line: ~ handler: :get_api_autocomplete },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_autocomplete },
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/autocomplete/" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri: "/dragon/autocomplete/" },
+** Processing line: ~ handler: :post_api_autocomplete },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_autocomplete },
+** Processing line: ~ { match_criteria: { method: :get, uri_without_query_string: "/dragon/code/edit/", has_query_string: true },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri_without_query_string: "/dragon/code/edit/", has_query_string: true },
+** Processing line: ~ handler: :get_api_code_edit },~
+- Inside source: true
+*** True Line Result
+ handler: :get_api_code_edit },
+** Processing line: ~ { match_criteria: { method: :post, uri_without_query_string: "/dragon/code/update/", has_query_string: true },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :post, uri_without_query_string: "/dragon/code/update/", has_query_string: true },
+** Processing line: ~ handler: :post_api_code_update },~
+- Inside source: true
+*** True Line Result
+ handler: :post_api_code_update },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/docs.html" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/docs.html" },
+** Processing line: ~ handler: :get_docs_html },~
+- Inside source: true
+*** True Line Result
+ handler: :get_docs_html },
+** Processing line: ~ { match_criteria: { method: :get, uri_without_query_string: "/docs.css" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri_without_query_string: "/docs.css" },
+** Processing line: ~ handler: :get_docs_css },~
+- Inside source: true
+*** True Line Result
+ handler: :get_docs_css },
+** Processing line: ~ { match_criteria: { method: :get, uri: "/docs_search.gif" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/docs_search.gif" },
+** Processing line: ~ handler: :get_docs_search_gif },~
+- Inside source: true
+*** True Line Result
+ handler: :get_docs_search_gif },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_index.html" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/src_backup_index.html" },
+** Processing line: ~ handler: :get_src_backup_index_html },~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup_index_html },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_index.txt" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/src_backup_index.txt" },
+** Processing line: ~ handler: :get_src_backup_index_txt },~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup_index_txt },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_changes.html" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/src_backup_changes.html" },
+** Processing line: ~ handler: :get_src_backup_changes_html },~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup_changes_html },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_changes.txt" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/src_backup_changes.txt" },
+** Processing line: ~ handler: :get_src_backup_changes_txt },~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup_changes_txt },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup.css" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/src_backup.css" },
+** Processing line: ~ handler: :get_src_backup_css },~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup_css },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, uri: "/favicon.ico" },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, uri: "/favicon.ico" },
+** Processing line: ~ handler: :get_favicon_ico },~
+- Inside source: true
+*** True Line Result
+ handler: :get_favicon_ico },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, end_with_rb: true },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, end_with_rb: true },
+** Processing line: ~ handler: :get_src_backup },~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup },
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ { match_criteria: { method: :get, end_with_rb: true },~
+- Inside source: true
+*** True Line Result
+ { match_criteria: { method: :get, end_with_rb: true },
+** Processing line: ~ handler: :get_src_backup }~
+- Inside source: true
+*** True Line Result
+ handler: :get_src_backup }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def process! opts~
+- Inside source: true
+*** True Line Result
+ def process! opts
+** Processing line: ~ routes = opts[:routes]~
+- Inside source: true
+*** True Line Result
+ routes = opts[:routes]
+** Processing line: ~ context = opts[:context]~
+- Inside source: true
+*** True Line Result
+ context = opts[:context]
+** Processing line: ~ routes.each do |route|~
+- Inside source: true
+*** True Line Result
+ routes.each do |route|
+** Processing line: ~ match_found = (process_single! route: route, context: context)~
+- Inside source: true
+*** True Line Result
+ match_found = (process_single! route: route, context: context)
+** Processing line: ~ return if match_found~
+- Inside source: true
+*** True Line Result
+ return if match_found
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def process_single! opts~
+- Inside source: true
+*** True Line Result
+ def process_single! opts
+** Processing line: ~ match_criteria = opts[:route][:match_criteria]~
+- Inside source: true
+*** True Line Result
+ match_criteria = opts[:route][:match_criteria]
+** Processing line: ~ m = opts[:route][:handler]~
+- Inside source: true
+*** True Line Result
+ m = opts[:route][:handler]
+** Processing line: ~ args = opts[:context][:args]~
+- Inside source: true
+*** True Line Result
+ args = opts[:context][:args]
+** Processing line: ~ req = opts[:context][:req]~
+- Inside source: true
+*** True Line Result
+ req = opts[:context][:req]
+** Processing line: ~ match_candidate = opts[:context][:match_candidate]~
+- Inside source: true
+*** True Line Result
+ match_candidate = opts[:context][:match_candidate]
+** Processing line: ~ match_criteria.each do |k, v|~
+- Inside source: true
+*** True Line Result
+ match_criteria.each do |k, v|
+** Processing line: ~ return false if match_candidate[k] != v~
+- Inside source: true
+*** True Line Result
+ return false if match_candidate[k] != v
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ begin~
+- Inside source: true
+*** True Line Result
+ begin
+** Processing line: ~ send m, args, req~
+- Inside source: true
+*** True Line Result
+ send m, args, req
+** Processing line: ~ rescue Exception => e~
+- Inside source: true
+*** True Line Result
+ rescue Exception => e
+** Processing line: ~ req.respond 200,~
+- Inside source: true
+*** True Line Result
+ req.respond 200,
+** Processing line: ~ "#{e}\n#{e.__backtrace_to_org__}",~
+- Inside source: true
+*** True Line Result
+ "#{e}\n#{e.__backtrace_to_org__}",
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+- Inside source: true
+*** True Line Result
+ { 'Content-Type' => 'text/plain' }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ return true~
+- Inside source: true
+*** True Line Result
+ return true
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~*** args.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
*** args.rb
** Processing line: ~#+begin_src ruby~
- Line was identified as the beginning of a code block.
@@ -148866,6 +155066,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
include Serialize
+** Processing line: ~ attr_accessor :cvars~
+- Inside source: true
+*** True Line Result
+ attr_accessor :cvars
** Processing line: ~ attr_accessor :inputs~
- Inside source: true
*** True Line Result
@@ -148946,6 +155150,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@outputs = Outputs.new args: self
+** Processing line: ~ @cvars = {}~
+- Inside source: true
+*** True Line Result
+ @cvars = {}
** Processing line: ~ @audio = {}~
- Inside source: true
*** True Line Result
@@ -150890,26 +157098,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ attr_accessor :show_reason, :log, :logo, :background_color,~
+** Processing line: ~ attr_accessor :show_reason, :log, :logo,~
- Inside source: true
*** True Line Result
- attr_accessor :show_reason, :log, :logo, :background_color,
-** Processing line: ~ :text_color, :animation_duration,~
+ attr_accessor :show_reason, :log, :logo,
+** Processing line: ~ :animation_duration,~
- Inside source: true
*** True Line Result
- :text_color, :animation_duration,
+ :animation_duration,
** Processing line: ~ :max_log_lines, :max_history, :log,~
- Inside source: true
*** True Line Result
:max_log_lines, :max_history, :log,
-** Processing line: ~ :last_command_errored, :last_command, :error_color, :shown_at,~
+** Processing line: ~ :last_command_errored, :last_command, :shown_at,~
- Inside source: true
*** True Line Result
- :last_command_errored, :last_command, :error_color, :shown_at,
-** Processing line: ~ :header_color, :archived_log, :last_log_lines, :last_log_lines_count,~
+ :last_command_errored, :last_command, :shown_at,
+** Processing line: ~ :archived_log, :last_log_lines, :last_log_lines_count,~
- Inside source: true
*** True Line Result
- :header_color, :archived_log, :last_log_lines, :last_log_lines_count,
+ :archived_log, :last_log_lines, :last_log_lines_count,
** Processing line: ~ :suppress_left_arrow_behavior, :command_set_at,~
- Inside source: true
*** True Line Result
@@ -150918,10 +157126,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:toast_ids, :bottom,
-** Processing line: ~ :font_style, :menu~
+** Processing line: ~ :font_style, :menu,~
+- Inside source: true
+*** True Line Result
+ :font_style, :menu,
+** Processing line: ~ :background_color, :spam_color, :text_color, :warn_color,~
+- Inside source: true
+*** True Line Result
+ :background_color, :spam_color, :text_color, :warn_color,
+** Processing line: ~ :error_color, :header_color, :code_color, :comment_color,~
+- Inside source: true
+*** True Line Result
+ :error_color, :header_color, :code_color, :comment_color,
+** Processing line: ~ :debug_color, :unfiltered_color~
- Inside source: true
*** True Line Result
- :font_style, :menu
+ :debug_color, :unfiltered_color
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -150990,22 +157210,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@logo = 'console-logo.png'
-** Processing line: ~ @history_fname = 'console_history.txt'~
+** Processing line: ~ @history_fname = 'logs/console_history.txt'~
- Inside source: true
*** True Line Result
- @history_fname = 'console_history.txt'
+ @history_fname = 'logs/console_history.txt'
** Processing line: ~ @background_color = Color.new [0, 0, 0, 224]~
- Inside source: true
*** True Line Result
@background_color = Color.new [0, 0, 0, 224]
-** Processing line: ~ @text_color = Color.new [255, 255, 255]~
-- Inside source: true
-*** True Line Result
- @text_color = Color.new [255, 255, 255]
-** Processing line: ~ @error_color = Color.new [200, 50, 50]~
-- Inside source: true
-*** True Line Result
- @error_color = Color.new [200, 50, 50]
** Processing line: ~ @header_color = Color.new [100, 200, 220]~
- Inside source: true
*** True Line Result
@@ -151014,10 +157226,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@code_color = Color.new [210, 168, 255]
-** Processing line: ~ @comment_color = Color.new [0, 200, 100]~
+** Processing line: ~ @comment_color = Color.new [0, 200, 100]~
- Inside source: true
*** True Line Result
- @comment_color = Color.new [0, 200, 100]
+ @comment_color = Color.new [0, 200, 100]
** Processing line: ~ @animation_duration = 1.seconds~
- Inside source: true
*** True Line Result
@@ -151026,6 +157238,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@shown_at = -1
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # these are the colors for text at various log levels.~
+- Inside source: true
+*** True Line Result
+ # these are the colors for text at various log levels.
+** Processing line: ~ @spam_color = Color.new [160, 160, 160]~
+- Inside source: true
+*** True Line Result
+ @spam_color = Color.new [160, 160, 160]
+** Processing line: ~ @debug_color = Color.new [0, 255, 0]~
+- Inside source: true
+*** True Line Result
+ @debug_color = Color.new [0, 255, 0]
+** Processing line: ~ @text_color = Color.new [255, 255, 255]~
+- Inside source: true
+*** True Line Result
+ @text_color = Color.new [255, 255, 255]
+** Processing line: ~ @warn_color = Color.new [255, 255, 0]~
+- Inside source: true
+*** True Line Result
+ @warn_color = Color.new [255, 255, 0]
+** Processing line: ~ @error_color = Color.new [200, 50, 50]~
+- Inside source: true
+*** True Line Result
+ @error_color = Color.new [200, 50, 50]
+** Processing line: ~ @unfiltered_color = Color.new [0, 255, 255]~
+- Inside source: true
+*** True Line Result
+ @unfiltered_color = Color.new [0, 255, 255]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ load_history~
- Inside source: true
*** True Line Result
@@ -151286,10 +157534,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def add_text obj~
+** Processing line: ~ def add_text obj, loglevel=-1~
+- Inside source: true
+*** True Line Result
+ def add_text obj, loglevel=-1
+** Processing line: ~ # loglevel is one of the values of LogLevel in logging.h, or -1 to say "we don't care, colorize it with your special string parsing magic"~
+- Inside source: true
+*** True Line Result
+ # loglevel is one of the values of LogLevel in logging.h, or -1 to say "we don't care, colorize it with your special string parsing magic"
+** Processing line: ~ loglevel = -1 if loglevel < 0~
+- Inside source: true
+*** True Line Result
+ loglevel = -1 if loglevel < 0
+** Processing line: ~ loglevel = 5 if loglevel > 5 # 5 == unfiltered (it's 0x7FFFFFFE in C, clamp it down)~
+- Inside source: true
+*** True Line Result
+ loglevel = 5 if loglevel > 5 # 5 == unfiltered (it's 0x7FFFFFFE in C, clamp it down)
+** Processing line: ~ loglevel = 2 if (loglevel == -1) && obj.start_with?('!c!') # oh well~
- Inside source: true
*** True Line Result
- def add_text obj
+ loglevel = 2 if (loglevel == -1) && obj.start_with?('!c!') # oh well
+** Processing line: ~ colorstr = (loglevel != -1) ? "!c!#{loglevel}" : nil~
+- Inside source: true
+*** True Line Result
+ colorstr = (loglevel != -1) ? "!c!#{loglevel}" : nil
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ @last_log_lines_count ||= 1~
- Inside source: true
*** True Line Result
@@ -151322,14 +157594,38 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
str.each_line do |s|
-** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~
+** Processing line: ~ if colorstr.nil?~
+- Inside source: true
+*** True Line Result
+ if colorstr.nil?
+** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~
+- Inside source: true
+*** True Line Result
+ s.wrapped_lines(self.console_text_width).each do |l|
+** Processing line: ~ log_lines << l~
+- Inside source: true
+*** True Line Result
+ log_lines << l
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ else~
- Inside source: true
*** True Line Result
- s.wrapped_lines(self.console_text_width).each do |l|
-** Processing line: ~ log_lines << l~
+ else
+** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~
- Inside source: true
*** True Line Result
- log_lines << l
+ s.wrapped_lines(self.console_text_width).each do |l|
+** Processing line: ~ log_lines << "#{colorstr}#{l}"~
+- Inside source: true
+*** True Line Result
+ log_lines << "#{colorstr}#{l}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -151342,10 +157638,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if log_lines == @last_log_lines~
+** Processing line: ~ if log_lines == @last_log_lines && log_lines.length != 0~
- Inside source: true
*** True Line Result
- if log_lines == @last_log_lines
+ if log_lines == @last_log_lines && log_lines.length != 0
** Processing line: ~ @last_log_lines_count += 1~
- Inside source: true
*** True Line Result
@@ -152442,22 +158738,30 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0~
+** Processing line: ~ if args.inputs.mouse.wheel~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.wheel
+** Processing line: ~ if args.inputs.mouse.wheel.y > 0~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.wheel.y > 0
+** Processing line: ~ @inertia = 1~
- Inside source: true
*** True Line Result
- if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0
-** Processing line: ~ @inertia = 1~
+ @inertia = 1
+** Processing line: ~ elsif args.inputs.mouse.wheel.y < 0~
- Inside source: true
*** True Line Result
- @inertia = 1
-** Processing line: ~ elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0~
+ elsif args.inputs.mouse.wheel.y < 0
+** Processing line: ~ @inertia = -1~
- Inside source: true
*** True Line Result
- elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0
-** Processing line: ~ @inertia = -1~
+ @inertia = -1
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- @inertia = -1
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -152490,34 +158794,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if @inertia != 0~
-- Inside source: true
-*** True Line Result
- if @inertia != 0
-** Processing line: ~ @inertia = (@inertia * 0.7)~
-- Inside source: true
-*** True Line Result
- @inertia = (@inertia * 0.7)
-** Processing line: ~ if @inertia > 0~
+** Processing line: ~ @inertia = (@inertia * 0.7)~
- Inside source: true
*** True Line Result
- if @inertia > 0
-** Processing line: ~ @log_offset -= 1~
+ @inertia = (@inertia * 0.7)
+** Processing line: ~ if @inertia > 0~
- Inside source: true
*** True Line Result
- @log_offset -= 1
-** Processing line: ~ elsif @inertia < 0~
+ if @inertia > 0
+** Processing line: ~ @log_offset += 1~
- Inside source: true
*** True Line Result
- elsif @inertia < 0
-** Processing line: ~ @log_offset += 1~
+ @log_offset += 1
+** Processing line: ~ elsif @inertia < 0~
- Inside source: true
*** True Line Result
- @log_offset += 1
-** Processing line: ~ end~
+ elsif @inertia < 0
+** Processing line: ~ @log_offset -= 1~
- Inside source: true
*** True Line Result
- end
+ @log_offset -= 1
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -152978,10 +159274,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
color = color.mult_alpha(0.5) if archived
-** Processing line: ~~
+** Processing line: ~ str = str[4..-1] if str.start_with?('!c!') # chop off loglevel color~
- Inside source: true
*** True Line Result
-
+ str = str[4..-1] if str.start_with?('!c!') # chop off loglevel color
** Processing line: ~ args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color)~
- Inside source: true
*** True Line Result
@@ -153922,10 +160218,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def color_for_log_entry(log_entry)~
+** Processing line: ~ def color_for_plain_text log_entry~
- Inside source: true
*** True Line Result
- def color_for_log_entry(log_entry)
+ def color_for_plain_text log_entry
+** Processing line: ~ log_entry = log_entry[4..-1] if log_entry.start_with? "!c!"~
+- Inside source: true
+*** True Line Result
+ log_entry = log_entry[4..-1] if log_entry.start_with? "!c!"
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ if code? log_entry~
- Inside source: true
*** True Line Result
@@ -154002,6 +160306,98 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def color_for_log_entry(log_entry)~
+- Inside source: true
+*** True Line Result
+ def color_for_log_entry(log_entry)
+** Processing line: ~ if log_entry.start_with?('!c!') # loglevel color specified.~
+- Inside source: true
+*** True Line Result
+ if log_entry.start_with?('!c!') # loglevel color specified.
+** Processing line: ~ return case log_entry[3..3].to_i~
+- Inside source: true
+*** True Line Result
+ return case log_entry[3..3].to_i
+** Processing line: ~ when 0 # spam~
+- Inside source: true
+*** True Line Result
+ when 0 # spam
+** Processing line: ~ @spam_color~
+- Inside source: true
+*** True Line Result
+ @spam_color
+** Processing line: ~ when 1 # debug~
+- Inside source: true
+*** True Line Result
+ when 1 # debug
+** Processing line: ~ @debug_color~
+- Inside source: true
+*** True Line Result
+ @debug_color
+** Processing line: ~ #when 2 # info (caught by the `else` block.)~
+- Inside source: true
+*** True Line Result
+ #when 2 # info (caught by the `else` block.)
+** Processing line: ~ # @text_color~
+- Inside source: true
+*** True Line Result
+ # @text_color
+** Processing line: ~ when 3 # warn~
+- Inside source: true
+*** True Line Result
+ when 3 # warn
+** Processing line: ~ @warn_color~
+- Inside source: true
+*** True Line Result
+ @warn_color
+** Processing line: ~ when 4 # error~
+- Inside source: true
+*** True Line Result
+ when 4 # error
+** Processing line: ~ @error_color~
+- Inside source: true
+*** True Line Result
+ @error_color
+** Processing line: ~ when 5 # unfiltered~
+- Inside source: true
+*** True Line Result
+ when 5 # unfiltered
+** Processing line: ~ @unfiltered_color~
+- Inside source: true
+*** True Line Result
+ @unfiltered_color
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ color_for_plain_text log_entry~
+- Inside source: true
+*** True Line Result
+ color_for_plain_text log_entry
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ return color_for_plain_text log_entry~
+- Inside source: true
+*** True Line Result
+ return color_for_plain_text log_entry
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def prompt~
- Inside source: true
*** True Line Result
@@ -155822,10 +162218,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
items.each_slice(columns).each_with_index do |cells, i|
-** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~
+** Processing line: ~ pretty_print_row_separator string_width, cell_width, column_width, columns~
- Inside source: true
*** True Line Result
- pretty_print_row_seperator string_width, cell_width, column_width, columns
+ pretty_print_row_separator string_width, cell_width, column_width, columns
** Processing line: ~ pretty_print_row cells, string_width, cell_width, column_width, columns~
- Inside source: true
*** True Line Result
@@ -155838,10 +162234,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~
+** Processing line: ~ pretty_print_row_separator string_width, cell_width, column_width, columns~
- Inside source: true
*** True Line Result
- pretty_print_row_seperator string_width, cell_width, column_width, columns
+ pretty_print_row_separator string_width, cell_width, column_width, columns
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -159206,14 +165602,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
start_tick + duration,
-** Processing line: ~ (initial_value *definitions),~
+** Processing line: ~ initial_value(*definitions),~
- Inside source: true
*** True Line Result
- (initial_value *definitions),
-** Processing line: ~ (final_value *definitions),~
+ initial_value(*definitions),
+** Processing line: ~ final_value(*definitions),~
- Inside source: true
*** True Line Result
- (final_value *definitions),
+ final_value(*definitions),
** Processing line: ~ *definitions~
- Inside source: true
*** True Line Result
@@ -159998,14 +166394,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def self.rotate_point point, angle, around = nil
-** Processing line: ~ s = Math.sin a.to_radians~
+** Processing line: ~ s = Math.sin angle.to_radians~
- Inside source: true
*** True Line Result
- s = Math.sin a.to_radians
-** Processing line: ~ c = Math.cos a.to_radians~
+ s = Math.sin angle.to_radians
+** Processing line: ~ c = Math.cos angle.to_radians~
- Inside source: true
*** True Line Result
- c = Math.cos a.to_radians
+ c = Math.cos angle.to_radians
** Processing line: ~ px = point.x~
- Inside source: true
*** True Line Result
@@ -160726,14 +167122,46 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# @gtk
-** Processing line: ~ def self.line_y_intercept line~
+** Processing line: ~ def self.line_y_intercept line, replace_infinity: nil~
- Inside source: true
*** True Line Result
- def self.line_y_intercept line
-** Processing line: ~ line.y - line_slope(line) * line.x~
+ def self.line_y_intercept line, replace_infinity: nil
+** Processing line: ~ line.y - line_slope(line, replace_infinity: replace_infinity) * line.x~
- Inside source: true
*** True Line Result
- line.y - line_slope(line) * line.x
+ line.y - line_slope(line, replace_infinity: replace_infinity) * line.x
+** Processing line: ~ rescue Exception => e~
+- Inside source: true
+*** True Line Result
+ rescue Exception => e
+** Processing line: ~ raise <<-S~
+- Inside source: true
+*** True Line Result
+ raise <<-S
+** Processing line: ~ * ERROR: ~Geometry::line_y_intercept~~
+- Inside source: true
+*** True Line Result
+ * ERROR: ~Geometry::line_y_intercept~
+** Processing line: ~ The following exception was thrown for line: #{line}~
+- Inside source: true
+*** True Line Result
+ The following exception was thrown for line: #{line}
+** Processing line: ~ #{e}~
+- Inside source: true
+*** True Line Result
+ #{e}
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.~
+- Inside source: true
+*** True Line Result
+ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -161034,26 +167462,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# @gtk
-** Processing line: ~ def self.line_intersect line_one, line_two~
+** Processing line: ~ def self.line_intersect line_one, line_two, replace_infinity: nil~
- Inside source: true
*** True Line Result
- def self.line_intersect line_one, line_two
-** Processing line: ~ m1 = line_slope(line_one)~
+ def self.line_intersect line_one, line_two, replace_infinity: nil
+** Processing line: ~ m1 = line_slope(line_one, replace_infinity: replace_infinity)~
- Inside source: true
*** True Line Result
- m1 = line_slope(line_one)
-** Processing line: ~ m2 = line_slope(line_two)~
+ m1 = line_slope(line_one, replace_infinity: replace_infinity)
+** Processing line: ~ m2 = line_slope(line_two, replace_infinity: replace_infinity)~
- Inside source: true
*** True Line Result
- m2 = line_slope(line_two)
-** Processing line: ~ b1 = line_y_intercept(line_one)~
+ m2 = line_slope(line_two, replace_infinity: replace_infinity)
+** Processing line: ~ b1 = line_y_intercept(line_one, replace_infinity: replace_infinity)~
- Inside source: true
*** True Line Result
- b1 = line_y_intercept(line_one)
-** Processing line: ~ b2 = line_y_intercept(line_two)~
+ b1 = line_y_intercept(line_one, replace_infinity: replace_infinity)
+** Processing line: ~ b2 = line_y_intercept(line_two, replace_infinity: replace_infinity)~
- Inside source: true
*** True Line Result
- b2 = line_y_intercept(line_two)
+ b2 = line_y_intercept(line_two, replace_infinity: replace_infinity)
** Processing line: ~ x = (b1 - b2) / (m2 - m1)~
- Inside source: true
*** True Line Result
@@ -161066,6 +167494,38 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
[x, y]
+** Processing line: ~ rescue Exception => e~
+- Inside source: true
+*** True Line Result
+ rescue Exception => e
+** Processing line: ~ raise <<-S~
+- Inside source: true
+*** True Line Result
+ raise <<-S
+** Processing line: ~ * ERROR: ~Geometry::line_intersect~~
+- Inside source: true
+*** True Line Result
+ * ERROR: ~Geometry::line_intersect~
+** Processing line: ~ The following exception was thrown for line_one: #{line_one}, line_two: #{line_two}~
+- Inside source: true
+*** True Line Result
+ The following exception was thrown for line_one: #{line_one}, line_two: #{line_two}
+** Processing line: ~ #{e}~
+- Inside source: true
+*** True Line Result
+ #{e}
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.~
+- Inside source: true
+*** True Line Result
+ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -163810,10 +170270,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
collection.each do |m|
-** Processing line: ~ self.instance_variable_set("@#{m.to_s}".to_sym, value)~
+** Processing line: ~ m_to_s = m.to_s~
+- Inside source: true
+*** True Line Result
+ m_to_s = m.to_s
+** Processing line: ~ self.instance_variable_set("@#{m_to_s}".to_sym, value) if m_to_s.strip.length > 0~
- Inside source: true
*** True Line Result
- self.instance_variable_set("@#{m.to_s}".to_sym, value)
+ self.instance_variable_set("@#{m_to_s}".to_sym, value) if m_to_s.strip.length > 0
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -165990,6 +172454,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
*app_metadata_retrieval_steps,
+** Processing line: ~ :determine_devcert,~
+- Inside source: true
+*** True Line Result
+ :determine_devcert,
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -166102,6 +172570,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
*app_metadata_retrieval_steps,
+** Processing line: ~ :determine_prodcert,~
+- Inside source: true
+*** True Line Result
+ :determine_prodcert,
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -166878,6 +173350,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
appname=
+** Processing line: ~ # devcert is the certificate to use for development/deploying to your local device~
+- Inside source: true
+*** True Line Result
+ # devcert is the certificate to use for development/deploying to your local device
+** Processing line: ~ devcert=~
+- Inside source: true
+*** True Line Result
+ devcert=
+** Processing line: ~ # prodcert is the certificate to use for distribution to the app store~
+- Inside source: true
+*** True Line Result
+ # prodcert is the certificate to use for distribution to the app store
+** Processing line: ~ prodcert=~
+- Inside source: true
+*** True Line Result
+ prodcert=
** Processing line: ~ S~
- Inside source: true
*** True Line Result
@@ -167018,10 +173506,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
"* mygame/metadata/ios_metadata.txt needs to be filled out.",
-** Processing line: ~ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, and appid.",~
+** Processing line: ~ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, appid, devcert, and prodcert.",~
- Inside source: true
*** True Line Result
- "You need to update metadata/ios_metadata.txt with a valid teamid, appname, and appid.",
+ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, appid, devcert, and prodcert.",
** Processing line: ~ "Instructions for where the values should come from are within metadata/ios_metadata.txt."~
- Inside source: true
*** True Line Result
@@ -167178,10 +173666,58 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
raise_ios_metadata_required if @app_id.strip.length == 0
-** Processing line: ~ log_info "App Identifier is set to : #{@app_id}"~
+** Processing line: ~ log_info "App Identifier is set to: #{@app_id}"~
+- Inside source: true
+*** True Line Result
+ log_info "App Identifier is set to: #{@app_id}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def determine_devcert~
+- Inside source: true
+*** True Line Result
+ def determine_devcert
+** Processing line: ~ @certificate_name = ios_metadata.devcert~
+- Inside source: true
+*** True Line Result
+ @certificate_name = ios_metadata.devcert
+** Processing line: ~ raise_ios_metadata_required if @certificate_name.strip.length == 0~
+- Inside source: true
+*** True Line Result
+ raise_ios_metadata_required if @certificate_name.strip.length == 0
+** Processing line: ~ log_info "Dev Certificate is set to: #{@certificate_name}"~
+- Inside source: true
+*** True Line Result
+ log_info "Dev Certificate is set to: #{@certificate_name}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def determine_prodcert~
+- Inside source: true
+*** True Line Result
+ def determine_prodcert
+** Processing line: ~ @certificate_name = ios_metadata.prodcert~
+- Inside source: true
+*** True Line Result
+ @certificate_name = ios_metadata.prodcert
+** Processing line: ~ raise_ios_metadata_required if @certificate_name.strip.length == 0~
+- Inside source: true
+*** True Line Result
+ raise_ios_metadata_required if @certificate_name.strip.length == 0
+** Processing line: ~ log_info "Production (Distribution) Certificate is set to: #{@certificate_name}"~
- Inside source: true
*** True Line Result
- log_info "App Identifier is set to : #{@app_id}"
+ log_info "Production (Distribution) Certificate is set to: #{@certificate_name}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -167266,30 +173802,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def stage_app~
-- Inside source: true
-*** True Line Result
- def stage_app
-** Processing line: ~ log_info "Staging."~
-- Inside source: true
-*** True Line Result
- log_info "Staging."
-** Processing line: ~ sh "mkdir -p #{tmp_directory}"~
-- Inside source: true
-*** True Line Result
- sh "mkdir -p #{tmp_directory}"
-** Processing line: ~ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""~
-- Inside source: true
-*** True Line Result
- sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ def set_app_id id~
- Inside source: true
*** True Line Result
@@ -167410,118 +173922,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if !cli_app_exist?(security_cli_app)~
-- Inside source: true
-*** True Line Result
- if !cli_app_exist?(security_cli_app)
-** Processing line: ~ raise WizardException.new(~
-- Inside source: true
-*** True Line Result
- raise WizardException.new(
-** Processing line: ~ "* It doesn't look like you have #{security_cli_app}.",~
-- Inside source: true
-*** True Line Result
- "* It doesn't look like you have #{security_cli_app}.",
-** Processing line: ~ "** 1. Open Disk Utility and run First Aid.",~
-- Inside source: true
-*** True Line Result
- "** 1. Open Disk Utility and run First Aid.",
-** Processing line: ~ { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },~
-- Inside source: true
-*** True Line Result
- { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },
-** Processing line: ~ )~
-- Inside source: true
-*** True Line Result
- )
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if valid_certs.length == 0~
-- Inside source: true
-*** True Line Result
- if valid_certs.length == 0
-** Processing line: ~ raise WizardException.new(~
-- Inside source: true
-*** True Line Result
- raise WizardException.new(
-** Processing line: ~ "* It doesn't look like you have any valid certs installed.",~
-- Inside source: true
-*** True Line Result
- "* It doesn't look like you have any valid certs installed.",
-** Processing line: ~ "** 1. Open Xcode.",~
-- Inside source: true
-*** True Line Result
- "** 1. Open Xcode.",
-** Processing line: ~ "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",~
-- Inside source: true
-*** True Line Result
- "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",
-** Processing line: ~ { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },~
-- Inside source: true
-*** True Line Result
- { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },
-** Processing line: ~ "** 3. After loggin in, select Manage Certificates...",~
-- Inside source: true
-*** True Line Result
- "** 3. After loggin in, select Manage Certificates...",
-** Processing line: ~ { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },~
-- Inside source: true
-*** True Line Result
- { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },
-** Processing line: ~ "** 4. Add a certificate for Apple Development.",~
-- Inside source: true
-*** True Line Result
- "** 4. Add a certificate for Apple Development.",
-** Processing line: ~ { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },~
-- Inside source: true
-*** True Line Result
- { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },
-** Processing line: ~ )~
-- Inside source: true
-*** True Line Result
- )
-** Processing line: ~ raise "You do not have any Apple development certs on this computer."~
-- Inside source: true
-*** True Line Result
- raise "You do not have any Apple development certs on this computer."
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ if @production_build~
- Inside source: true
*** True Line Result
if @production_build
-** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]~
+** Processing line: ~ @certificate_name = ios_metadata[:prodcert]~
- Inside source: true
*** True Line Result
- @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]
+ @certificate_name = ios_metadata[:prodcert]
** Processing line: ~ else~
- Inside source: true
*** True Line Result
else
-** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]~
+** Processing line: ~ @certificate_name = ios_metadata[:devcert]~
- Inside source: true
*** True Line Result
- @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]
+ @certificate_name = ios_metadata[:devcert]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
-** Processing line: ~ log_info "I will be using Certificate: '#{@certificate_name}'."~
+** Processing line: ~~
- Inside source: true
*** True Line Result
- log_info "I will be using Certificate: '#{@certificate_name}'."
+
+** Processing line: ~ log_info "I will be using certificate: '#{@certificate_name}'."~
+- Inside source: true
+*** True Line Result
+ log_info "I will be using certificate: '#{@certificate_name}'."
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -167578,78 +174006,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def valid_certs~
-- Inside source: true
-*** True Line Result
- def valid_certs
-** Processing line: ~ certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|~
-- Inside source: true
-*** True Line Result
- certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|
-** Processing line: ~ if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))~
-- Inside source: true
-*** True Line Result
- if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))
-** Processing line: ~ l.strip~
-- Inside source: true
-*** True Line Result
- l.strip
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ nil~
-- Inside source: true
-*** True Line Result
- nil
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end.reject_nil.map do |l|~
-- Inside source: true
-*** True Line Result
- end.reject_nil.map do |l|
-** Processing line: ~ number, id, name = l.split(' ', 3)~
-- Inside source: true
-*** True Line Result
- number, id, name = l.split(' ', 3)
-** Processing line: ~ name = name.gsub("\"", "") if name~
-- Inside source: true
-*** True Line Result
- name = name.gsub("\"", "") if name
-** Processing line: ~ {~
-- Inside source: true
-*** True Line Result
- {
-** Processing line: ~ number: 1,~
-- Inside source: true
-*** True Line Result
- number: 1,
-** Processing line: ~ id: id,~
-- Inside source: true
-*** True Line Result
- id: id,
-** Processing line: ~ name: name~
-- Inside source: true
-*** True Line Result
- name: name
-** Processing line: ~ }~
-- Inside source: true
-*** True Line Result
- }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ def connected_devices~
- Inside source: true
*** True Line Result
@@ -169766,6 +176122,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def stage_app
+** Processing line: ~ log_info "Staging."~
+- Inside source: true
+*** True Line Result
+ log_info "Staging."
+** Processing line: ~ sh "mkdir -p #{tmp_directory}"~
+- Inside source: true
+*** True Line Result
+ sh "mkdir -p #{tmp_directory}"
+** Processing line: ~ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""~
+- Inside source: true
+*** True Line Result
+ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""
** Processing line: ~ sh %Q[cp -r "#{root_folder}/app/" "#{app_path}/app/"]~
- Inside source: true
*** True Line Result
@@ -177134,86 +183502,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def >= other~
-- Inside source: true
-*** True Line Result
- def >= other
-** Processing line: ~ return false if !other~
-- Inside source: true
-*** True Line Result
- return false if !other
-** Processing line: ~ return gte other~
-- Inside source: true
-*** True Line Result
- return gte other
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def > other~
-- Inside source: true
-*** True Line Result
- def > other
-** Processing line: ~ return false if !other~
-- Inside source: true
-*** True Line Result
- return false if !other
-** Processing line: ~ return gt other~
-- Inside source: true
-*** True Line Result
- return gt other
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def <= other~
-- Inside source: true
-*** True Line Result
- def <= other
-** Processing line: ~ return false if !other~
-- Inside source: true
-*** True Line Result
- return false if !other
-** Processing line: ~ return lte other~
-- Inside source: true
-*** True Line Result
- return lte other
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def < other~
-- Inside source: true
-*** True Line Result
- def < other
-** Processing line: ~ return false if !other~
-- Inside source: true
-*** True Line Result
- return false if !other
-** Processing line: ~ return gt other~
-- Inside source: true
-*** True Line Result
- return gt other
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ # @gtk~
- Inside source: true
*** True Line Result
@@ -177554,118 +183842,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def - other~
-- Inside source: true
-*** True Line Result
- def - other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self - other~
-- Inside source: true
-*** True Line Result
- self - other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :-, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def + other~
-- Inside source: true
-*** True Line Result
- def + other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self + other~
-- Inside source: true
-*** True Line Result
- self + other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :+, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def * other~
-- Inside source: true
-*** True Line Result
- def * other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self * other~
-- Inside source: true
-*** True Line Result
- self * other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :*, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def / other~
-- Inside source: true
-*** True Line Result
- def / other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self / other~
-- Inside source: true
-*** True Line Result
- self / other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :/, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ def serialize~
- Inside source: true
*** True Line Result
@@ -177882,118 +184058,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def + other~
-- Inside source: true
-*** True Line Result
- def + other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self + other~
-- Inside source: true
-*** True Line Result
- self + other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :+, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def * other~
-- Inside source: true
-*** True Line Result
- def * other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self * other~
-- Inside source: true
-*** True Line Result
- self * other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :*, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def / other~
-- Inside source: true
-*** True Line Result
- def / other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self / other~
-- Inside source: true
-*** True Line Result
- self / other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :/, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def - other~
-- Inside source: true
-*** True Line Result
- def - other
-** Processing line: ~ return self unless other~
-- Inside source: true
-*** True Line Result
- return self unless other
-** Processing line: ~ self - other~
-- Inside source: true
-*** True Line Result
- self - other
-** Processing line: ~ rescue Exception => e~
-- Inside source: true
-*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~
-- Inside source: true
-*** True Line Result
- __raise_arithmetic_exception__ other, :-, e
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ # Returns `-1` if the number is less than `0`. `+1` if the number~
- Inside source: true
*** True Line Result
@@ -178214,26 +184278,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def - other~
+** Processing line: ~ def serialize~
- Inside source: true
*** True Line Result
- def - other
-** Processing line: ~ return self unless other~
+ def serialize
+** Processing line: ~ self~
- Inside source: true
*** True Line Result
- return self unless other
-** Processing line: ~ super~
+ self
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- super
-** Processing line: ~ rescue Exception => e~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~
+
+** Processing line: ~ # @gtk~
+- Inside source: true
+*** True Line Result
+ # @gtk
+** Processing line: ~ def sign~
- Inside source: true
*** True Line Result
- __raise_arithmetic_exception__ other, :-, e
+ def sign
+** Processing line: ~ return -1 if self < 0~
+- Inside source: true
+*** True Line Result
+ return -1 if self < 0
+** Processing line: ~ return 1 if self > 0~
+- Inside source: true
+*** True Line Result
+ return 1 if self > 0
+** Processing line: ~ return 0~
+- Inside source: true
+*** True Line Result
+ return 0
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -178242,26 +184322,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def + other~
+** Processing line: ~ def replace_infinity scalar~
- Inside source: true
*** True Line Result
- def + other
-** Processing line: ~ return self unless other~
+ def replace_infinity scalar
+** Processing line: ~ return self if !scalar~
- Inside source: true
*** True Line Result
- return self unless other
-** Processing line: ~ super~
+ return self if !scalar
+** Processing line: ~ return self unless self.infinite?~
- Inside source: true
*** True Line Result
- super
-** Processing line: ~ rescue Exception => e~
+ return self unless self.infinite?
+** Processing line: ~ return -scalar if self < 0~
- Inside source: true
*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~
+ return -scalar if self < 0
+** Processing line: ~ return scalar if self > 0~
- Inside source: true
*** True Line Result
- __raise_arithmetic_exception__ other, :+, e
+ return scalar if self > 0
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -178270,54 +184350,78 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def * other~
+** Processing line: ~ def to_sf~
- Inside source: true
*** True Line Result
- def * other
-** Processing line: ~ return self unless other~
+ def to_sf
+** Processing line: ~ "%.2f" % self~
- Inside source: true
*** True Line Result
- return self unless other
-** Processing line: ~ super~
+ "%.2f" % self
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- super
-** Processing line: ~ rescue Exception => e~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~
+
+** Processing line: ~ def ifloor int~
+- Inside source: true
+*** True Line Result
+ def ifloor int
+** Processing line: ~ (self.idiv int.to_i) * int.to_i~
- Inside source: true
*** True Line Result
- __raise_arithmetic_exception__ other, :*, e
+ (self.idiv int.to_i) * int.to_i
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def / other~
+** Processing line: ~ class Integer~
- Inside source: true
*** True Line Result
- def / other
-** Processing line: ~ return self unless other~
+ class Integer
+** Processing line: ~ alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__~
- Inside source: true
*** True Line Result
- return self unless other
-** Processing line: ~ super~
+ alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__
+** Processing line: ~ alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__~
- Inside source: true
*** True Line Result
- super
-** Processing line: ~ rescue Exception => e~
+ alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__
+** Processing line: ~ alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__~
- Inside source: true
*** True Line Result
- rescue Exception => e
-** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
+ alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__
+** Processing line: ~ alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__~
+- Inside source: true
+*** True Line Result
+ alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__
+** Processing line: ~ alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__~
+- Inside source: true
+*** True Line Result
+ alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def round *args~
+- Inside source: true
+*** True Line Result
+ def round *args
+** Processing line: ~ __original_round__~
- Inside source: true
*** True Line Result
- __raise_arithmetic_exception__ other, :/, e
+ __original_round__
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -178326,42 +184430,138 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def serialize~
+** Processing line: ~ def nan?~
- Inside source: true
*** True Line Result
- def serialize
-** Processing line: ~ self~
+ def nan?
+** Processing line: ~ false~
- Inside source: true
*** True Line Result
- self
+ false
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def center other~
+- Inside source: true
+*** True Line Result
+ def center other
+** Processing line: ~ (self - other).abs.fdiv(2)~
+- Inside source: true
+*** True Line Result
+ (self - other).abs.fdiv(2)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
+*** True Line Result
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~*** recording.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** recording.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src ruby
+** Processing line: ~ # ./dragon/recording.rb~
+- Inside source: true
+*** True Line Result
+ # ./dragon/recording.rb
+** Processing line: ~ # coding: utf-8~
+- Inside source: true
+*** True Line Result
+ # coding: utf-8
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
+- Inside source: true
+*** True Line Result
+ # Copyright 2019 DragonRuby LLC
+** Processing line: ~ # MIT License~
+- Inside source: true
+*** True Line Result
+ # MIT License
+** Processing line: ~ # recording.rb has been released under MIT (*only this file*).~
+- Inside source: true
+*** True Line Result
+ # recording.rb has been released under MIT (*only this file*).
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ module GTK~
+- Inside source: true
+*** True Line Result
+ module GTK
+** Processing line: ~ # FIXME: Gross~
+- Inside source: true
+*** True Line Result
+ # FIXME: Gross
** Processing line: ~ # @gtk~
- Inside source: true
*** True Line Result
# @gtk
-** Processing line: ~ def sign~
+** Processing line: ~ class Replay~
- Inside source: true
*** True Line Result
- def sign
-** Processing line: ~ return -1 if self < 0~
+ class Replay
+** Processing line: ~ # @gtk~
- Inside source: true
*** True Line Result
- return -1 if self < 0
-** Processing line: ~ return 1 if self > 0~
+ # @gtk
+** Processing line: ~ def self.start file_name = nil~
- Inside source: true
*** True Line Result
- return 1 if self > 0
-** Processing line: ~ return 0~
+ def self.start file_name = nil
+** Processing line: ~ $recording.start_replay file_name~
- Inside source: true
*** True Line Result
- return 0
+ $recording.start_replay file_name
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # @gtk~
+- Inside source: true
+*** True Line Result
+ # @gtk
+** Processing line: ~ def self.stop~
+- Inside source: true
+*** True Line Result
+ def self.stop
+** Processing line: ~ $recording.stop_replay~
+- Inside source: true
+*** True Line Result
+ $recording.stop_replay
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -178370,138 +184570,958 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def replace_infinity scalar~
+** Processing line: ~ # @gtk~
- Inside source: true
*** True Line Result
- def replace_infinity scalar
-** Processing line: ~ return self if !scalar~
+ # @gtk
+** Processing line: ~ class Recording~
- Inside source: true
*** True Line Result
- return self if !scalar
-** Processing line: ~ return self unless self.infinite?~
+ class Recording
+** Processing line: ~ def initialize runtime~
- Inside source: true
*** True Line Result
- return self unless self.infinite?
-** Processing line: ~ return -scalar if self < 0~
+ def initialize runtime
+** Processing line: ~ @runtime = runtime~
- Inside source: true
*** True Line Result
- return -scalar if self < 0
-** Processing line: ~ return scalar if self > 0~
+ @runtime = runtime
+** Processing line: ~ @tick_count = 0~
- Inside source: true
*** True Line Result
- return scalar if self > 0
-** Processing line: ~ end~
+ @tick_count = 0
+** Processing line: ~ @global_input_order = 1~
- Inside source: true
*** True Line Result
- end
+ @global_input_order = 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def to_sf~
+** Processing line: ~ def tick~
- Inside source: true
*** True Line Result
- def to_sf
-** Processing line: ~ "%.2f" % self~
+ def tick
+** Processing line: ~ @tick_count += 1~
- Inside source: true
*** True Line Result
- "%.2f" % self
-** Processing line: ~ end~
+ @tick_count += 1
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- end
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def ifloor int~
+** Processing line: ~ def start_recording seed_number = nil~
- Inside source: true
*** True Line Result
- def ifloor int
-** Processing line: ~ (self.idiv int.to_i) * int.to_i~
+ def start_recording seed_number = nil
+** Processing line: ~ if !seed_number~
- Inside source: true
*** True Line Result
- (self.idiv int.to_i) * int.to_i
-** Processing line: ~ end~
+ if !seed_number
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~ end~
+ log <<-S
+** Processing line: ~ * ERROR:~
- Inside source: true
*** True Line Result
- end
+ * ERROR:
+** Processing line: ~ To start recording, you must provide an integer value to~
+- Inside source: true
+*** True Line Result
+ To start recording, you must provide an integer value to
+** Processing line: ~ seed random number generation.~
+- Inside source: true
+*** True Line Result
+ seed random number generation.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ $console.set_command "$recording.start SEED_NUMBER"~
+- Inside source: true
+*** True Line Result
+ $console.set_command "$recording.start SEED_NUMBER"
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ class Integer~
+** Processing line: ~ if @is_recording~
- Inside source: true
*** True Line Result
- class Integer
-** Processing line: ~ alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__~
+ if @is_recording
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- alias_method :__original_round__, :round unless Integer.instance_methods.include? :__original_round__
-** Processing line: ~ alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__~
+ log <<-S
+** Processing line: ~ * ERROR:~
- Inside source: true
*** True Line Result
- alias_method :__original_add__, :+ unless Integer.instance_methods.include? :__original_add__
-** Processing line: ~ alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__~
+ * ERROR:
+** Processing line: ~ You are already recording, first cancel (or stop) the current recording.~
- Inside source: true
*** True Line Result
- alias_method :__original_subtract__, :- unless Integer.instance_methods.include? :__original_subtract__
-** Processing line: ~ alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__~
+ You are already recording, first cancel (or stop) the current recording.
+** Processing line: ~ S~
- Inside source: true
*** True Line Result
- alias_method :__original_multiply__, :* unless Integer.instance_methods.include? :__original_multiply__
-** Processing line: ~ alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__~
+ S
+** Processing line: ~ $console.set_command "$recording.cancel"~
- Inside source: true
*** True Line Result
- alias_method :__original_divide__, :- unless Integer.instance_methods.include? :__original_divide__
+ $console.set_command "$recording.cancel"
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def round *args~
+** Processing line: ~ if @is_replaying~
- Inside source: true
*** True Line Result
- def round *args
-** Processing line: ~ __original_round__~
+ if @is_replaying
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- __original_round__
-** Processing line: ~ end~
+ log <<-S
+** Processing line: ~ * ERROR:~
- Inside source: true
*** True Line Result
- end
+ * ERROR:
+** Processing line: ~ You are currently replaying a recording, first stop the replay.~
+- Inside source: true
+*** True Line Result
+ You are currently replaying a recording, first stop the replay.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def nan?~
+** Processing line: ~ log_info <<-S~
- Inside source: true
*** True Line Result
- def nan?
-** Processing line: ~ false~
+ log_info <<-S
+** Processing line: ~ Recording has begun with RNG seed value set to #{seed_number}.~
- Inside source: true
*** True Line Result
- false
-** Processing line: ~ end~
+ Recording has begun with RNG seed value set to #{seed_number}.
+** Processing line: ~ To stop recording use stop_recording(filename).~
- Inside source: true
*** True Line Result
- end
+ To stop recording use stop_recording(filename).
+** Processing line: ~ The recording will stop without saving a file if a filename is nil.~
+- Inside source: true
+*** True Line Result
+ The recording will stop without saving a file if a filename is nil.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def center other~
+** Processing line: ~ $console.set_command "$recording.stop 'replay.txt'"~
- Inside source: true
*** True Line Result
- def center other
-** Processing line: ~ (self - other).abs.fdiv(2)~
+ $console.set_command "$recording.stop 'replay.txt'"
+** Processing line: ~ @runtime.__reset__~
- Inside source: true
*** True Line Result
- (self - other).abs.fdiv(2)
+ @runtime.__reset__
+** Processing line: ~ @seed_number = seed_number~
+- Inside source: true
+*** True Line Result
+ @seed_number = seed_number
+** Processing line: ~ @runtime.set_rng seed_number~
+- Inside source: true
+*** True Line Result
+ @runtime.set_rng seed_number
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ @tick_count = 0~
+- Inside source: true
+*** True Line Result
+ @tick_count = 0
+** Processing line: ~ @global_input_order = 1~
+- Inside source: true
+*** True Line Result
+ @global_input_order = 1
+** Processing line: ~ @is_recording = true~
+- Inside source: true
+*** True Line Result
+ @is_recording = true
+** Processing line: ~ @input_history = []~
+- Inside source: true
+*** True Line Result
+ @input_history = []
+** Processing line: ~ @runtime.notify! "Recording started. When completed, open the console to save it using $recording.stop FILE_NAME (or cancel).", 300~
+- Inside source: true
+*** True Line Result
+ @runtime.notify! "Recording started. When completed, open the console to save it using $recording.stop FILE_NAME (or cancel).", 300
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # @gtk~
+- Inside source: true
+*** True Line Result
+ # @gtk
+** Processing line: ~ def start seed_number = nil~
+- Inside source: true
+*** True Line Result
+ def start seed_number = nil
+** Processing line: ~ start_recording seed_number~
+- Inside source: true
+*** True Line Result
+ start_recording seed_number
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def is_replaying?~
+- Inside source: true
+*** True Line Result
+ def is_replaying?
+** Processing line: ~ @is_replaying~
+- Inside source: true
+*** True Line Result
+ @is_replaying
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def is_recording?~
+- Inside source: true
+*** True Line Result
+ def is_recording?
+** Processing line: ~ @is_recording~
+- Inside source: true
+*** True Line Result
+ @is_recording
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # @gtk~
+- Inside source: true
+*** True Line Result
+ # @gtk
+** Processing line: ~ def stop file_name = nil~
+- Inside source: true
+*** True Line Result
+ def stop file_name = nil
+** Processing line: ~ stop_recording file_name~
+- Inside source: true
+*** True Line Result
+ stop_recording file_name
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # @gtk~
+- Inside source: true
+*** True Line Result
+ # @gtk
+** Processing line: ~ def cancel~
+- Inside source: true
+*** True Line Result
+ def cancel
+** Processing line: ~ stop_recording_core~
+- Inside source: true
+*** True Line Result
+ stop_recording_core
+** Processing line: ~ @runtime.notify! "Recording cancelled."~
+- Inside source: true
+*** True Line Result
+ @runtime.notify! "Recording cancelled."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def stop_recording file_name = nil~
+- Inside source: true
+*** True Line Result
+ def stop_recording file_name = nil
+** Processing line: ~ if !file_name~
+- Inside source: true
+*** True Line Result
+ if !file_name
+** Processing line: ~ log <<-S~
+- Inside source: true
+*** True Line Result
+ log <<-S
+** Processing line: ~ * ERROR:~
+- Inside source: true
+*** True Line Result
+ * ERROR:
+** Processing line: ~ To please specify a file name when calling:~
+- Inside source: true
+*** True Line Result
+ To please specify a file name when calling:
+** Processing line: ~ $recording.stop FILE_NAME~
+- Inside source: true
+*** True Line Result
+ $recording.stop FILE_NAME
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ If you do NOT want to save the recording, call:~
+- Inside source: true
+*** True Line Result
+ If you do NOT want to save the recording, call:
+** Processing line: ~ $recording.cancel~
+- Inside source: true
+*** True Line Result
+ $recording.cancel
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ $console.set_command "$recording.stop 'replay.txt'"~
+- Inside source: true
+*** True Line Result
+ $console.set_command "$recording.stop 'replay.txt'"
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if !@is_recording~
+- Inside source: true
+*** True Line Result
+ if !@is_recording
+** Processing line: ~ log_info "You are not currently recording. Use start_recording(seed_number) to start recording."~
+- Inside source: true
+*** True Line Result
+ log_info "You are not currently recording. Use start_recording(seed_number) to start recording."
+** Processing line: ~ $console.set_command "$recording.start"~
+- Inside source: true
+*** True Line Result
+ $console.set_command "$recording.start"
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if file_name~
+- Inside source: true
+*** True Line Result
+ if file_name
+** Processing line: ~ text = "replay_version 2.0\n"~
+- Inside source: true
+*** True Line Result
+ text = "replay_version 2.0\n"
+** Processing line: ~ text << "stopped_at #{@tick_count}\n"~
+- Inside source: true
+*** True Line Result
+ text << "stopped_at #{@tick_count}\n"
+** Processing line: ~ text << "seed #{@seed_number}\n"~
+- Inside source: true
+*** True Line Result
+ text << "seed #{@seed_number}\n"
+** Processing line: ~ text << "recorded_at #{Time.now.to_s}\n"~
+- Inside source: true
+*** True Line Result
+ text << "recorded_at #{Time.now.to_s}\n"
+** Processing line: ~ @input_history.each do |items|~
+- Inside source: true
+*** True Line Result
+ @input_history.each do |items|
+** Processing line: ~ text << "#{items}\n"~
+- Inside source: true
+*** True Line Result
+ text << "#{items}\n"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ @runtime.write_file file_name, text~
+- Inside source: true
+*** True Line Result
+ @runtime.write_file file_name, text
+** Processing line: ~ @runtime.write_file 'last_replay.txt', text~
+- Inside source: true
+*** True Line Result
+ @runtime.write_file 'last_replay.txt', text
+** Processing line: ~ log_info "The recording has been saved successfully at #{file_name}. You can use start_replay(\"#{file_name}\") to replay the recording."~
+- Inside source: true
+*** True Line Result
+ log_info "The recording has been saved successfully at #{file_name}. You can use start_replay(\"#{file_name}\") to replay the recording."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $console.set_command "$replay.start '#{file_name}'"~
+- Inside source: true
+*** True Line Result
+ $console.set_command "$replay.start '#{file_name}'"
+** Processing line: ~ stop_recording_core~
+- Inside source: true
+*** True Line Result
+ stop_recording_core
+** Processing line: ~ @runtime.notify! "Recording saved to #{file_name}. To replay it: $replay.start \"#{file_name}\"."~
+- Inside source: true
+*** True Line Result
+ @runtime.notify! "Recording saved to #{file_name}. To replay it: $replay.start \"#{file_name}\"."
+** Processing line: ~ log_info "You can run the replay later on startup using: ./dragonruby mygame --replay #{@replay_file_name}"~
+- Inside source: true
+*** True Line Result
+ log_info "You can run the replay later on startup using: ./dragonruby mygame --replay #{@replay_file_name}"
+** Processing line: ~ nil~
+- Inside source: true
+*** True Line Result
+ nil
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def stop_recording_core~
+- Inside source: true
+*** True Line Result
+ def stop_recording_core
+** Processing line: ~ @is_recording = false~
+- Inside source: true
+*** True Line Result
+ @is_recording = false
+** Processing line: ~ @input_history = nil~
+- Inside source: true
+*** True Line Result
+ @input_history = nil
+** Processing line: ~ @last_history = nil~
+- Inside source: true
+*** True Line Result
+ @last_history = nil
+** Processing line: ~ @runtime.__reset__~
+- Inside source: true
+*** True Line Result
+ @runtime.__reset__
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def start_replay file_name = nil~
+- Inside source: true
+*** True Line Result
+ def start_replay file_name = nil
+** Processing line: ~ if !file_name~
+- Inside source: true
+*** True Line Result
+ if !file_name
+** Processing line: ~ log <<-S~
+- Inside source: true
+*** True Line Result
+ log <<-S
+** Processing line: ~ * ERROR:~
+- Inside source: true
+*** True Line Result
+ * ERROR:
+** Processing line: ~ Please provide a file name to $recording.start.~
+- Inside source: true
+*** True Line Result
+ Please provide a file name to $recording.start.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ $console.set_command "$replay.start 'replay.txt'"~
+- Inside source: true
+*** True Line Result
+ $console.set_command "$replay.start 'replay.txt'"
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ text = @runtime.read_file file_name~
+- Inside source: true
+*** True Line Result
+ text = @runtime.read_file file_name
+** Processing line: ~ return false unless text~
+- Inside source: true
+*** True Line Result
+ return false unless text
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if text.each_line.first.strip != "replay_version 2.0"~
+- Inside source: true
+*** True Line Result
+ if text.each_line.first.strip != "replay_version 2.0"
+** Processing line: ~ raise "The replay file #{file_name} is not compatible with this version of DragonRuby Game Toolkit. Please recreate the replay (sorry)."~
+- Inside source: true
+*** True Line Result
+ raise "The replay file #{file_name} is not compatible with this version of DragonRuby Game Toolkit. Please recreate the replay (sorry)."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ @replay_file_name = file_name~
+- Inside source: true
+*** True Line Result
+ @replay_file_name = file_name
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $replay_data = { input_history: { } }~
+- Inside source: true
+*** True Line Result
+ $replay_data = { input_history: { } }
+** Processing line: ~ text.each_line do |l|~
+- Inside source: true
+*** True Line Result
+ text.each_line do |l|
+** Processing line: ~ if l.strip.length == 0~
+- Inside source: true
+*** True Line Result
+ if l.strip.length == 0
+** Processing line: ~ next~
+- Inside source: true
+*** True Line Result
+ next
+** Processing line: ~ elsif l.start_with? 'replay_version'~
+- Inside source: true
+*** True Line Result
+ elsif l.start_with? 'replay_version'
+** Processing line: ~ next~
+- Inside source: true
+*** True Line Result
+ next
+** Processing line: ~ elsif l.start_with? 'seed'~
+- Inside source: true
+*** True Line Result
+ elsif l.start_with? 'seed'
+** Processing line: ~ $replay_data[:seed] = l.split(' ').last.to_i~
+- Inside source: true
+*** True Line Result
+ $replay_data[:seed] = l.split(' ').last.to_i
+** Processing line: ~ elsif l.start_with? 'stopped_at'~
+- Inside source: true
+*** True Line Result
+ elsif l.start_with? 'stopped_at'
+** Processing line: ~ $replay_data[:stopped_at] = l.split(' ').last.to_i~
+- Inside source: true
+*** True Line Result
+ $replay_data[:stopped_at] = l.split(' ').last.to_i
+** Processing line: ~ elsif l.start_with? 'recorded_at'~
+- Inside source: true
+*** True Line Result
+ elsif l.start_with? 'recorded_at'
+** Processing line: ~ $replay_data[:recorded_at] = l.split(' ')[1..-1].join(' ')~
+- Inside source: true
+*** True Line Result
+ $replay_data[:recorded_at] = l.split(' ')[1..-1].join(' ')
+** Processing line: ~ elsif l.start_with? '['~
+- Inside source: true
+*** True Line Result
+ elsif l.start_with? '['
+** Processing line: ~ name, value_1, value_2, value_count, id, tick_count = l.strip.gsub('[', '').gsub(']', '').split(',')~
+- Inside source: true
+*** True Line Result
+ name, value_1, value_2, value_count, id, tick_count = l.strip.gsub('[', '').gsub(']', '').split(',')
+** Processing line: ~ $replay_data[:input_history][tick_count.to_i] ||= []~
+- Inside source: true
+*** True Line Result
+ $replay_data[:input_history][tick_count.to_i] ||= []
+** Processing line: ~ $replay_data[:input_history][tick_count.to_i] << {~
+- Inside source: true
+*** True Line Result
+ $replay_data[:input_history][tick_count.to_i] << {
+** Processing line: ~ id: id.to_i,~
+- Inside source: true
+*** True Line Result
+ id: id.to_i,
+** Processing line: ~ name: name.gsub(':', '').to_sym,~
+- Inside source: true
+*** True Line Result
+ name: name.gsub(':', '').to_sym,
+** Processing line: ~ value_1: value_1.to_f,~
+- Inside source: true
+*** True Line Result
+ value_1: value_1.to_f,
+** Processing line: ~ value_2: value_2.to_f,~
+- Inside source: true
+*** True Line Result
+ value_2: value_2.to_f,
+** Processing line: ~ value_count: value_count.to_i~
+- Inside source: true
+*** True Line Result
+ value_count: value_count.to_i
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ raise "Replay data seems corrupt. I don't know how to parse #{l}."~
+- Inside source: true
+*** True Line Result
+ raise "Replay data seems corrupt. I don't know how to parse #{l}."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $replay_data[:input_history].keys.each do |key|~
+- Inside source: true
+*** True Line Result
+ $replay_data[:input_history].keys.each do |key|
+** Processing line: ~ $replay_data[:input_history][key] = $replay_data[:input_history][key].sort_by {|input| input[:id]}~
+- Inside source: true
+*** True Line Result
+ $replay_data[:input_history][key] = $replay_data[:input_history][key].sort_by {|input| input[:id]}
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ @runtime.__reset__~
+- Inside source: true
+*** True Line Result
+ @runtime.__reset__
+** Processing line: ~ @runtime.set_rng $replay_data[:seed]~
+- Inside source: true
+*** True Line Result
+ @runtime.set_rng $replay_data[:seed]
+** Processing line: ~ @tick_count = 0~
+- Inside source: true
+*** True Line Result
+ @tick_count = 0
+** Processing line: ~ @is_replaying = true~
+- Inside source: true
+*** True Line Result
+ @is_replaying = true
+** Processing line: ~ log_info "Replay has been started."~
+- Inside source: true
+*** True Line Result
+ log_info "Replay has been started."
+** Processing line: ~ @runtime.notify! "Replay started [#{@replay_file_name}]."~
+- Inside source: true
+*** True Line Result
+ @runtime.notify! "Replay started [#{@replay_file_name}]."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def stop_replay notification_message = "Replay has been stopped."~
+- Inside source: true
+*** True Line Result
+ def stop_replay notification_message = "Replay has been stopped."
+** Processing line: ~ if !is_replaying?~
+- Inside source: true
+*** True Line Result
+ if !is_replaying?
+** Processing line: ~ log <<-S~
+- Inside source: true
+*** True Line Result
+ log <<-S
+** Processing line: ~ * ERROR:~
+- Inside source: true
+*** True Line Result
+ * ERROR:
+** Processing line: ~ No replay is currently running. Call $replay.start FILE_NAME to start a replay.~
+- Inside source: true
+*** True Line Result
+ No replay is currently running. Call $replay.start FILE_NAME to start a replay.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $console.set_command "$replay.start 'replay.txt'"~
+- Inside source: true
+*** True Line Result
+ $console.set_command "$replay.start 'replay.txt'"
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ log_info notification_message~
+- Inside source: true
+*** True Line Result
+ log_info notification_message
+** Processing line: ~ @is_replaying = false~
+- Inside source: true
+*** True Line Result
+ @is_replaying = false
+** Processing line: ~ $replay_data = nil~
+- Inside source: true
+*** True Line Result
+ $replay_data = nil
+** Processing line: ~ @tick_count = 0~
+- Inside source: true
+*** True Line Result
+ @tick_count = 0
+** Processing line: ~ @global_input_order = 1~
+- Inside source: true
+*** True Line Result
+ @global_input_order = 1
+** Processing line: ~ $console.set_command_silent "$replay.start '#{@replay_file_name}'"~
+- Inside source: true
+*** True Line Result
+ $console.set_command_silent "$replay.start '#{@replay_file_name}'"
+** Processing line: ~ @runtime.__reset__~
+- Inside source: true
+*** True Line Result
+ @runtime.__reset__
+** Processing line: ~ @runtime.notify! notification_message~
+- Inside source: true
+*** True Line Result
+ @runtime.notify! notification_message
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def record_input_history name, value_1, value_2, value_count, clear_cache = false~
+- Inside source: true
+*** True Line Result
+ def record_input_history name, value_1, value_2, value_count, clear_cache = false
+** Processing line: ~ return if @is_replaying~
+- Inside source: true
+*** True Line Result
+ return if @is_replaying
+** Processing line: ~ return unless @is_recording~
+- Inside source: true
+*** True Line Result
+ return unless @is_recording
+** Processing line: ~ @input_history << [name, value_1, value_2, value_count, @global_input_order, @tick_count]~
+- Inside source: true
+*** True Line Result
+ @input_history << [name, value_1, value_2, value_count, @global_input_order, @tick_count]
+** Processing line: ~ @global_input_order += 1~
+- Inside source: true
+*** True Line Result
+ @global_input_order += 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def stage_replay_values~
+- Inside source: true
+*** True Line Result
+ def stage_replay_values
+** Processing line: ~ return unless @is_replaying~
+- Inside source: true
+*** True Line Result
+ return unless @is_replaying
+** Processing line: ~ return unless $replay_data~
+- Inside source: true
+*** True Line Result
+ return unless $replay_data
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if $replay_data[:stopped_at] <= @tick_count~
+- Inside source: true
+*** True Line Result
+ if $replay_data[:stopped_at] <= @tick_count
+** Processing line: ~ stop_replay "Replay completed [#{@replay_file_name}]. To rerun, bring up the Console and press enter."~
+- Inside source: true
+*** True Line Result
+ stop_replay "Replay completed [#{@replay_file_name}]. To rerun, bring up the Console and press enter."
+** Processing line: ~ return~
+- Inside source: true
+*** True Line Result
+ return
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ inputs_this_tick = $replay_data[:input_history][@tick_count]~
+- Inside source: true
+*** True Line Result
+ inputs_this_tick = $replay_data[:input_history][@tick_count]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if @tick_count.zmod? 60~
+- Inside source: true
+*** True Line Result
+ if @tick_count.zmod? 60
+** Processing line: ~ log_info "Replay ends in #{($replay_data[:stopped_at] - @tick_count).idiv 60} second(s)."~
+- Inside source: true
+*** True Line Result
+ log_info "Replay ends in #{($replay_data[:stopped_at] - @tick_count).idiv 60} second(s)."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ return unless inputs_this_tick~
+- Inside source: true
+*** True Line Result
+ return unless inputs_this_tick
+** Processing line: ~ inputs_this_tick.each do |v|~
+- Inside source: true
+*** True Line Result
+ inputs_this_tick.each do |v|
+** Processing line: ~ args = []~
+- Inside source: true
+*** True Line Result
+ args = []
+** Processing line: ~ args << v[:value_1] if v[:value_count] >= 1~
+- Inside source: true
+*** True Line Result
+ args << v[:value_1] if v[:value_count] >= 1
+** Processing line: ~ args << v[:value_2] if v[:value_count] >= 2~
+- Inside source: true
+*** True Line Result
+ args << v[:value_2] if v[:value_count] >= 2
+** Processing line: ~ args << :replay~
+- Inside source: true
+*** True Line Result
+ args << :replay
+** Processing line: ~ $gtk.send v[:name], *args~
+- Inside source: true
+*** True Line Result
+ $gtk.send v[:name], *args
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -180018,10 +187038,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
S
-** Processing line: ~ time_start = Time.now~
-- Inside source: true
-*** True Line Result
- time_start = Time.now
** Processing line: ~ idx = 0~
- Inside source: true
*** True Line Result
@@ -180030,6 +187046,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
r = nil
+** Processing line: ~ time_start = Time.now~
+- Inside source: true
+*** True Line Result
+ time_start = Time.now
** Processing line: ~ while idx < iterations~
- Inside source: true
*** True Line Result
@@ -180046,10 +187066,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ result = (Time.now - time_start).round 3~
- Inside source: true
*** True Line Result
@@ -180550,10 +187566,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ if !$gtk.production~
+** Processing line: ~ if !self.production~
- Inside source: true
*** True Line Result
- if !$gtk.production
+ if !self.production
** Processing line: ~ fn.each_send pass.debug, self, :draw_primitive~
- Inside source: true
*** True Line Result
@@ -180618,6 +187634,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
+- Inside source: true
+*** True Line Result
+ s = s.as_hash if s.is_a? OpenEntity
** Processing line: ~ @ffi_draw.draw_solid_2 s.x, s.y, s.w, s.h,~
- Inside source: true
*** True Line Result
@@ -180670,6 +187690,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
+- Inside source: true
+*** True Line Result
+ s = s.as_hash if s.is_a? OpenEntity
** Processing line: ~ @ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,~
- Inside source: true
*** True Line Result
@@ -180746,6 +187770,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
+- Inside source: true
+*** True Line Result
+ s = s.as_hash if s.is_a? OpenEntity
** Processing line: ~ @ffi_draw.draw_screenshot (s.path || '').to_s,~
- Inside source: true
*** True Line Result
@@ -180818,6 +187846,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ l = l.as_hash if l.is_a? OpenEntity~
+- Inside source: true
+*** True Line Result
+ l = l.as_hash if l.is_a? OpenEntity
** Processing line: ~ @ffi_draw.draw_label_3 l.x, l.y,~
- Inside source: true
*** True Line Result
@@ -180886,6 +187918,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ l = l.as_hash if l.is_a? OpenEntity~
+- Inside source: true
+*** True Line Result
+ l = l.as_hash if l.is_a? OpenEntity
** Processing line: ~ if l.x2~
- Inside source: true
*** True Line Result
@@ -180986,6 +188022,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
+- Inside source: true
+*** True Line Result
+ s = s.as_hash if s.is_a? OpenEntity
** Processing line: ~ @ffi_draw.draw_border_2 s.x, s.y, s.w, s.h,~
- Inside source: true
*** True Line Result
@@ -181258,10 +188298,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@last_framerate = current_framerate
-** Processing line: ~ if [email protected]?~
+** Processing line: ~ if [email protected]? && [email protected]_replaying?~
- Inside source: true
*** True Line Result
** Processing line: ~ log framerate_warning_message~
- Inside source: true
*** True Line Result
@@ -184914,18 +191954,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if (os.first.is_a? Numeric)
-** Processing line: ~ sld! *os~
+** Processing line: ~ sld!(*os)~
- Inside source: true
*** True Line Result
- sld! *os
+ sld!(*os)
** Processing line: ~ else~
- Inside source: true
*** True Line Result
else
-** Processing line: ~ os.each { |o| sld! *o }~
+** Processing line: ~ os.each { |o| sld!(*o) }~
- Inside source: true
*** True Line Result
- os.each { |o| sld! *o }
+ os.each { |o| sld!(*o) }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -185114,6 +192154,106 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ =begin~
+- Inside source: true
+*** True Line Result
+ =begin
+** Processing line: ~ wht = [255] * 3~
+- Inside source: true
+*** True Line Result
+ wht = [255] * 3
+** Processing line: ~ red = [255, 0, 0]~
+- Inside source: true
+*** True Line Result
+ red = [255, 0, 0]
+** Processing line: ~ blu = [0, 130, 255]~
+- Inside source: true
+*** True Line Result
+ blu = [0, 130, 255]
+** Processing line: ~ purp = [150, 80, 255]~
+- Inside source: true
+*** True Line Result
+ purp = [150, 80, 255]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ TICK {~
+- Inside source: true
+*** True Line Result
+ TICK {
+** Processing line: ~ bg! 0~
+- Inside source: true
+*** True Line Result
+ bg! 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ slds << [0, 0, 3, 3, 0, 255, 0, 255]~
+- Inside source: true
+*** True Line Result
+ slds << [0, 0, 3, 3, 0, 255, 0, 255]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ sld! 10, 10~
+- Inside source: true
+*** True Line Result
+ sld! 10, 10
+** Processing line: ~ sld! 20, 20, 3, 2~
+- Inside source: true
+*** True Line Result
+ sld! 20, 20, 3, 2
+** Processing line: ~ sld! 30, 30, 2, 2, red~
+- Inside source: true
+*** True Line Result
+ sld! 30, 30, 2, 2, red
+** Processing line: ~ sld! 35, 35, blu~
+- Inside source: true
+*** True Line Result
+ sld! 35, 35, blu
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ slds! 40, 40~
+- Inside source: true
+*** True Line Result
+ slds! 40, 40
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ slds! [50, 50],~
+- Inside source: true
+*** True Line Result
+ slds! [50, 50],
+** Processing line: ~ [60, 60, purp],~
+- Inside source: true
+*** True Line Result
+ [60, 60, purp],
+** Processing line: ~ [70, 70, 10, 10, wht],~
+- Inside source: true
+*** True Line Result
+ [70, 70, 10, 10, wht],
+** Processing line: ~ [80, 80, 4, 4, 255, 0, 255]~
+- Inside source: true
+*** True Line Result
+ [80, 80, 4, 4, 255, 0, 255]
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ =end~
+- Inside source: true
+*** True Line Result
+ =end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~#+end_src~
- Line was identified as the end of a code block.
*** True Line Result
@@ -192219,6 +199359,28 @@ Follows is a source code listing for all files that have been open sourced. This
- Formatting line: ~Hides the mouse cursor.~
- Line's tilde count is: 0
- Line contains link marker: false
+** Processing line: ~*** ~.set_cursor path, dx, dy~~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~~.set_cursor path, dx, dy~~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~~.set_cursor path, dx, dy~~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~Sets the system cursor to a sprite ~path~ with an offset of ~dx~ and ~dy~.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Sets the system cursor to a sprite ~path~ with an offset of ~dx~ and ~dy~.~
+- Line's tilde count is: 6
+- Line contains link marker: false
+- CODE detected.
** Processing line: ~*** ~.cursor_shown?~~
- H3 detected.
- Determining if line is a header.
@@ -192397,6 +199559,50 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~* DOCS: ~GTK::Runtime#benchmark~~
+- H1 detected.
+- Determining if line is a header.
+- Line contains ~* ~... gsub-ing empty string
+- Formatting line: ~DOCS: ~GTK::Runtime#benchmark~~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~You can use this function to compare the relative performance of methods.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~You can use this function to compare the relative performance of methods.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ def tick args~
+** Processing line: ~ # press r to run benchmark~
+** Processing line: ~ if args.inputs.keyboard.key_down.r~
+** Processing line: ~ args.gtk.console.show~
+** Processing line: ~ args.gtk.benchmark iterations: 1000, # number of iterations~
+** Processing line: ~ # label for experiment~
+** Processing line: ~ using_numeric_map: -> () {~
+** Processing line: ~ # experiment body~
+** Processing line: ~ v = 100.map do |i|~
+** Processing line: ~ i * 100~
+** Processing line: ~ end~
+** Processing line: ~ },~
+** Processing line: ~ # label for experiment~
+** Processing line: ~ using_numeric_times: -> () {~
+** Processing line: ~ # experiment body~
+** Processing line: ~ v = []~
+** Processing line: ~ 100.times do |i|~
+** Processing line: ~ v << i * 100~
+** Processing line: ~ end~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~* DOCS: ~Array~~
- H1 detected.
- Determining if line is a header.
@@ -196288,7 +203494,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # Use args.inputs.mouse.click.created_at~
** Processing line: ~~
** Processing line: ~ # To see how many frames its been since the click occurred~
-** Processing line: ~ # Use args.inputs.mouse.click.creat_at_elapsed~
+** Processing line: ~ # Use args.inputs.mouse.click.created_at_elapsed~
** Processing line: ~~
** Processing line: ~ # Saving the click in args.state can be quite useful~
** Processing line: ~~
@@ -199139,17 +206345,17 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def calc_player_dx~
-** Processing line: ~ player.y += player.dy~
-** Processing line: ~ player.dy += state.gravity~
-** Processing line: ~ player.dy += player.dy * state.drag ** 2 * -1~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def calc_player_dy~
** Processing line: ~ player.dx = player.dx.clamp(-5, 5)~
** Processing line: ~ player.dx *= 0.9~
** Processing line: ~ player.x += player.dx~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def calc_player_dy~
+** Processing line: ~ player.y += player.dy~
+** Processing line: ~ player.dy += state.gravity~
+** Processing line: ~ player.dy += player.dy * state.drag ** 2 * -1~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def reset_player~
** Processing line: ~ player.x = 100~
** Processing line: ~ player.y = 720~
@@ -199308,8 +206514,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ input~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # Sets default values~
-** Processing line: ~ def defaults~
+** Processing line: ~ def init_game~
** Processing line: ~ s.platforms ||= [ # initializes platforms collection with two platforms using hashes~
** Processing line: ~ new_platform(x: 0, y: 0, w: 700, h: 32, dx: 1, speed: 0, rect: nil),~
** Processing line: ~ new_platform(x: 0, y: 300, w: 700, h: 32, dx: 1, speed: 0, rect: nil), # 300 pixels higher~
@@ -199332,6 +206537,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ s.camera ||= { y: -100 } # shows view on screen (as the player moves upward, the camera does too)~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ # Sets default values~
+** Processing line: ~ def defaults~
+** Processing line: ~ init_game~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ # Outputs objects onto the screen~
** Processing line: ~ def render~
** Processing line: ~ outputs.solids << s.platforms.map do |p| # outputs platforms onto screen~
@@ -199419,7 +206629,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ rect: nil)~
** Processing line: ~ end~
** Processing line: ~ else~
+** Processing line: ~ # game over~
** Processing line: ~ s.as_hash.clear # otherwise clear the hash (no new platform is necessary)~
+** Processing line: ~ init_game~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -202435,12 +209647,23 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # Starts the game with player x's turn and creates an array (to_a) for space combinations.~
** Processing line: ~ # Calls methods necessary for the game to run properly.~
** Processing line: ~ def tick~
-** Processing line: ~ state.current_turn ||= :x~
-** Processing line: ~ state.space_combinations = [-1, 0, 1].product([-1, 0, 1]).to_a~
+** Processing line: ~ init_new_game~
** Processing line: ~ render_board~
** Processing line: ~ input_board~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def init_new_game~
+** Processing line: ~ state.current_turn ||= :x~
+** Processing line: ~ state.space_combinations ||= [-1, 0, 1].product([-1, 0, 1]).to_a~
+** Processing line: ~~
+** Processing line: ~ state.spaces ||= {}~
+** Processing line: ~~
+** Processing line: ~ state.space_combinations.each do |x, y|~
+** Processing line: ~ state.spaces[x] ||= {}~
+** Processing line: ~ state.spaces[x][y] ||= state.new_entity(:space)~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ # Uses borders to create grid squares for the game's board. Also outputs the game pieces using labels.~
** Processing line: ~ def render_board~
** Processing line: ~ square_size = 80~
@@ -202516,6 +209739,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def input_restart_game~
** Processing line: ~ return unless state.game_over~
** Processing line: ~ gtk.reset~
+** Processing line: ~ init_new_game~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Checks if x or o won the game.~
@@ -202847,7 +210071,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def calc_kill_zombie~
** Processing line: ~~
** Processing line: ~ # Find all zombies that intersect with the player. They are considered killed.~
-** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite.intersect_rect? state.player_sprite }~
+** Processing line: ~ killed_this_frame = state.zombies.find_all { |z| z.sprite && (z.sprite.intersect_rect? state.player_sprite) }~
** Processing line: ~ state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection~
** Processing line: ~ state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies~
** Processing line: ~~
@@ -203811,6 +211035,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def playtime_str t~
+** Processing line: ~ return "" unless t~
** Processing line: ~ minutes = (t / 60.0).floor~
** Processing line: ~ seconds = t - (minutes * 60.0).to_f~
** Processing line: ~ return minutes.to_s + ':' + seconds.floor.to_s + ((seconds - seconds.floor).to_s + "000")[1..3]~
@@ -203923,7 +211148,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ results.playtime_slider_rect = progress_bar(args: args,~
** Processing line: ~ row: 2.5,~
** Processing line: ~ col: 2,~
-** Processing line: ~ percentage: audio_entry.playtime / audio_entry.length_,~
+** Processing line: ~ percentage: (audio_entry.playtime || 1) / (audio_entry.length_ || 1),~
** Processing line: ~ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")~
** Processing line: ~~
** Processing line: ~ results.primitives << results.playtime_slider_rect.primitives~
@@ -204060,7 +211285,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.state.sound_files ||= [~
** Processing line: ~ { name: :tada, path: "sounds/tada.wav" },~
** Processing line: ~ { name: :splash, path: "sounds/splash.wav" },~
-** Processing line: ~ { name: :drum, path: "sounds/drum.wav" },~
+** Processing line: ~ { name: :drum, path: "sounds/drum.mp3" },~
** Processing line: ~ { name: :spring, path: "sounds/spring.wav" },~
** Processing line: ~ { name: :music, path: "sounds/music.ogg" }~
** Processing line: ~ ]~
@@ -204140,36 +211365,6 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~*** Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt~
-- H3 detected.
-- Determining if line is a header.
-- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt~
-- Line's tilde count is: 0
-- Line contains link marker: false
-- Determining if line is a header.
-- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Advanced Audio - Audio Mixer - Metadata - ios_metadata.txt~
-- Line's tilde count is: 0
-- Line contains link marker: false
-** Processing line: ~~
-** Processing line: ~#+begin_src ruby~
-- PRE start detected.
-** Processing line: ~ # ./samples/07_advanced_audio/01_audio_mixer/metadata/ios_metadata.txt~
-** Processing line: ~ # ios_metadata.txt is used by the Pro version of DragonRuby Game Toolkit to create iOS apps.~
-** Processing line: ~ # Information about the Pro version can be found at: http://dragonruby.org/toolkit/game#purchase~
-** Processing line: ~~
-** Processing line: ~ # teamid needs to be set to your assigned Team Id which can be found at https://developer.apple.com/account/#/membership/~
-** Processing line: ~ teamid=~
-** Processing line: ~ # appid needs to be set to your application identifier which can be found at https://developer.apple.com/account/resources/identifiers/list~
-** Processing line: ~ appid=~
-** Processing line: ~ # appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.~
-** Processing line: ~ appname=~
-** Processing line: ~~
-** Processing line: ~#+end_src~
-- PRE end detected.
-** Processing line: ~~
-** Processing line: ~~
** Processing line: ~*** Advanced Audio - Sound Synthesis - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -204784,6 +211979,168 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Advanced Rendering - Labels With Wrapped Text - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Rendering - Labels With Wrapped Text - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Rendering - Labels With Wrapped Text - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/07_advanced_rendering/00_labels_with_wrapped_text/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ # defaults~
+** Processing line: ~ args.state.scroll_location ||= 0~
+** Processing line: ~ args.state.textbox.messages ||= []~
+** Processing line: ~ args.state.textbox.scroll ||= 0~
+** Processing line: ~~
+** Processing line: ~ # render~
+** Processing line: ~ args.outputs.background_color = [0, 0, 0, 255]~
+** Processing line: ~ render_messages args~
+** Processing line: ~ render_instructions args~
+** Processing line: ~~
+** Processing line: ~ # inputs~
+** Processing line: ~ if args.inputs.keyboard.key_down.one~
+** Processing line: ~ queue_message args, "Hello there neighbour! my name is mark, how is your day today?"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.keyboard.key_down.two~
+** Processing line: ~ queue_message args, "I'm doing great sir, actually I'm having a picnic today"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.keyboard.key_down.three~
+** Processing line: ~ queue_message args, "Well that sounds wonderful!"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.keyboard.key_down.home~
+** Processing line: ~ args.state.scroll_location = 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.keyboard.key_down.delete~
+** Processing line: ~ clear_message_queue args~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_message args, msg~
+** Processing line: ~ args.state.textbox.messages.concat msg.wrapped_lines 50~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def clear_message_queue args~
+** Processing line: ~ args.state.textbox.messages = nil~
+** Processing line: ~ args.state.textbox.scroll = 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_messages args~
+** Processing line: ~ args.outputs[:textbox].w = 400~
+** Processing line: ~ args.outputs[:textbox].h = 720~
+** Processing line: ~~
+** Processing line: ~ args.outputs.primitives << args.state.textbox.messages.each_with_index.map do |s, idx|~
+** Processing line: ~ {~
+** Processing line: ~ x: 0,~
+** Processing line: ~ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,~
+** Processing line: ~ text: s,~
+** Processing line: ~ size_enum: -3,~
+** Processing line: ~ alignment_enum: 0,~
+** Processing line: ~ r: 255, g:255, b: 255, a: 255~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs[:textbox].labels << args.state.textbox.messages.each_with_index.map do |s, idx|~
+** Processing line: ~ {~
+** Processing line: ~ x: 0,~
+** Processing line: ~ y: 20 * (args.state.textbox.messages.size - idx) + args.state.textbox.scroll * 20,~
+** Processing line: ~ text: s,~
+** Processing line: ~ size_enum: -3,~
+** Processing line: ~ alignment_enum: 0,~
+** Processing line: ~ r: 255, g:255, b: 255, a: 255~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs[:textbox].borders << [0, 0, args.outputs[:textbox].w, 720]~
+** Processing line: ~~
+** Processing line: ~ args.state.textbox.scroll += args.inputs.mouse.wheel.y unless args.inputs.mouse.wheel.nil?~
+** Processing line: ~~
+** Processing line: ~ if args.state.scroll_location > 0~
+** Processing line: ~ args.state.textbox.scroll = 0~
+** Processing line: ~ args.state.scroll_location = 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.sprites << [900, 0, args.outputs[:textbox].w, 720, :textbox]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_instructions args~
+** Processing line: ~ args.outputs.labels << [30,~
+** Processing line: ~ 30.from_top,~
+** Processing line: ~ "press 1, 2, 3 to display messages, MOUSE WHEEL to scroll, HOME to go to top, BACKSPACE to delete.",~
+** Processing line: ~ 0, 255, 255]~
+** Processing line: ~~
+** Processing line: ~ args.outputs.primitives << [0, 55.from_top, 1280, 30, :pixel, 0, 255, 0, 0, 0].sprite~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~*** Advanced Rendering - Rotating Label - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Rendering - Rotating Label - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Rendering - Rotating Label - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/07_advanced_rendering/00_rotating_label/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ # set the render target width and height to match the label~
+** Processing line: ~ args.outputs[:scene].w = 220~
+** Processing line: ~ args.outputs[:scene].h = 30~
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~ # make the background transparent~
+** Processing line: ~ args.outputs[:scene].background_color = [255, 255, 255, 0]~
+** Processing line: ~~
+** Processing line: ~ # set the blendmode of the label to 0 (no blending)~
+** Processing line: ~ # center it inside of the scene~
+** Processing line: ~ # set the vertical_alignment_enum to 1 (center)~
+** Processing line: ~ args.outputs[:scene].labels << { x: 0,~
+** Processing line: ~ y: 15,~
+** Processing line: ~ text: "label in render target",~
+** Processing line: ~ blendmode_enum: 0,~
+** Processing line: ~ vertical_alignment_enum: 1 }~
+** Processing line: ~~
+** Processing line: ~ # add a border to the render target~
+** Processing line: ~ args.outputs[:scene].borders << { x: 0,~
+** Processing line: ~ y: 0,~
+** Processing line: ~ w: args.outputs[:scene].w,~
+** Processing line: ~ h: args.outputs[:scene].h }~
+** Processing line: ~~
+** Processing line: ~ # add the rendertarget to the main output as a sprite~
+** Processing line: ~ args.outputs.sprites << { x: 640 - args.outputs[:scene].w.half,~
+** Processing line: ~ y: 360 - args.outputs[:scene].h.half,~
+** Processing line: ~ w: args.outputs[:scene].w,~
+** Processing line: ~ h: args.outputs[:scene].h,~
+** Processing line: ~ angle: args.state.tick_count,~
+** Processing line: ~ path: :scene }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Advanced Rendering - Simple Render Targets - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -206155,6 +213512,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ default_camera(0,0,1280,720)~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~~
** Processing line: ~ def new_room~
** Processing line: ~ default_floor_tile(0,0,1024,1024,'sprites/rooms/camera_room.png')~
** Processing line: ~ end~
@@ -207410,6 +214768,109 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Performance - Sprites As Struct - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Performance - Sprites As Struct - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Performance - Sprites As Struct - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/09_performance/03_sprites_as_struct/app/main.rb~
+** Processing line: ~ # create a Struct variant that allows for named parameters on construction.~
+** Processing line: ~ class NamedStruct < Struct~
+** Processing line: ~ def initialize **opts~
+** Processing line: ~ super(*members.map { |k| opts[k] })~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # create a Star NamedStruct~
+** Processing line: ~ Star = NamedStruct.new(:x, :y, :w, :h, :path, :s,~
+** Processing line: ~ :angle, :angle_anchor_x, :angle_anchor_y,~
+** Processing line: ~ :r, :g, :b, :a,~
+** Processing line: ~ :tile_x, :tile_y,~
+** Processing line: ~ :tile_w, :tile_h,~
+** Processing line: ~ :source_x, :source_y,~
+** Processing line: ~ :source_w, :source_h,~
+** Processing line: ~ :flip_horizontally, :flip_vertically,~
+** Processing line: ~ :blendmode_enum)~
+** Processing line: ~~
+** Processing line: ~ # Sprites represented as Structs. They require a little bit more code than Hashes,~
+** Processing line: ~ # but are the a little faster to render too.~
+** Processing line: ~ def random_x args~
+** Processing line: ~ (args.grid.w.randomize :ratio) * -1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def random_y args~
+** Processing line: ~ (args.grid.h.randomize :ratio) * -1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def random_speed~
+** Processing line: ~ 1 + (4.randomize :ratio)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def new_star args~
+** Processing line: ~ Star.new x: (random_x args),~
+** Processing line: ~ y: (random_y args),~
+** Processing line: ~ w: 4, h: 4,~
+** Processing line: ~ path: 'sprites/tiny-star.png',~
+** Processing line: ~ s: random_speed~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def move_star args, star~
+** Processing line: ~ star.x += star[:s]~
+** Processing line: ~ star.y += star[:s]~
+** Processing line: ~ if star.x > args.grid.w || star.y > args.grid.h~
+** Processing line: ~ star.x = (random_x args)~
+** Processing line: ~ star.y = (random_y args)~
+** Processing line: ~ star[:s] = random_speed~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~ args.state.star_count ||= 0~
+** Processing line: ~~
+** Processing line: ~ # sets console command when sample app initially opens~
+** Processing line: ~ if Kernel.global_tick_count == 0~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts "========================================================="~
+** Processing line: ~ puts "* INFO: Sprites, Structs"~
+** Processing line: ~ puts "* INFO: Please specify the number of sprites to render."~
+** Processing line: ~ args.gtk.console.set_command "reset_with count: 100"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # init~
+** Processing line: ~ if args.state.tick_count == 0~
+** Processing line: ~ args.state.stars = args.state.star_count.map { |i| new_star args }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # update~
+** Processing line: ~ args.state.stars.each { |s| move_star args, s }~
+** Processing line: ~~
+** Processing line: ~ # render~
+** Processing line: ~ args.outputs.sprites << args.state.stars~
+** Processing line: ~ args.outputs.background_color = [0, 0, 0]~
+** Processing line: ~ args.outputs.primitives << args.gtk.current_framerate_primitives~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # resets game, and assigns star count given by user~
+** Processing line: ~ def reset_with count: count~
+** Processing line: ~ $gtk.reset~
+** Processing line: ~ $gtk.args.state.star_count = count~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Performance - Sprites As Strict Entities - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -207425,7 +214886,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/09_performance/03_sprites_as_strict_entities/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/04_sprites_as_strict_entities/app/main.rb~
** Processing line: ~ # Sprites represented as StrictEntities using the queue ~args.outputs.sprites~~
** Processing line: ~ # yields apis access similar to Entities, but all properties that can be set on the~
** Processing line: ~ # entity must be predefined with a default value. Strict entities do not support the~
@@ -207518,7 +214979,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/09_performance/04_sprites_as_classes/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/05_sprites_as_classes/app/main.rb~
** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.sprites~.~
** Processing line: ~ # gives you full control of property declaration and method invocation.~
** Processing line: ~ # They are more performant than OpenEntities and StrictEntities, but more code upfront.~
@@ -207594,7 +215055,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/09_performance/05_static_sprites_as_classes/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes/app/main.rb~
** Processing line: ~ # Sprites represented as Classes using the queue ~args.outputs.static_sprites~.~
** Processing line: ~ # bypasses the queue behavior of ~args.outputs.sprites~. All instances are held~
** Processing line: ~ # by reference. You get better performance, but you are mutating state of held objects~
@@ -207671,7 +215132,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/09_performance/06_static_sprites_as_classes_with_custom_drawing/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/07_static_sprites_as_classes_with_custom_drawing/app/main.rb~
** Processing line: ~ # Sprites represented as Classes, with a draw_override method, and using the queue ~args.outputs.static_sprites~.~
** Processing line: ~ # is the fastest approach. This is comparable to what other game engines set as the default behavior.~
** Processing line: ~ # There are tradeoffs for all this speed if the creation of a full blown class, and bypassing~
@@ -207780,7 +215241,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/09_performance/07_collision_limits/app/main.rb~
+** Processing line: ~ # ./samples/09_performance/08_collision_limits/app/main.rb~
** Processing line: ~ =begin~
** Processing line: ~~
** Processing line: ~ Reminders:~
@@ -207841,6 +215302,46 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Advanced Debugging - Logging - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Debugging - Logging - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Debugging - Logging - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/10_advanced_debugging/00_logging/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ args.outputs.background_color = [255, 255, 255, 0]~
+** Processing line: ~ if args.state.tick_count == 0~
+** Processing line: ~ args.gtk.log_spam "log level spam"~
+** Processing line: ~ args.gtk.log_debug "log level debug"~
+** Processing line: ~ args.gtk.log_info "log level info"~
+** Processing line: ~ args.gtk.log_warn "log level warn"~
+** Processing line: ~ args.gtk.log_error "log level error"~
+** Processing line: ~ args.gtk.log_unfiltered "log level unfiltered"~
+** Processing line: ~ puts "This is a puts call"~
+** Processing line: ~ args.gtk.console.show~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.state.tick_count == 60~
+** Processing line: ~ puts "This is a puts call on tick 60"~
+** Processing line: ~ elsif args.state.tick_count == 120~
+** Processing line: ~ puts "This is a puts call on tick 120"~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Advanced Debugging - Trace Debugging - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -209222,11 +216723,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~#+begin_src ruby~
- PRE start detected.
** Processing line: ~ # ./samples/11_http/01_retrieve_images/app/main.rb~
+** Processing line: ~ $gtk.register_cvar 'app.warn_seconds', "seconds to wait before starting", :uint, 11~
+** Processing line: ~~
** Processing line: ~ def tick args~
** Processing line: ~ args.outputs.background_color = [0, 0, 0]~
** Processing line: ~~
** Processing line: ~ # Show a warning at the start.~
-** Processing line: ~ args.state.warning_debounce ||= 11 * 60~
+** Processing line: ~ args.state.warning_debounce ||= args.cvars['app.warn_seconds'].value * 60~
** Processing line: ~ if args.state.warning_debounce > 0~
** Processing line: ~ args.state.warning_debounce -= 1~
** Processing line: ~ args.outputs.labels << [640, 600, "This app shows random images from the Internet.", 10, 1, 255, 255, 255]~
@@ -209280,24 +216783,25 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~*** Http - Web Server - main.rb~
+** Processing line: ~*** Http - In Game Web Server Http Get - main.rb~
- H3 detected.
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Http - Web Server - main.rb~
+- Formatting line: ~Http - In Game Web Server Http Get - main.rb~
- Line's tilde count is: 0
- Line contains link marker: false
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Http - Web Server - main.rb~
+- Formatting line: ~Http - In Game Web Server Http Get - main.rb~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/11_http/02_web_server/app/main.rb~
+** Processing line: ~ # ./samples/11_http/02_in_game_web_server_http_get/app/main.rb~
** Processing line: ~ def tick args~
** Processing line: ~ args.state.port ||= 3000~
+** Processing line: ~ args.state.reqnum ||= 0~
** Processing line: ~ # by default the embedded webserver runs on port 9001 (the port number is over 9000) and is disabled in a production build~
** Processing line: ~ # to enable the http server in a production build, you need to manually start~
** Processing line: ~ # the server up:~
@@ -209328,6 +216832,99 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Http - In Game Web Server Http Post - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Http - In Game Web Server Http Post - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Http - In Game Web Server Http Post - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/11_http/03_in_game_web_server_http_post/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ # defaults~
+** Processing line: ~ args.state.post_button = args.layout.rect(row: 0, col: 0, w: 5, h: 1).merge(text: "execute http_post")~
+** Processing line: ~ args.state.post_body_button = args.layout.rect(row: 1, col: 0, w: 5, h: 1).merge(text: "execute http_post_body")~
+** Processing line: ~ args.state.request_to_s ||= ""~
+** Processing line: ~ args.state.request_body ||= ""~
+** Processing line: ~~
+** Processing line: ~ # render~
+** Processing line: ~ args.state.post_button.yield_self do |b|~
+** Processing line: ~ args.outputs.borders << b~
+** Processing line: ~ args.outputs.labels << b.merge(text: b.text,~
+** Processing line: ~ y: b.y + 30,~
+** Processing line: ~ x: b.x + 10)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.state.post_body_button.yield_self do |b|~
+** Processing line: ~ args.outputs.borders << b~
+** Processing line: ~ args.outputs.labels << b.merge(text: b.text,~
+** Processing line: ~ y: b.y + 30,~
+** Processing line: ~ x: b.x + 10)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ draw_label args, 0, 6, "Request:", args.state.request_to_s~
+** Processing line: ~ draw_label args, 0, 14, "Request Body Unaltered:", args.state.request_body~
+** Processing line: ~~
+** Processing line: ~ # input~
+** Processing line: ~ if args.inputs.mouse.click~
+** Processing line: ~ # ============= HTTP_POST =============~
+** Processing line: ~ if (args.inputs.mouse.inside_rect? args.state.post_button)~
+** Processing line: ~ # ========= DATA TO SEND ===========~
+** Processing line: ~ form_fields = { "userId" => "#{Time.now.to_i}" }~
+** Processing line: ~ # ==================================~
+** Processing line: ~~
+** Processing line: ~ args.gtk.http_post "http://localhost:9001/testing",~
+** Processing line: ~ form_fields,~
+** Processing line: ~ ["Content-Type: application/x-www-form-urlencoded"]~
+** Processing line: ~~
+** Processing line: ~ args.gtk.notify! "http_post"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # ============= HTTP_POST_BODY =============~
+** Processing line: ~ if (args.inputs.mouse.inside_rect? args.state.post_body_button)~
+** Processing line: ~ # =========== DATA TO SEND ==============~
+** Processing line: ~ json = "{ \"userId\": \"#{Time.now.to_i}\"}"~
+** Processing line: ~ # ==================================~
+** Processing line: ~~
+** Processing line: ~ args.gtk.http_post_body "http://localhost:9001/testing",~
+** Processing line: ~ json,~
+** Processing line: ~ ["Content-Type: application/json", "Content-Length: #{json.length}"]~
+** Processing line: ~~
+** Processing line: ~ args.gtk.notify! "http_post_body"~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # calc~
+** Processing line: ~ args.inputs.http_requests.each do |r|~
+** Processing line: ~ puts "#{r}"~
+** Processing line: ~ if r.uri == "/testing"~
+** Processing line: ~ puts r~
+** Processing line: ~ args.state.request_to_s = "#{r}"~
+** Processing line: ~ args.state.request_body = r.raw_body~
+** Processing line: ~ r.respond 200, "ok"~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def draw_label args, row, col, header, text~
+** Processing line: ~ label_pos = args.layout.rect(row: row, col: col, w: 0, h: 0)~
+** Processing line: ~ args.outputs.labels << "#{header}\n\n#{text}".wrapped_lines(80).map_with_index do |l, i|~
+** Processing line: ~ { x: label_pos.x, y: label_pos.y - (i * 15), text: l, size_enum: -2 }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** C Extensions - Basics - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -211360,7 +218957,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~
-** Processing line: ~ $breadcrumbs ||= Breadcrumbs.new(args)~
+** Processing line: ~ $breadcrumbs ||= Breadcrumbs.new~
** Processing line: ~ $breadcrumbs.args = args~
** Processing line: ~ $breadcrumbs.tick~
** Processing line: ~ end~
@@ -212026,7 +219623,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~
-** Processing line: ~ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new(args)~
+** Processing line: ~ $early_exit_breadth_first_search ||= EarlyExitBreadthFirstSearch.new~
** Processing line: ~ $early_exit_breadth_first_search.args = args~
** Processing line: ~ $early_exit_breadth_first_search.tick~
** Processing line: ~ end~
@@ -212891,7 +220488,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Every tick, new args are passed, and the Dijkstra tick method is called~
-** Processing line: ~ $movement_costs ||= Movement_Costs.new(args)~
+** Processing line: ~ $movement_costs ||= Movement_Costs.new~
** Processing line: ~ $movement_costs.args = args~
** Processing line: ~ $movement_costs.tick~
** Processing line: ~ end~
@@ -213892,7 +221489,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~
-** Processing line: ~ $heuristic_with_walls ||= Heuristic_With_Walls.new(args)~
+** Processing line: ~ $heuristic_with_walls ||= Heuristic_With_Walls.new~
** Processing line: ~ $heuristic_with_walls.args = args~
** Processing line: ~ $heuristic_with_walls.tick~
** Processing line: ~ end~
@@ -214926,7 +222523,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~
-** Processing line: ~ $heuristic ||= Heuristic.new(args)~
+** Processing line: ~ $heuristic ||= Heuristic.new~
** Processing line: ~ $heuristic.args = args~
** Processing line: ~ $heuristic.tick~
** Processing line: ~ end~
@@ -215976,7 +223573,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Every tick, new args are passed, and the Breadth First Search tick is called~
-** Processing line: ~ $a_star_algorithm ||= A_Star_Algorithm.new(args)~
+** Processing line: ~ $a_star_algorithm ||= A_Star_Algorithm.new~
** Processing line: ~ $a_star_algorithm.args = args~
** Processing line: ~ $a_star_algorithm.tick~
** Processing line: ~ end~
@@ -216574,6 +224171,378 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** 3d - Yaw Pitch Roll - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~3d - Yaw Pitch Roll - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~3d - Yaw Pitch Roll - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/99_genre_3d/03_yaw_pitch_roll/app/main.rb~
+** Processing line: ~ class Game~
+** Processing line: ~ attr_gtk~
+** Processing line: ~~
+** Processing line: ~ def tick~
+** Processing line: ~ defaults~
+** Processing line: ~ render~
+** Processing line: ~ input~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def matrix_mul m, v~
+** Processing line: ~ (hmap x: ((m.x.x * v.x) + (m.x.y * v.y) + (m.x.z * v.z) + (m.x.w * v.w)),~
+** Processing line: ~ y: ((m.y.x * v.x) + (m.y.y * v.y) + (m.y.z * v.z) + (m.y.w * v.w)),~
+** Processing line: ~ z: ((m.z.x * v.x) + (m.z.y * v.y) + (m.z.z * v.z) + (m.z.w * v.w)),~
+** Processing line: ~ w: ((m.w.x * v.x) + (m.w.y * v.y) + (m.w.z * v.z) + (m.w.w * v.w)))~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_ship~
+** Processing line: ~ [~
+** Processing line: ~ # engine back~
+** Processing line: ~ { x: -1, y: -1, z: 1, w: 0 },~
+** Processing line: ~ { x: -1, y: 1, z: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, y: 1, z: 1, w: 0 },~
+** Processing line: ~ { x: 1, y: 1, z: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, y: 1, z: 1, w: 0 },~
+** Processing line: ~ { x: 1, y: -1, z: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, y: -1, z: 1, w: 0 },~
+** Processing line: ~ { x: -1, y: -1, z: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # engine front~
+** Processing line: ~ { x: -1, y: -1, z: -1, w: 0 },~
+** Processing line: ~ { x: -1, y: 1, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, y: 1, z: -1, w: 0 },~
+** Processing line: ~ { x: 1, y: 1, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, y: 1, z: -1, w: 0 },~
+** Processing line: ~ { x: 1, y: -1, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, y: -1, z: -1, w: 0 },~
+** Processing line: ~ { x: -1, y: -1, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # engine left~
+** Processing line: ~ { x: -1, z: -1, y: -1, w: 0 },~
+** Processing line: ~ { x: -1, z: -1, y: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, z: -1, y: 1, w: 0 },~
+** Processing line: ~ { x: -1, z: 1, y: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, z: 1, y: 1, w: 0 },~
+** Processing line: ~ { x: -1, z: 1, y: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, z: 1, y: -1, w: 0 },~
+** Processing line: ~ { x: -1, z: -1, y: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # engine right~
+** Processing line: ~ { x: 1, z: -1, y: -1, w: 0 },~
+** Processing line: ~ { x: 1, z: -1, y: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, z: -1, y: 1, w: 0 },~
+** Processing line: ~ { x: 1, z: 1, y: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, z: 1, y: 1, w: 0 },~
+** Processing line: ~ { x: 1, z: 1, y: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, z: 1, y: -1, w: 0 },~
+** Processing line: ~ { x: 1, z: -1, y: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # top front of engine to front of ship~
+** Processing line: ~ { x: 1, y: 1, z: 1, w: 0 },~
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+** Processing line: ~ { x: -1, y: 1, z: 1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # bottom front of engine~
+** Processing line: ~ { x: 1, y: -1, z: 1, w: 0 },~
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, y: -1, z: 1, w: 0 },~
+** Processing line: ~ { x: 0, y: -1, z: 9, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # right wing~
+** Processing line: ~ # front of wing~
+** Processing line: ~ { x: 1, y: 0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: 9, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 9, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 10, y: 0.10, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # back of wing~
+** Processing line: ~ { x: 1, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 9, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 10, y: 0.10, z: -2, w: 0 },~
+** Processing line: ~ { x: 8, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # front of wing~
+** Processing line: ~ { x: 1, y: -0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: 9, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 9, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 10, y: -0.10, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # back of wing~
+** Processing line: ~ { x: 1, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 9, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 10, y: -0.10, z: -2, w: 0 },~
+** Processing line: ~ { x: 8, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # left wing~
+** Processing line: ~ # front of wing~
+** Processing line: ~ { x: -1, y: 0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: -9, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -9, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -10, y: 0.10, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # back of wing~
+** Processing line: ~ { x: -1, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -9, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -10, y: 0.10, z: -2, w: 0 },~
+** Processing line: ~ { x: -8, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # front of wing~
+** Processing line: ~ { x: -1, y: -0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: -9, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -9, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -10, y: -0.10, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # back of wing~
+** Processing line: ~ { x: -1, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -9, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -10, y: -0.10, z: -2, w: 0 },~
+** Processing line: ~ { x: -8, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # left fin~
+** Processing line: ~ # top~
+** Processing line: ~ { x: -1, y: 0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: -1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1.1, y: 0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: -1.1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1.1, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -1.1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # bottom~
+** Processing line: ~ { x: -1, y: -0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: -1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1.1, y: -0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: -1.1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: -1.1, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: -1.1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # right fin~
+** Processing line: ~ { x: 1, y: 0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: 1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1.1, y: 0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: 1.1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1.1, y: 0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 1.1, y: 3, z: -3, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ # bottom~
+** Processing line: ~ { x: 1, y: -0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: 1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1.1, y: -0.10, z: 1, w: 0 },~
+** Processing line: ~ { x: 1.1, y: -2, z: -2, w: 0 },~
+** Processing line: ~~
+** Processing line: ~ { x: 1.1, y: -0.10, z: -1, w: 0 },~
+** Processing line: ~ { x: 1.1, y: -2, z: -2, w: 0 },~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults~
+** Processing line: ~ state.points ||= player_ship~
+** Processing line: ~ state.shifted_points ||= state.points.map { |point| point }~
+** Processing line: ~~
+** Processing line: ~ state.scale ||= 1~
+** Processing line: ~ state.angle_x ||= 0~
+** Processing line: ~ state.angle_y ||= 0~
+** Processing line: ~ state.angle_z ||= 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def matrix_new x0, y0, z0, w0, x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3~
+** Processing line: ~ (hmap x: (hmap x: x0, y: y0, z: z0, w: w0),~
+** Processing line: ~ y: (hmap x: x1, y: y1, z: z1, w: w1),~
+** Processing line: ~ z: (hmap x: x2, y: y2, z: z2, w: w2),~
+** Processing line: ~ w: (hmap x: x3, y: y3, z: z3, w: w3))~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def angle_z_matrix degrees~
+** Processing line: ~ cos_t = Math.cos degrees.to_radians~
+** Processing line: ~ sin_t = Math.sin degrees.to_radians~
+** Processing line: ~ (matrix_new cos_t, -sin_t, 0, 0,~
+** Processing line: ~ sin_t, cos_t, 0, 0,~
+** Processing line: ~ 0, 0, 1, 0,~
+** Processing line: ~ 0, 0, 0, 1)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def angle_y_matrix degrees~
+** Processing line: ~ cos_t = Math.cos degrees.to_radians~
+** Processing line: ~ sin_t = Math.sin degrees.to_radians~
+** Processing line: ~ (matrix_new cos_t, 0, sin_t, 0,~
+** Processing line: ~ 0, 1, 0, 0,~
+** Processing line: ~ -sin_t, 0, cos_t, 0,~
+** Processing line: ~ 0, 0, 0, 1)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def angle_x_matrix degrees~
+** Processing line: ~ cos_t = Math.cos degrees.to_radians~
+** Processing line: ~ sin_t = Math.sin degrees.to_radians~
+** Processing line: ~ (matrix_new 1, 0, 0, 0,~
+** Processing line: ~ 0, cos_t, -sin_t, 0,~
+** Processing line: ~ 0, sin_t, cos_t, 0,~
+** Processing line: ~ 0, 0, 0, 1)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def scale_matrix factor~
+** Processing line: ~ (matrix_new factor, 0, 0, 0,~
+** Processing line: ~ 0, factor, 0, 0,~
+** Processing line: ~ 0, 0, factor, 0,~
+** Processing line: ~ 0, 0, 0, 1)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input~
+** Processing line: ~ if (inputs.keyboard.shift && inputs.keyboard.p)~
+** Processing line: ~ state.scale -= 0.1~
+** Processing line: ~ elsif inputs.keyboard.p~
+** Processing line: ~ state.scale += 0.1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if inputs.mouse.wheel~
+** Processing line: ~ state.scale += inputs.mouse.wheel.y~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ state.scale = state.scale.clamp(0.1, 1000)~
+** Processing line: ~~
+** Processing line: ~ if (inputs.keyboard.shift && inputs.keyboard.y) || inputs.keyboard.right~
+** Processing line: ~ state.angle_y += 1~
+** Processing line: ~ elsif (inputs.keyboard.y) || inputs.keyboard.left~
+** Processing line: ~ state.angle_y -= 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (inputs.keyboard.shift && inputs.keyboard.x) || inputs.keyboard.down~
+** Processing line: ~ state.angle_x -= 1~
+** Processing line: ~ elsif (inputs.keyboard.x || inputs.keyboard.up)~
+** Processing line: ~ state.angle_x += 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if inputs.keyboard.shift && inputs.keyboard.z~
+** Processing line: ~ state.angle_z += 1~
+** Processing line: ~ elsif inputs.keyboard.z~
+** Processing line: ~ state.angle_z -= 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if inputs.keyboard.zero~
+** Processing line: ~ state.angle_x = 0~
+** Processing line: ~ state.angle_y = 0~
+** Processing line: ~ state.angle_z = 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ angle_x = state.angle_x~
+** Processing line: ~ angle_y = state.angle_y~
+** Processing line: ~ angle_z = state.angle_z~
+** Processing line: ~ scale = state.scale~
+** Processing line: ~~
+** Processing line: ~ s_matrix = scale_matrix state.scale~
+** Processing line: ~ x_matrix = angle_z_matrix angle_z~
+** Processing line: ~ y_matrix = angle_y_matrix angle_y~
+** Processing line: ~ z_matrix = angle_x_matrix angle_x~
+** Processing line: ~~
+** Processing line: ~ state.shifted_points = state.points.map do |point|~
+** Processing line: ~ (matrix_mul s_matrix,~
+** Processing line: ~ (matrix_mul z_matrix,~
+** Processing line: ~ (matrix_mul x_matrix,~
+** Processing line: ~ (matrix_mul y_matrix, point)))).merge(original: point)~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def thick_line line~
+** Processing line: ~ [~
+** Processing line: ~ line.merge(y: line.y - 1, y2: line.y2 - 1, r: 0, g: 0, b: 0),~
+** Processing line: ~ line.merge(x: line.x - 1, x2: line.x2 - 1, r: 0, g: 0, b: 0),~
+** Processing line: ~ line.merge(x: line.x - 0, x2: line.x2 - 0, r: 0, g: 0, b: 0),~
+** Processing line: ~ line.merge(y: line.y + 1, y2: line.y2 + 1, r: 0, g: 0, b: 0),~
+** Processing line: ~ line.merge(x: line.x + 1, x2: line.x2 + 1, r: 0, g: 0, b: 0)~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render~
+** Processing line: ~ outputs.lines << state.shifted_points.each_slice(2).map do |(p1, p2)|~
+** Processing line: ~ perc = 0~
+** Processing line: ~ thick_line({ x: p1.x.*(10) + 640, y: p1.y.*(10) + 320,~
+** Processing line: ~ x2: p2.x.*(10) + 640, y2: p2.y.*(10) + 320,~
+** Processing line: ~ r: 255 * perc,~
+** Processing line: ~ g: 255 * perc,~
+** Processing line: ~ b: 255 * perc })~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ outputs.labels << [ 10, 700, "angle_x: #{state.angle_x.to_sf}", 0]~
+** Processing line: ~ outputs.labels << [ 10, 670, "x, shift+x", 0]~
+** Processing line: ~~
+** Processing line: ~ outputs.labels << [210, 700, "angle_y: #{state.angle_y.to_sf}", 0]~
+** Processing line: ~ outputs.labels << [210, 670, "y, shift+y", 0]~
+** Processing line: ~~
+** Processing line: ~ outputs.labels << [410, 700, "angle_z: #{state.angle_z.to_sf}", 0]~
+** Processing line: ~ outputs.labels << [410, 670, "z, shift+z", 0]~
+** Processing line: ~~
+** Processing line: ~ outputs.labels << [610, 700, "scale: #{state.scale.to_sf}", 0]~
+** Processing line: ~ outputs.labels << [610, 670, "p, shift+p", 0]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $game = Game.new~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~ $game.args = args~
+** Processing line: ~ $game.tick~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def set_angles x, y, z~
+** Processing line: ~ $game.state.angle_x = x~
+** Processing line: ~ $game.state.angle_y = y~
+** Processing line: ~ $game.state.angle_z = z~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $gtk.reset~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Arcade - Bullet Hell - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -217250,31 +225219,36 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def render_score~
-** Processing line: ~ outputs.primitives << [10, 710, "HI SCORE: #{state.hi_score}", large_white_typeset].label~
-** Processing line: ~ outputs.primitives << [10, 680, "SCORE: #{state.score}", large_white_typeset].label~
-** Processing line: ~ outputs.primitives << [10, 650, "DIFFICULTY: #{state.difficulty.upcase}", large_white_typeset].label~
+** Processing line: ~ outputs.primitives << { x: 10, y: 710, text: "HI SCORE: #{state.hi_score}", **large_white_typeset }~
+** Processing line: ~ outputs.primitives << { x: 10, y: 680, text: "SCORE: #{state.score}", **large_white_typeset }~
+** Processing line: ~ outputs.primitives << { x: 10, y: 650, text: "DIFFICULTY: #{state.difficulty.upcase}", **large_white_typeset }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def render_menu~
** Processing line: ~ return unless state.scene == :menu~
** Processing line: ~ render_overlay~
** Processing line: ~~
-** Processing line: ~ outputs.labels << [640, 700, "Flappy Dragon", 50, 1, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [640, 500, "Instructions: Press Spacebar to flap. Don't die.", 4, 1, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [430, 430, "[Tab] Change difficulty", 4, 0, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [430, 400, "[Enter] Start at New Difficulty ", 4, 0, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [430, 370, "[Escape] Cancel/Resume ", 4, 0, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [640, 300, "(mouse, touch, and game controllers work, too!) ", 4, 1, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [640, 200, "Difficulty: #{state.new_difficulty.capitalize}", 4, 1, 255, 255, 255]~
+** Processing line: ~ outputs.labels << { x: 640, y: 700, text: "Flappy Dragon", size_enum: 50, alignment_enum: 1, **white }~
+** Processing line: ~ outputs.labels << { x: 640, y: 500, text: "Instructions: Press Spacebar to flap. Don't die.", size_enum: 4, alignment_enum: 1, **white }~
+** Processing line: ~ outputs.labels << { x: 430, y: 430, text: "[Tab] Change difficulty", size_enum: 4, alignment_enum: 0, **white }~
+** Processing line: ~ outputs.labels << { x: 430, y: 400, text: "[Enter] Start at New Difficulty ", size_enum: 4, alignment_enum: 0, **white }~
+** Processing line: ~ outputs.labels << { x: 430, y: 370, text: "[Escape] Cancel/Resume ", size_enum: 4, alignment_enum: 0, **white }~
+** Processing line: ~ outputs.labels << { x: 640, y: 300, text: "(mouse, touch, and game controllers work, too!) ", size_enum: 4, alignment_enum: 1, **white }~
+** Processing line: ~ outputs.labels << { x: 640, y: 200, text: "Difficulty: #{state.new_difficulty.capitalize}", size_enum: 4, alignment_enum: 1, **white }~
** Processing line: ~~
-** Processing line: ~ outputs.labels << [10, 100, "Code: @amirrajan", 255, 255, 255]~
-** Processing line: ~ outputs.labels << [10, 80, "Art: @mobypixel", 255, 255, 255]~
-** Processing line: ~ outputs.labels << [10, 60, "Music: @mobypixel", 255, 255, 255]~
-** Processing line: ~ outputs.labels << [10, 40, "Engine: DragonRuby GTK", 255, 255, 255]~
+** Processing line: ~ outputs.labels << { x: 10, y: 100, text: "Code: @amirrajan", **white }~
+** Processing line: ~ outputs.labels << { x: 10, y: 80, text: "Art: @mobypixel", **white }~
+** Processing line: ~ outputs.labels << { x: 10, y: 60, text: "Music: @mobypixel", **white }~
+** Processing line: ~ outputs.labels << { x: 10, y: 40, text: "Engine: DragonRuby GTK", **white }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def render_overlay~
-** Processing line: ~ outputs.primitives << [grid.rect.scale_rect(1.1, 0, 0), 0, 0, 0, 230].solid~
+** Processing line: ~ overlay_rect = grid.rect.scale_rect(1.1, 0, 0)~
+** Processing line: ~ outputs.primitives << { x: overlay_rect.x,~
+** Processing line: ~ y: overlay_rect.y,~
+** Processing line: ~ w: overlay_rect.w,~
+** Processing line: ~ h: overlay_rect.h,~
+** Processing line: ~ r: 0, g: 0, b: 0, a: 230 }.solid!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def render_game~
@@ -217287,14 +225261,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def render_game_over~
** Processing line: ~ return unless state.scene == :game~
-** Processing line: ~ outputs.labels << [638, 358, score_text, 20, 1]~
-** Processing line: ~ outputs.labels << [635, 360, score_text, 20, 1, 255, 255, 255]~
-** Processing line: ~ outputs.labels << [638, 428, countdown_text, 20, 1]~
-** Processing line: ~ outputs.labels << [635, 430, countdown_text, 20, 1, 255, 255, 255]~
+** Processing line: ~ outputs.labels << { x: 638, y: 358, text: score_text, size_enum: 20, alignment_enum: 1 }~
+** Processing line: ~ outputs.labels << { x: 635, y: 360, text: score_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }~
+** Processing line: ~ outputs.labels << { x: 638, y: 428, text: countdown_text, size_enum: 20, alignment_enum: 1 }~
+** Processing line: ~ outputs.labels << { x: 635, y: 430, text: countdown_text, size_enum: 20, alignment_enum: 1, r: 255, g: 255, b: 255 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def render_background~
-** Processing line: ~ outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']~
+** Processing line: ~ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: 'sprites/background.png' }~
** Processing line: ~~
** Processing line: ~ scroll_point_at = state.tick_count~
** Processing line: ~ scroll_point_at = state.scene_at if state.scene == :menu~
@@ -217306,11 +225280,18 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ outputs.sprites << scrolling_background(scroll_point_at, 'sprites/parallax_front.png', 1.00, -80)~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def scrolling_background at, path, rate, y = 0~
+** Processing line: ~ [~
+** Processing line: ~ { x: 0 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path },~
+** Processing line: ~ { x: 1440 - at.*(rate) % 1440, y: y, w: 1440, h: 720, path: path }~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def render_walls~
** Processing line: ~ state.walls.each do |w|~
** Processing line: ~ w.sprites = [~
-** Processing line: ~ [w.x, w.bottom_height - 720, 100, 720, 'sprites/wall.png', 180],~
-** Processing line: ~ [w.x, w.top_y, 100, 720, 'sprites/wallbottom.png', 0]~
+** Processing line: ~ { x: w.x, y: w.bottom_height - 720, w: 100, h: 720, path: 'sprites/wall.png', angle: 180 },~
+** Processing line: ~ { x: w.x, y: w.top_y, w: 100, h: 720, path: 'sprites/wallbottom.png', angle: 0 }~
** Processing line: ~ ]~
** Processing line: ~ end~
** Processing line: ~ outputs.sprites << state.walls.map(&:sprites)~
@@ -217319,15 +225300,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def render_dragon~
** Processing line: ~ state.show_death = true if state.countdown == 3.seconds~
** Processing line: ~~
-** Processing line: ~ render_debug_hitbox false~
-** Processing line: ~~
** Processing line: ~ if state.show_death == false || !state.death_at~
** Processing line: ~ animation_index = state.flapped_at.frame_index 6, 2, false if state.flapped_at~
** Processing line: ~ sprite_name = "sprites/dragon_fly#{animation_index.or(0) + 1}.png"~
-** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~
+** Processing line: ~ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }~
** Processing line: ~ else~
** Processing line: ~ sprite_name = "sprites/dragon_die.png"~
-** Processing line: ~ state.dragon_sprite = [state.x, state.y, 100, 80, sprite_name, state.dy * 1.2]~
+** Processing line: ~ state.dragon_sprite = { x: state.x, y: state.y, w: 100, h: 80, path: sprite_name, angle: state.dy * 1.2 }~
** Processing line: ~ sprite_changed_elapsed = state.death_at.elapsed_time - 1.seconds~
** Processing line: ~ state.dragon_sprite.angle += (sprite_changed_elapsed ** 1.3) * state.death_fall_direction * -1~
** Processing line: ~ state.dragon_sprite.x += (sprite_changed_elapsed ** 1.2) * state.death_fall_direction~
@@ -217337,20 +225316,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ outputs.sprites << state.dragon_sprite~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def render_debug_hitbox show~
-** Processing line: ~ return unless show~
-** Processing line: ~ outputs.borders << [dragon_collision_box.rect, 255, 0, 0] if state.dragon_sprite~
-** Processing line: ~ outputs.borders << state.walls.flat_map do |w|~
-** Processing line: ~ w.sprites.map { |s| [s.rect, 255, 0, 0] }~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def render_flash~
** Processing line: ~ return unless state.flash_at~
** Processing line: ~~
-** Processing line: ~ outputs.primitives << [grid.rect,~
-** Processing line: ~ white,~
-** Processing line: ~ 255 * state.flash_at.ease(20, :flip)].solid~
+** Processing line: ~ outputs.primitives << { **grid.rect.to_hash,~
+** Processing line: ~ **white,~
+** Processing line: ~ a: 255 * state.flash_at.ease(20, :flip) }.solid!~
** Processing line: ~~
** Processing line: ~ state.flash_at = 0 if state.flash_at.elapsed_time > 20~
** Processing line: ~ end~
@@ -217470,19 +225441,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def scrolling_background at, path, rate, y = 0~
-** Processing line: ~ [~
-** Processing line: ~ [ 0 - at.*(rate) % 1440, y, 1440, 720, path],~
-** Processing line: ~ [1440 - at.*(rate) % 1440, y, 1440, 720, path]~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def white~
-** Processing line: ~ [255, 255, 255]~
+** Processing line: ~ { r: 255, g: 255, b: 255 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def large_white_typeset~
-** Processing line: ~ [5, 0, 255, 255, 255]~
+** Processing line: ~ { size_enum: 5, alignment_enum: 0, r: 255, g: 255, b: 255 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def at_beginning?~
@@ -217491,9 +225455,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def dragon_collision_box~
** Processing line: ~ state.dragon_sprite~
-** Processing line: ~ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)~
-** Processing line: ~ .rect_shift_right(10)~
-** Processing line: ~ .rect_shift_up(state.dy * 2)~
+** Processing line: ~ .scale_rect(1.0 - collision_forgiveness, 0.5, 0.5)~
+** Processing line: ~ .rect_shift_right(10)~
+** Processing line: ~ .rect_shift_up(state.dy * 2)~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def game_over?~
@@ -217502,7 +225466,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ state.walls~
** Processing line: ~ .flat_map { |w| w.sprites }~
** Processing line: ~ .any? do |s|~
-** Processing line: ~ s.intersect_rect?(dragon_collision_box)~
+** Processing line: ~ s && s.intersect_rect?(dragon_collision_box)~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -219001,334 +226965,6 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~*** Crafting - Farming Game Starting Point - repl.rb~
-- H3 detected.
-- Determining if line is a header.
-- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Crafting - Farming Game Starting Point - repl.rb~
-- Line's tilde count is: 0
-- Line contains link marker: false
-- Determining if line is a header.
-- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Crafting - Farming Game Starting Point - repl.rb~
-- Line's tilde count is: 0
-- Line contains link marker: false
-** Processing line: ~~
-** Processing line: ~#+begin_src ruby~
-- PRE start detected.
-** Processing line: ~ # ./samples/99_genre_crafting/farming_game_starting_point/app/repl.rb~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~ # Welcome to repl.rb~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~ # You can experiement with code within this file. Code in this~
-** Processing line: ~ # file is only executed when you save (and only excecuted ONCE).~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~ # REMOVE the "x" from the word "xrepl" and save the file to RUN~
-** Processing line: ~ # the code in between the do/end block delimiters.~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~ # ADD the "x" to the word "repl" (make it xrepl) and save the~
-** Processing line: ~ # file to IGNORE the code in between the do/end block delimiters.~
-** Processing line: ~ # ===============================================================~
-** Processing line: ~~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ puts "The result of 1 + 2 is: #{1 + 2}"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Ruby Crash Course:~
-** Processing line: ~ # Strings, Numeric, Booleans, Conditionals, Looping, Enumerables, Arrays~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Strings~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ message = "Hello World"~
-** Processing line: ~ puts "The value of message is: " + message~
-** Processing line: ~ puts "Any value can be interpolated within a string using \#{}."~
-** Processing line: ~ puts "Interpolated message: #{message}."~
-** Processing line: ~ puts 'This #{message} is not interpolated because the string uses single quotes.'~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Numerics~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ a = 10~
-** Processing line: ~ puts "The value of a is: #{a}"~
-** Processing line: ~ puts "a + 1 is: #{a + 1}"~
-** Processing line: ~ puts "a / 3 is: #{a / 3}"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ b = 10.12~
-** Processing line: ~ puts "The value of b is: #{b}"~
-** Processing line: ~ puts "b + 1 is: #{b + 1}"~
-** Processing line: ~ puts "b as an integer is: #{b.to_i}"~
-** Processing line: ~ puts ''~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Booleans~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ c = 30~
-** Processing line: ~ puts "The value of c is #{c}."~
-** Processing line: ~~
-** Processing line: ~ if c~
-** Processing line: ~ puts "This if statement ran because c is truthy."~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ d = false~
-** Processing line: ~ puts "The value of d is #{d}."~
-** Processing line: ~~
-** Processing line: ~ if !d~
-** Processing line: ~ puts "This if statement ran because d is falsey, using the not operator (!) makes d evaluate to true."~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ e = nil~
-** Processing line: ~ puts "Nil is also considered falsey. The value of e is: #{e}."~
-** Processing line: ~~
-** Processing line: ~ if !e~
-** Processing line: ~ puts "This if statement ran because e is nil (a falsey value)."~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Conditionals~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ i_am_true = true~
-** Processing line: ~ i_am_nil = nil~
-** Processing line: ~ i_am_false = false~
-** Processing line: ~ i_am_hi = "hi"~
-** Processing line: ~~
-** Processing line: ~ puts "======== if statement"~
-** Processing line: ~ i_am_one = 1~
-** Processing line: ~ if i_am_one~
-** Processing line: ~ puts "This was printed because i_am_one is truthy."~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts "======== if/else statement"~
-** Processing line: ~ if i_am_false~
-** Processing line: ~ puts "This will NOT get printed because i_am_false is false."~
-** Processing line: ~ else~
-** Processing line: ~ puts "This was printed because i_am_false is false."~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts "======== if/elsif/else statement"~
-** Processing line: ~ if i_am_false~
-** Processing line: ~ puts "This will NOT get printed because i_am_false is false."~
-** Processing line: ~ elsif i_am_true~
-** Processing line: ~ puts "This was printed because i_am_true is true."~
-** Processing line: ~ else~
-** Processing line: ~ puts "This will NOT get printed i_am_true was true."~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts "======== case statement "~
-** Processing line: ~ i_am_one = 1~
-** Processing line: ~ case i_am_one~
-** Processing line: ~ when 10~
-** Processing line: ~ puts "case equaled: 10"~
-** Processing line: ~ when 9~
-** Processing line: ~ puts "case equaled: 9"~
-** Processing line: ~ when 5~
-** Processing line: ~ puts "case equaled: 5"~
-** Processing line: ~ when 1~
-** Processing line: ~ puts "case equaled: 1"~
-** Processing line: ~ else~
-** Processing line: ~ puts "Value wasn't cased."~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts "======== different types of comparisons"~
-** Processing line: ~ if 4 == 4~
-** Processing line: ~ puts "equal (4 == 4)"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if 4 != 3~
-** Processing line: ~ puts "not equal (4 != 3)"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if 3 < 4~
-** Processing line: ~ puts "less than (3 < 4)"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if 4 > 3~
-** Processing line: ~ puts "greater than (4 > 3)"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if ((4 > 3) || (3 < 4) || false)~
-** Processing line: ~ puts "or statement ((4 > 3) || (3 < 4) || false)"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if ((4 > 3) && (3 < 4))~
-** Processing line: ~ puts "and statement ((4 > 3) && (3 < 4))"~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Looping~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ puts "======== times block"~
-** Processing line: ~ 3.times do |i|~
-** Processing line: ~ puts i~
-** Processing line: ~ end~
-** Processing line: ~ puts "======== range block exclusive"~
-** Processing line: ~ (0...3).each do |i|~
-** Processing line: ~ puts i~
-** Processing line: ~ end~
-** Processing line: ~ puts "======== range block inclusive"~
-** Processing line: ~ (0..3).each do |i|~
-** Processing line: ~ puts i~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Enumerables~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ puts "======== array each"~
-** Processing line: ~ colors = ["red", "blue", "yellow"]~
-** Processing line: ~ colors.each do |color|~
-** Processing line: ~ puts color~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts '======== array each_with_index'~
-** Processing line: ~ colors = ["red", "blue", "yellow"]~
-** Processing line: ~ colors.each_with_index do |color, i|~
-** Processing line: ~ puts "#{color} at index #{i}"~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ puts "======== single parameter function"~
-** Processing line: ~ def add_one_to n~
-** Processing line: ~ n + 5~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts add_one_to(3)~
-** Processing line: ~~
-** Processing line: ~ puts "======== function with default value"~
-** Processing line: ~ def function_with_default_value v = 10~
-** Processing line: ~ v * 10~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts "passing three: #{function_with_default_value(3)}"~
-** Processing line: ~ puts "passing nil: #{function_with_default_value}"~
-** Processing line: ~~
-** Processing line: ~ puts "======== Or Equal (||=) operator for nil values"~
-** Processing line: ~ def function_with_nil_default_with_local a = nil~
-** Processing line: ~ result = a~
-** Processing line: ~ result ||= "or equal operator was exected and set a default value"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ puts "passing 'hi': #{function_with_nil_default_with_local 'hi'}"~
-** Processing line: ~ puts "passing nil: #{function_with_nil_default_with_local}"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Arrays~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ puts "======== Create an array with the numbers 1 to 10."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ puts one_to_ten~
-** Processing line: ~~
-** Processing line: ~ puts "======== Create a new array that only contains even numbers from the previous array."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ evens = one_to_ten.find_all do |number|~
-** Processing line: ~ number % 2 == 0~
-** Processing line: ~ end~
-** Processing line: ~ puts evens~
-** Processing line: ~~
-** Processing line: ~ puts "======== Create a new array that rejects odd numbers."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ also_even = one_to_ten.reject do |number|~
-** Processing line: ~ number % 2 != 0~
-** Processing line: ~ end~
-** Processing line: ~ puts also_even~
-** Processing line: ~~
-** Processing line: ~ puts "======== Create an array that doubles every number."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ doubled = one_to_ten.map do |number|~
-** Processing line: ~ number * 2~
-** Processing line: ~ end~
-** Processing line: ~ puts doubled~
-** Processing line: ~~
-** Processing line: ~ puts "======== Create an array that selects only odd numbers and then multiply those by 10."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ odd_doubled = one_to_ten.find_all do |number|~
-** Processing line: ~ number % 2 != 0~
-** Processing line: ~ end.map do |odd_number|~
-** Processing line: ~ odd_number * 10~
-** Processing line: ~ end~
-** Processing line: ~ puts odd_doubled~
-** Processing line: ~~
-** Processing line: ~ puts "======== All combination of numbers 1 to 10."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ all_combinations = one_to_ten.product(one_to_ten)~
-** Processing line: ~ puts all_combinations~
-** Processing line: ~~
-** Processing line: ~ puts "======== All uniq combinations of numbers. For example: [1, 2] is the same as [2, 1]."~
-** Processing line: ~ one_to_ten = (1..10).to_a~
-** Processing line: ~ uniq_combinations =~
-** Processing line: ~ one_to_ten.product(one_to_ten)~
-** Processing line: ~ .map do |unsorted_number|~
-** Processing line: ~ unsorted_number.sort~
-** Processing line: ~ end.uniq~
-** Processing line: ~ puts uniq_combinations~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Advanced Arrays~
-** Processing line: ~ # ====================================================================================~
-** Processing line: ~ # Remove the x from xrepl to run the code. Add the x back to ignore to code.~
-** Processing line: ~ xrepl do~
-** Processing line: ~ puts "======== All unique Pythagorean Triples between 1 and 40 sorted by area of the triangle."~
-** Processing line: ~~
-** Processing line: ~ one_to_hundred = (1..40).to_a~
-** Processing line: ~ triples =~
-** Processing line: ~ one_to_hundred.product(one_to_hundred).map do |width, height|~
-** Processing line: ~ [width, height, Math.sqrt(width ** 2 + height ** 2)]~
-** Processing line: ~ end.find_all do |_, _, hypotenuse|~
-** Processing line: ~ hypotenuse.to_i == hypotenuse~
-** Processing line: ~ end.map do |triangle|~
-** Processing line: ~ triangle.map(&:to_i)~
-** Processing line: ~ end.uniq do |triangle|~
-** Processing line: ~ triangle.sort~
-** Processing line: ~ end.map do |width, height, hypotenuse|~
-** Processing line: ~ [width, height, hypotenuse, (width * height) / 2]~
-** Processing line: ~ end.sort_by do |_, _, _, area|~
-** Processing line: ~ area~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ triples.each do |width, height, hypotenuse, area|~
-** Processing line: ~ puts "(#{width}, #{height}, #{hypotenuse}) = #{area}"~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~#+end_src~
-- PRE end detected.
-** Processing line: ~~
-** Processing line: ~~
** Processing line: ~*** Crafting - Farming Game Starting Point - tests.rb~
- H3 detected.
- Determining if line is a header.
@@ -222639,6 +230275,407 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Mario - Jumping - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Mario - Jumping - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Mario - Jumping - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/99_genre_mario/01_jumping/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ defaults args~
+** Processing line: ~ render args~
+** Processing line: ~ input args~
+** Processing line: ~ calc args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults args~
+** Processing line: ~ args.state.player.x ||= args.grid.w.half~
+** Processing line: ~ args.state.player.y ||= 0~
+** Processing line: ~ args.state.player.size ||= 100~
+** Processing line: ~ args.state.player.dy ||= 0~
+** Processing line: ~ args.state.player.action ||= :jumping~
+** Processing line: ~ args.state.jump.power = 20~
+** Processing line: ~ args.state.jump.increase_frames = 10~
+** Processing line: ~ args.state.jump.increase_power = 1~
+** Processing line: ~ args.state.gravity = -1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render args~
+** Processing line: ~ args.outputs.sprites << {~
+** Processing line: ~ x: args.state.player.x -~
+** Processing line: ~ args.state.player.size.half,~
+** Processing line: ~ y: args.state.player.y,~
+** Processing line: ~ w: args.state.player.size,~
+** Processing line: ~ h: args.state.player.size,~
+** Processing line: ~ path: 'sprites/square/red.png'~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input args~
+** Processing line: ~ if args.inputs.keyboard.key_down.space~
+** Processing line: ~ if args.state.player.action == :standing~
+** Processing line: ~ args.state.player.action = :jumping~
+** Processing line: ~ args.state.player.dy = args.state.jump.power~
+** Processing line: ~~
+** Processing line: ~ # record when the action took place~
+** Processing line: ~ current_frame = args.state.tick_count~
+** Processing line: ~ args.state.player.action_at = current_frame~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # if the space bar is being held~
+** Processing line: ~ if args.inputs.keyboard.key_held.space~
+** Processing line: ~ # is the player jumping~
+** Processing line: ~ is_jumping = args.state.player.action == :jumping~
+** Processing line: ~~
+** Processing line: ~ # when was the jump performed~
+** Processing line: ~ time_of_jump = args.state.player.action_at~
+** Processing line: ~~
+** Processing line: ~ # how much time has passed since the jump~
+** Processing line: ~ jump_elapsed_time = time_of_jump.elapsed_time~
+** Processing line: ~~
+** Processing line: ~ # how much time is allowed for increasing power~
+** Processing line: ~ time_allowed = args.state.jump.increase_frames~
+** Processing line: ~~
+** Processing line: ~ # if the player is jumping~
+** Processing line: ~ # and the elapsed time is less than~
+** Processing line: ~ # the allowed time~
+** Processing line: ~ if is_jumping && jump_elapsed_time < time_allowed~
+** Processing line: ~ # increase the dy by the increase power~
+** Processing line: ~ power_to_add = args.state.jump.increase_power~
+** Processing line: ~ args.state.player.dy += power_to_add~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc args~
+** Processing line: ~ if args.state.player.action == :jumping~
+** Processing line: ~ args.state.player.y += args.state.player.dy~
+** Processing line: ~ args.state.player.dy += args.state.gravity~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.state.player.y < 0~
+** Processing line: ~ args.state.player.y = 0~
+** Processing line: ~ args.state.player.action = :standing~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~*** Mario - Jumping And Collisions - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Mario - Jumping And Collisions - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Mario - Jumping And Collisions - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/99_genre_mario/02_jumping_and_collisions/app/main.rb~
+** Processing line: ~ class Game~
+** Processing line: ~ attr_gtk~
+** Processing line: ~~
+** Processing line: ~ def tick~
+** Processing line: ~ defaults~
+** Processing line: ~ render~
+** Processing line: ~ input~
+** Processing line: ~ calc~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults~
+** Processing line: ~ return if state.tick_count != 0~
+** Processing line: ~~
+** Processing line: ~ player.x = 64~
+** Processing line: ~ player.y = 800~
+** Processing line: ~ player.size = 50~
+** Processing line: ~ player.dx = 0~
+** Processing line: ~ player.dy = 0~
+** Processing line: ~ player.action = :falling~
+** Processing line: ~~
+** Processing line: ~ player.max_speed = 20~
+** Processing line: ~ player.jump_power = 15~
+** Processing line: ~ player.jump_air_time = 15~
+** Processing line: ~ player.jump_increase_power = 1~
+** Processing line: ~~
+** Processing line: ~ state.gravity = -1~
+** Processing line: ~ state.drag = 0.001~
+** Processing line: ~ state.tile_size = 64~
+** Processing line: ~ state.tiles ||= [~
+** Processing line: ~ { ordinal_x: 0, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 1, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 2, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 3, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 4, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 5, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 6, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 7, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 8, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 9, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 10, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 11, ordinal_y: 0 },~
+** Processing line: ~ { ordinal_x: 12, ordinal_y: 0 },~
+** Processing line: ~~
+** Processing line: ~ { ordinal_x: 9, ordinal_y: 3 },~
+** Processing line: ~ { ordinal_x: 10, ordinal_y: 3 },~
+** Processing line: ~ { ordinal_x: 11, ordinal_y: 3 },~
+** Processing line: ~ ]~
+** Processing line: ~~
+** Processing line: ~ tiles.each do |t|~
+** Processing line: ~ t.rect = { x: t.ordinal_x * 64,~
+** Processing line: ~ y: t.ordinal_y * 64,~
+** Processing line: ~ w: 64,~
+** Processing line: ~ h: 64 }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render~
+** Processing line: ~ render_player~
+** Processing line: ~ render_tiles~
+** Processing line: ~ # render_grid~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input~
+** Processing line: ~ input_jump~
+** Processing line: ~ input_move~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc~
+** Processing line: ~ calc_player_rect~
+** Processing line: ~ calc_left~
+** Processing line: ~ calc_right~
+** Processing line: ~ calc_below~
+** Processing line: ~ calc_above~
+** Processing line: ~ calc_player_dy~
+** Processing line: ~ calc_player_dx~
+** Processing line: ~ calc_game_over~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_player~
+** Processing line: ~ outputs.sprites << {~
+** Processing line: ~ x: player.x,~
+** Processing line: ~ y: player.y,~
+** Processing line: ~ w: player.size,~
+** Processing line: ~ h: player.size,~
+** Processing line: ~ path: 'sprites/square/red.png'~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_tiles~
+** Processing line: ~ outputs.sprites << state.tiles.map do |t|~
+** Processing line: ~ t.merge path: 'sprites/square/white.png',~
+** Processing line: ~ x: t.ordinal_x * 64,~
+** Processing line: ~ y: t.ordinal_y * 64,~
+** Processing line: ~ w: 64,~
+** Processing line: ~ h: 64~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_grid~
+** Processing line: ~ if state.tick_count == 0~
+** Processing line: ~ outputs[:grid].background_color = [0, 0, 0, 0]~
+** Processing line: ~ outputs[:grid].borders << available_brick_locations~
+** Processing line: ~ outputs[:grid].labels << available_brick_locations.map do |b|~
+** Processing line: ~ [~
+** Processing line: ~ b.merge(text: "#{b.ordinal_x},#{b.ordinal_y}",~
+** Processing line: ~ x: b.x + 2,~
+** Processing line: ~ y: b.y + 2,~
+** Processing line: ~ size_enum: -3,~
+** Processing line: ~ vertical_alignment_enum: 0,~
+** Processing line: ~ blendmode_enum: 0),~
+** Processing line: ~ b.merge(text: "#{b.x},#{b.y}",~
+** Processing line: ~ x: b.x + 2,~
+** Processing line: ~ y: b.y + 2 + 20,~
+** Processing line: ~ size_enum: -3,~
+** Processing line: ~ vertical_alignment_enum: 0,~
+** Processing line: ~ blendmode_enum: 0)~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ outputs.sprites << { x: 0, y: 0, w: 1280, h: 720, path: :grid }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input_jump~
+** Processing line: ~ if inputs.keyboard.key_down.space~
+** Processing line: ~ player_jump~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if inputs.keyboard.key_held.space~
+** Processing line: ~ player_jump_increase_air_time~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input_move~
+** Processing line: ~ if player.dx.abs < 20~
+** Processing line: ~ if inputs.keyboard.left~
+** Processing line: ~ player.dx -= 2~
+** Processing line: ~ elsif inputs.keyboard.right~
+** Processing line: ~ player.dx += 2~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_game_over~
+** Processing line: ~ if player.y < -64~
+** Processing line: ~ player.x = 64~
+** Processing line: ~ player.y = 800~
+** Processing line: ~ player.dx = 0~
+** Processing line: ~ player.dy = 0~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_player_rect~
+** Processing line: ~ player.rect = player_current_rect~
+** Processing line: ~ player.next_rect = player_next_rect~
+** Processing line: ~ player.prev_rect = player_prev_rect~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_player_dx~
+** Processing line: ~ player.dx = player_next_dx~
+** Processing line: ~ player.x += player.dx~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_player_dy~
+** Processing line: ~ player.y += player.dy~
+** Processing line: ~ player.dy = player_next_dy~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_below~
+** Processing line: ~ return unless player.dy < 0~
+** Processing line: ~ tiles_below = tiles_find { |t| t.rect.top <= player.prev_rect.y }~
+** Processing line: ~ collision = tiles_find_colliding tiles_below, (player.rect.merge y: player.next_rect.y)~
+** Processing line: ~ if collision~
+** Processing line: ~ player.y = collision.rect.y + state.tile_size~
+** Processing line: ~ player.dy = 0~
+** Processing line: ~ player.action = :standing~
+** Processing line: ~ else~
+** Processing line: ~ player.action = :falling~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_left~
+** Processing line: ~ return unless player.dx < 0 && player_next_dx < 0~
+** Processing line: ~ tiles_left = tiles_find { |t| t.rect.right <= player.prev_rect.left }~
+** Processing line: ~ collision = tiles_find_colliding tiles_left, (player.rect.merge x: player.next_rect.x)~
+** Processing line: ~ return unless collision~
+** Processing line: ~ player.x = collision.rect.right~
+** Processing line: ~ player.dx = 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_right~
+** Processing line: ~ return unless player.dx > 0 && player_next_dx > 0~
+** Processing line: ~ tiles_right = tiles_find { |t| t.rect.left >= player.prev_rect.right }~
+** Processing line: ~ collision = tiles_find_colliding tiles_right, (player.rect.merge x: player.next_rect.x)~
+** Processing line: ~ return unless collision~
+** Processing line: ~ player.x = collision.rect.left - player.rect.w~
+** Processing line: ~ player.dx = 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_above~
+** Processing line: ~ return unless player.dy > 0~
+** Processing line: ~ tiles_above = tiles_find { |t| t.rect.y >= player.prev_rect.y }~
+** Processing line: ~ collision = tiles_find_colliding tiles_above, (player.rect.merge y: player.next_rect.y)~
+** Processing line: ~ return unless collision~
+** Processing line: ~ player.dy = 0~
+** Processing line: ~ player.y = collision.rect.bottom - player.rect.h~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_current_rect~
+** Processing line: ~ { x: player.x, y: player.y, w: player.size, h: player.size }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def available_brick_locations~
+** Processing line: ~ (0..19).to_a~
+** Processing line: ~ .product(0..11)~
+** Processing line: ~ .map do |(ordinal_x, ordinal_y)|~
+** Processing line: ~ { ordinal_x: ordinal_x,~
+** Processing line: ~ ordinal_y: ordinal_y,~
+** Processing line: ~ x: ordinal_x * 64,~
+** Processing line: ~ y: ordinal_y * 64,~
+** Processing line: ~ w: 64,~
+** Processing line: ~ h: 64 }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player~
+** Processing line: ~ state.player ||= args.state.new_entity :player~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_next_dy~
+** Processing line: ~ player.dy + state.gravity + state.drag ** 2 * -1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_next_dx~
+** Processing line: ~ player.dx * 0.8~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_next_rect~
+** Processing line: ~ player.rect.merge x: player.x + player_next_dx,~
+** Processing line: ~ y: player.y + player_next_dy~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_prev_rect~
+** Processing line: ~ player.rect.merge x: player.x - player.dx,~
+** Processing line: ~ y: player.y - player.dy~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_jump~
+** Processing line: ~ return if player.action != :standing~
+** Processing line: ~ player.action = :jumping~
+** Processing line: ~ player.dy = state.player.jump_power~
+** Processing line: ~ current_frame = state.tick_count~
+** Processing line: ~ player.action_at = current_frame~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player_jump_increase_air_time~
+** Processing line: ~ return if player.action != :jumping~
+** Processing line: ~ return if player.action_at.elapsed_time >= player.jump_air_time~
+** Processing line: ~ player.dy += player.jump_increase_power~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tiles~
+** Processing line: ~ state.tiles~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tiles_find_colliding tiles, target~
+** Processing line: ~ tiles.find { |t| t.rect.intersect_rect? target }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tiles_find &block~
+** Processing line: ~ tiles.find_all(&block)~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~ $game ||= Game.new~
+** Processing line: ~ $game.args = args~
+** Processing line: ~ $game.tick~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $gtk.reset~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Platformer - Clepto Frog - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -222655,7 +230692,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~#+begin_src ruby~
- PRE start detected.
** Processing line: ~ # ./samples/99_genre_platformer/clepto_frog/app/main.rb~
-** Processing line: ~ MAP_FILE_PATH = 'app/map.txt'~
+** Processing line: ~ MAP_FILE_PATH = 'map.txt'~
** Processing line: ~~
** Processing line: ~ require 'app/map.rb'~
** Processing line: ~~
@@ -222710,35 +230747,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def render_intro~
** Processing line: ~ outputs.labels << [640, 700, "Clepto Frog", 4, 1]~
-** Processing line: ~ if state.tick_count >= 120~
-** Processing line: ~ outputs.labels << [640, 620, "\"Uh... your office has a pet frog?\" - New Guy",~
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 120.ease(60)]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if state.tick_count >= 240~
-** Processing line: ~ outputs.labels << [640, 580, "\"Yep! His name is Clepto.\" - Jim",~
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 240.ease(60)]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if state.tick_count >= 360~
-** Processing line: ~ outputs.labels << [640, 540, "\"Uh...\" - New Guy",~
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 360.ease(60)]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if state.tick_count >= 480~
-** Processing line: ~ outputs.labels << [640, 500, "\"He steals mugs while we're away...\" - Jim",~
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 480.ease(60)]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if state.tick_count >= 600~
-** Processing line: ~ outputs.labels << [640, 460, "\"It's not a big deal, we take them back in the morning.\" - Jim",~
-** Processing line: ~ 4, 1, 0, 0, 0, 255 * 600.ease(60)]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ outputs.sprites << [640 - 50, 360 - 50, 100, 100,~
-** Processing line: ~ "sprites/square-green.png"]~
-** Processing line: ~~
-** Processing line: ~ if state.tick_count == 800~
+** Processing line: ~ if state.tick_count == 120~
** Processing line: ~ state.scene = :game~
** Processing line: ~ state.game_start_at = state.tick_count~
** Processing line: ~ end~
@@ -222746,7 +230755,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def tick~
** Processing line: ~ defaults~
-** Processing line: ~ if state.scene == :intro && state.tick_count <= 800~
+** Processing line: ~ if state.scene == :intro && state.tick_count <= 120~
** Processing line: ~ render_intro~
** Processing line: ~ elsif state.scene == :ending~
** Processing line: ~ render_ending~
@@ -222849,15 +230858,15 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ if state.god_mode~
** Processing line: ~ # SHOW HIDE COLLISIONS~
-** Processing line: ~ outputs.sprites << state.world.map do |x, y, w, h|~
-** Processing line: ~ x = vx(x)~
-** Processing line: ~ y = vy(y)~
+** Processing line: ~ outputs.sprites << state.world.map do |rect|~
+** Processing line: ~ x = vx(rect.x)~
+** Processing line: ~ y = vy(rect.y)~
** Processing line: ~ if x > -80 && x < 1280 && y > -80 && y < 720~
** Processing line: ~ {~
** Processing line: ~ x: x,~
** Processing line: ~ y: y,~
-** Processing line: ~ w: vw(w || state.tile_size),~
-** Processing line: ~ h: vh(h || state.tile_size),~
+** Processing line: ~ w: vw(rect.w || state.tile_size),~
+** Processing line: ~ h: vh(rect.h || state.tile_size),~
** Processing line: ~ path: 'sprites/square-gray.png',~
** Processing line: ~ a: 128~
** Processing line: ~ }~
@@ -222880,8 +230889,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~~
** Processing line: ~ # Creates sprite following mouse to help indicate which sprite you have selected~
-** Processing line: ~ outputs.primitives << [inputs.mouse.position.x, inputs.mouse.position.y,~
-** Processing line: ~ state.tile_size, state.tile_size, 'sprites/square-indigo.png', 0, 100].sprite~
+** Processing line: ~ outputs.primitives << [inputs.mouse.position.x - 32 * state.camera_scale,~
+** Processing line: ~ inputs.mouse.position.y - 32 * state.camera_scale,~
+** Processing line: ~ state.tile_size * state.camera_scale,~
+** Processing line: ~ state.tile_size * state.camera_scale, 'sprites/square-indigo.png', 0, 100].sprite~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ render_mini_map~
@@ -222962,6 +230973,29 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ set_camera_scale 1~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ if inputs.mouse.click~
+** Processing line: ~ state.id_seed += 1~
+** Processing line: ~ id = state.id_seed~
+** Processing line: ~ x = state.camera_x + (inputs.mouse.click.x.fdiv(state.camera_scale) - 32)~
+** Processing line: ~ y = state.camera_y + (inputs.mouse.click.y.fdiv(state.camera_scale) - 32)~
+** Processing line: ~ x = ((x + 2).idiv 4) * 4~
+** Processing line: ~ y = ((y + 2).idiv 4) * 4~
+** Processing line: ~ w = 64~
+** Processing line: ~ h = 64~
+** Processing line: ~ candidate_rect = { id: id, x: x, y: y, w: w, h: h }~
+** Processing line: ~ scaled_candidate_rect = { x: x + 30, y: y + 30, w: w - 60, h: h - 60 }~
+** Processing line: ~ to_remove = state.world.find { |r| r.intersect_rect? scaled_candidate_rect }~
+** Processing line: ~ if to_remove && args.inputs.keyboard.x~
+** Processing line: ~ state.world.reject! { |r| r.id == to_remove.id }~
+** Processing line: ~ else~
+** Processing line: ~ state.world << candidate_rect~
+** Processing line: ~ end~
+** Processing line: ~ export_map~
+** Processing line: ~ state.world_lookup = {}~
+** Processing line: ~ state.world_collision_rects = nil~
+** Processing line: ~ calc_world_lookup~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ if input_up?~
** Processing line: ~ state.y += 10~
** Processing line: ~ state.dy = 0~
@@ -222983,12 +231017,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if state.scene == :game~
** Processing line: ~ process_inputs_player_movement~
** Processing line: ~ process_inputs_god_mode~
-** Processing line: ~ elsif state.scene == :intro~
-** Processing line: ~ if args.inputs.keyboard.key_down.enter || args.inputs.keyboard.key_down.space~
-** Processing line: ~ if Kernel.tick_count < 600~
-** Processing line: ~ Kernel.tick_count = 600~
-** Processing line: ~ end~
-** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -223086,17 +231114,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def add_floors~
-** Processing line: ~ # floors~
-** Processing line: ~ state.world += [~
-** Processing line: ~ [0, 0, 10000, 40],~
-** Processing line: ~ [0, 1670, 3250, 60],~
-** Processing line: ~ [6691, 1653, 3290, 60],~
-** Processing line: ~ [1521, 3792, 7370, 60],~
-** Processing line: ~ [0, 5137, 3290, 60]~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def attempt_load_world_from_file~
** Processing line: ~ return if state.world~
** Processing line: ~ # exported_world = gtk.read_file(MAP_FILE_PATH)~
@@ -223104,26 +231121,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ state.objects = []~
** Processing line: ~~
** Processing line: ~ if $collisions~
-** Processing line: ~ $collisions.map do |x, y, w, h|~
-** Processing line: ~ state.world << [x, y, w, h]~
+** Processing line: ~ state.id_seed ||= 0~
+** Processing line: ~ $collisions.each do |x, y, w, h|~
+** Processing line: ~ state.id_seed += 1~
+** Processing line: ~ state.world << { id: state.id_seed, x: x, y: y, w: w, h: h }~
** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ add_floors~
-** Processing line: ~ # elsif exported_world~
-** Processing line: ~ # exported_world.each_line.map do |l|~
-** Processing line: ~ # tokens = l.strip.split(',')~
-** Processing line: ~ # x = tokens[0].to_i~
-** Processing line: ~ # y = tokens[1].to_i~
-** Processing line: ~ # type = tokens[2].to_i~
-** Processing line: ~ # if type == 1~
-** Processing line: ~ # state.world << [x, y, state.tile_size, state.tile_size]~
-** Processing line: ~ # elsif type == 2~
-** Processing line: ~ # w, h, path = tokens[3..-1]~
-** Processing line: ~ # state.objects << [x, y, w.to_i, h.to_i, path]~
-** Processing line: ~ # end~
-** Processing line: ~ # end~
-** Processing line: ~~
-** Processing line: ~ # add_floors~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if $mugs~
@@ -223144,23 +231146,24 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ # Searches through the world and finds the cordinates that exist~
** Processing line: ~ state.world_lookup = {}~
-** Processing line: ~ state.world.each do |x, y, w, h|~
-** Processing line: ~ state.world_lookup[[x, y, w || state.tile_size, h || state.tile_size]] = true~
+** Processing line: ~ state.world.each do |rect|~
+** Processing line: ~ state.world_lookup[rect.id] = rect~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Assigns collision rects for every sprite drawn~
** Processing line: ~ state.world_collision_rects =~
** Processing line: ~ state.world_lookup~
** Processing line: ~ .keys~
-** Processing line: ~ .map do |x, y, w, h|~
+** Processing line: ~ .map do |key|~
+** Processing line: ~ rect = state.world_lookup[key]~
** Processing line: ~ s = state.tile_size~
-** Processing line: ~ w ||= s~
-** Processing line: ~ h ||= s~
+** Processing line: ~ rect.w ||= s~
+** Processing line: ~ rect.h ||= s~
** Processing line: ~ {~
-** Processing line: ~ args: [x, y, w, h],~
-** Processing line: ~ left_right: [x, y + 4, w, h - 6],~
-** Processing line: ~ top: [x + 4, y + 6, w - 8, h - 6],~
-** Processing line: ~ bottom: [x + 1, y - 1, w - 2, h - 8],~
+** Processing line: ~ args: rect,~
+** Processing line: ~ left_right: { x: rect.x, y: rect.y + 4, w: rect.w, h: rect.h - 6 },~
+** Processing line: ~ top: { x: rect.x + 4, y: rect.y + 6, w: rect.w - 8, h: rect.h - 6 },~
+** Processing line: ~ bottom: { x: rect.x + 1, y: rect.y - 1, w: rect.w - 2, h: rect.h - 8 },~
** Processing line: ~ }~
** Processing line: ~ end~
** Processing line: ~~
@@ -223216,12 +231219,21 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def end_of_tongue~
** Processing line: ~ p = state.tongue_angle.vector(state.tongue_length)~
-** Processing line: ~ [start_of_tongue.x + p.x, start_of_tongue.y + p.y]~
+** Processing line: ~ { x: start_of_tongue.x + p.x, y: start_of_tongue.y + p.y }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def calc_shooting~
+** Processing line: ~ calc_shooting_increment~
+** Processing line: ~ calc_shooting_increment~
+** Processing line: ~ calc_shooting_increment~
+** Processing line: ~ calc_shooting_increment~
+** Processing line: ~ calc_shooting_increment~
+** Processing line: ~ calc_shooting_increment~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_shooting_increment~
** Processing line: ~ return unless state.action == :shooting~
-** Processing line: ~ state.tongue_length += 30~
+** Processing line: ~ state.tongue_length += 5~
** Processing line: ~ potential_anchor = end_of_tongue~
** Processing line: ~ if potential_anchor.x <= 0~
** Processing line: ~ state.anchor_point = potential_anchor~
@@ -223240,9 +231252,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ state.action = :anchored~
** Processing line: ~ outputs.sounds << 'sounds/attached.wav'~
** Processing line: ~ else~
-** Processing line: ~ anchor_rect = [potential_anchor.x - 5, potential_anchor.y - 5, 10, 10]~
+** Processing line: ~ anchor_rect = { x: potential_anchor.x - 5, y: potential_anchor.y - 5, w: 10, h: 10 }~
** Processing line: ~ collision = state.world_collision_rects.find_all do |v|~
-** Processing line: ~ [v[:args].x, v[:args].y, v[:args].w, v[:args].h].intersect_rect?(anchor_rect)~
+** Processing line: ~ v[:args].intersect_rect?(anchor_rect)~
** Processing line: ~ end.first~
** Processing line: ~ if collision~
** Processing line: ~ state.anchor_point = potential_anchor~
@@ -223338,7 +231350,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ .first~
** Processing line: ~~
** Processing line: ~ return unless left_side_collisions~
-** Processing line: ~ state.x = left_side_collisions[:left_right].right~
+** Processing line: ~ state.x = left_side_collisions[:left_right].right + 1~
** Processing line: ~ state.dx = state.dy.abs * 0.8~
** Processing line: ~ state.collision_on_x = true~
** Processing line: ~ end~
@@ -223353,7 +231365,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ .first~
** Processing line: ~~
** Processing line: ~ return unless right_side_collisions~
-** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size~
+** Processing line: ~ state.x = right_side_collisions[:left_right].left - state.tile_size - 1~
** Processing line: ~ state.dx = state.dx.abs * 0.8 * -1~
** Processing line: ~ state.collision_on_x = true~
** Processing line: ~ end~
@@ -223369,7 +231381,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ .first~
** Processing line: ~~
** Processing line: ~ return unless ceil_collisions~
-** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size~
+** Processing line: ~ state.y = ceil_collisions[:bottom].y - state.tile_size - 1~
** Processing line: ~ state.dy = state.dy.abs * 0.8 * -1~
** Processing line: ~ state.collision_on_y = true~
** Processing line: ~ end~
@@ -223382,13 +231394,17 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def export_map~
-** Processing line: ~ export_string = state.world.map do |x, y|~
-** Processing line: ~ "#{x},#{y},1"~
-** Processing line: ~ end~
+** Processing line: ~ export_string = "$collisions = [\n"~
+** Processing line: ~ export_string += state.world.map do |rect|~
+** Processing line: ~ "[#{rect.x},#{rect.y},#{rect.w},#{rect.h}],"~
+** Processing line: ~ end.join "\n"~
+** Processing line: ~ export_string += "\n]\n\n"~
+** Processing line: ~ export_string += "$mugs = [\n"~
** Processing line: ~ export_string += state.objects.map do |x, y, w, h, path|~
-** Processing line: ~ "#{x},#{y},2,#{w},#{h},#{path}"~
-** Processing line: ~ end~
-** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string.join("\n"))~
+** Processing line: ~ "[#{x},#{y},#{w},#{h},'#{path}'],"~
+** Processing line: ~ end.join "\n"~
+** Processing line: ~ export_string += "\n]\n\n"~
+** Processing line: ~ gtk.write_file(MAP_FILE_PATH, export_string)~
** Processing line: ~ state.map_saved_at = state.tick_count~
** Processing line: ~ end~
** Processing line: ~~
@@ -224531,6 +232547,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ [4459, 3997, 64, 64],~
** Processing line: ~ [76, 5215, 64, 64],~
** Processing line: ~ [39, 5217, 64, 64],~
+** Processing line: ~ [0, 0, 10000, 40],~
+** Processing line: ~ [0, 1670, 3250, 60],~
+** Processing line: ~ [6691, 1653, 3290, 60],~
+** Processing line: ~ [1521, 3792, 7370, 60],~
+** Processing line: ~ [0, 5137, 3290, 60]~
** Processing line: ~ ]~
** Processing line: ~~
** Processing line: ~ $mugs = [~
@@ -225461,6 +233482,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def load_lines file~
+** Processing line: ~ return unless state.snaps~
** Processing line: ~ data = gtk.read_file(file) || ""~
** Processing line: ~ data.each_line~
** Processing line: ~ .reject { |l| l.strip.length == 0 }~
@@ -225519,10 +233541,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ results[:point] = { x: x, y: y }~
** Processing line: ~ results[:rect] = { x: x - radius, y: y - radius, w: radius * 2, h: radius * 2 }~
** Processing line: ~ results[:trajectory] = trajectory(results)~
-** Processing line: ~ results[:impacts] = terrain.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~
+** Processing line: ~ results[:impacts] = terrain.find_all { |t| t && (line_near_rect? results[:rect], t) }.map do |t|~
** Processing line: ~ {~
** Processing line: ~ terrain: t,~
-** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~
+** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),~
** Processing line: ~ type: :terrain~
** Processing line: ~ }~
** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~
@@ -225530,10 +233552,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ results[:impacts] += lava.find_all { |t| line_near_rect? results[:rect], t }.map do |t|~
** Processing line: ~ {~
** Processing line: ~ terrain: t,~
-** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t),~
+** Processing line: ~ point: geometry.line_intersect(results[:trajectory], t, replace_infinity: 1000),~
** Processing line: ~ type: :lava~
** Processing line: ~ }~
-** Processing line: ~ end.reject { |t| !point_within_line? t[:point], t[:terrain] }~
+** Processing line: ~ end.reject { |t| !t || (!point_within_line? t[:point], t[:terrain]) }~
** Processing line: ~~
** Processing line: ~ results~
** Processing line: ~ end~
@@ -225546,6 +233568,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def calc_terrains_to_monitor~
+** Processing line: ~ return unless circle.impacts~
** Processing line: ~ circle.impact = nil~
** Processing line: ~ circle.impacts.each do |i|~
** Processing line: ~ circle.terrains_to_monitor[i[:terrain]] ||= {~
@@ -231457,6 +239480,166 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Rpg Topdown - Topdown Casino - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Rpg Topdown - Topdown Casino - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Rpg Topdown - Topdown Casino - main.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./samples/99_genre_rpg_topdown/topdown_casino/app/main.rb~
+** Processing line: ~ $gtk.reset~
+** Processing line: ~~
+** Processing line: ~ def coinflip~
+** Processing line: ~ rand < 0.5~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ class Game~
+** Processing line: ~ attr_accessor :args~
+** Processing line: ~~
+** Processing line: ~ def text_font~
+** Processing line: ~ return nil #"rpg.ttf"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def text_color~
+** Processing line: ~ [ 255, 255, 255, 255 ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def set_gem_values~
+** Processing line: ~ @args.state.gem0 = ((coinflip) ? 100 : 20)~
+** Processing line: ~ @args.state.gem1 = ((coinflip) ? -10 : -50)~
+** Processing line: ~ @args.state.gem2 = ((coinflip) ? -10 : -30)~
+** Processing line: ~ if coinflip~
+** Processing line: ~ tmp = @args.state.gem0~
+** Processing line: ~ @args.state.gem0 = @args.state.gem1~
+** Processing line: ~ @args.state.gem1 = tmp~
+** Processing line: ~ end~
+** Processing line: ~ if coinflip~
+** Processing line: ~ tmp = @args.state.gem1~
+** Processing line: ~ @args.state.gem1 = @args.state.gem2~
+** Processing line: ~ @args.state.gem2 = tmp~
+** Processing line: ~ end~
+** Processing line: ~ if coinflip~
+** Processing line: ~ tmp = @args.state.gem0~
+** Processing line: ~ @args.state.gem0 = @args.state.gem2~
+** Processing line: ~ @args.state.gem2 = tmp~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def initialize args~
+** Processing line: ~ @args = args~
+** Processing line: ~ @args.state.animticks = 0~
+** Processing line: ~ @args.state.score = 0~
+** Processing line: ~ @args.state.gem_chosen = false~
+** Processing line: ~ @args.state.round_finished = false~
+** Processing line: ~ @args.state.gem0_x = 197~
+** Processing line: ~ @args.state.gem0_y = 720-274~
+** Processing line: ~ @args.state.gem1_x = 623~
+** Processing line: ~ @args.state.gem1_y = 720-274~
+** Processing line: ~ @args.state.gem2_x = 1049~
+** Processing line: ~ @args.state.gem2_y = 720-274~
+** Processing line: ~ @args.state.hero_sprite = "sprites/herodown100.png"~
+** Processing line: ~ @args.state.hero_x = 608~
+** Processing line: ~ @args.state.hero_y = 720-656~
+** Processing line: ~ set_gem_values~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_gem_value x, y, gem~
+** Processing line: ~ if @args.state.gem_chosen~
+** Processing line: ~ @args.outputs.labels << [ x, y + 96, gem.to_s, 1, 1, *text_color, text_font ]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render~
+** Processing line: ~ gemsprite = ((@args.state.animticks % 400) < 200) ? 'sprites/gem200.png' : 'sprites/gem400.png'~
+** Processing line: ~ @args.outputs.background_color = [ 0, 0, 0, 255 ]~
+** Processing line: ~ @args.outputs.sprites << [608, 720-150, 64, 64, 'sprites/oldman.png']~
+** Processing line: ~ @args.outputs.sprites << [300, 720-150, 64, 64, 'sprites/fire.png']~
+** Processing line: ~ @args.outputs.sprites << [900, 720-150, 64, 64, 'sprites/fire.png']~
+** Processing line: ~ @args.outputs.sprites << [@args.state.gem0_x, @args.state.gem0_y, 32, 64, gemsprite]~
+** Processing line: ~ @args.outputs.sprites << [@args.state.gem1_x, @args.state.gem1_y, 32, 64, gemsprite]~
+** Processing line: ~ @args.outputs.sprites << [@args.state.gem2_x, @args.state.gem2_y, 32, 64, gemsprite]~
+** Processing line: ~ @args.outputs.sprites << [@args.state.hero_x, @args.state.hero_y, 64, 64, @args.state.hero_sprite]~
+** Processing line: ~~
+** Processing line: ~ @args.outputs.labels << [ 630, 720-30, "IT'S A SECRET TO EVERYONE.", 1, 1, *text_color, text_font ]~
+** Processing line: ~ @args.outputs.labels << [ 50, 720-85, @args.state.score.to_s, 1, 1, *text_color, text_font ]~
+** Processing line: ~ render_gem_value @args.state.gem0_x, @args.state.gem0_y, @args.state.gem0~
+** Processing line: ~ render_gem_value @args.state.gem1_x, @args.state.gem1_y, @args.state.gem1~
+** Processing line: ~ render_gem_value @args.state.gem2_x, @args.state.gem2_y, @args.state.gem2~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc~
+** Processing line: ~ @args.state.animticks += 16~
+** Processing line: ~~
+** Processing line: ~ return unless @args.state.gem_chosen~
+** Processing line: ~ @args.state.round_finished_debounce ||= 60 * 3~
+** Processing line: ~ @args.state.round_finished_debounce -= 1~
+** Processing line: ~ return if @args.state.round_finished_debounce > 0~
+** Processing line: ~~
+** Processing line: ~ @args.state.gem_chosen = false~
+** Processing line: ~ @args.state.hero.sprite[0] = 'sprites/herodown100.png'~
+** Processing line: ~ @args.state.hero.sprite[1] = 608~
+** Processing line: ~ @args.state.hero.sprite[2] = 656~
+** Processing line: ~ @args.state.round_finished_debounce = nil~
+** Processing line: ~ set_gem_values~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def walk xdir, ydir, anim~
+** Processing line: ~ @args.state.hero_sprite = "sprites/#{anim}#{(((@args.state.animticks % 200) < 100) ? '100' : '200')}.png"~
+** Processing line: ~ @args.state.hero_x += 5 * xdir~
+** Processing line: ~ @args.state.hero_y += 5 * ydir~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def check_gem_touching gem_x, gem_y, gem~
+** Processing line: ~ return if @args.state.gem_chosen~
+** Processing line: ~ herorect = [ @args.state.hero_x, @args.state.hero_y, 64, 64 ]~
+** Processing line: ~ return if !herorect.intersect_rect?([gem_x, gem_y, 32, 64])~
+** Processing line: ~ @args.state.gem_chosen = true~
+** Processing line: ~ @args.state.score += gem~
+** Processing line: ~ @args.outputs.sounds << ((gem < 0) ? 'sounds/lose.wav' : 'sounds/win.wav')~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input~
+** Processing line: ~ if @args.inputs.keyboard.key_held.left~
+** Processing line: ~ walk(-1.0, 0.0, 'heroleft')~
+** Processing line: ~ elsif @args.inputs.keyboard.key_held.right~
+** Processing line: ~ walk(1.0, 0.0, 'heroright')~
+** Processing line: ~ elsif @args.inputs.keyboard.key_held.up~
+** Processing line: ~ walk(0.0, 1.0, 'heroup')~
+** Processing line: ~ elsif @args.inputs.keyboard.key_held.down~
+** Processing line: ~ walk(0.0, -1.0, 'herodown')~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ check_gem_touching(@args.state.gem0_x, @args.state.gem0_y, @args.state.gem0)~
+** Processing line: ~ check_gem_touching(@args.state.gem1_x, @args.state.gem1_y, @args.state.gem1)~
+** Processing line: ~ check_gem_touching(@args.state.gem2_x, @args.state.gem2_y, @args.state.gem2)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick~
+** Processing line: ~ input~
+** Processing line: ~ calc~
+** Processing line: ~ render~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~ args.state.game ||= Game.new args~
+** Processing line: ~ args.state.game.args = args~
+** Processing line: ~ args.state.game.tick~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Rpg Topdown - Topdown Starting Point - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -231586,22 +239769,22 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~*** Teentiny - main.rb~
+** Processing line: ~*** Teenytiny - Teenytiny Starting Point - main.rb~
- H3 detected.
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Teentiny - main.rb~
+- Formatting line: ~Teenytiny - Teenytiny Starting Point - main.rb~
- Line's tilde count is: 0
- Line contains link marker: false
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Teentiny - main.rb~
+- Formatting line: ~Teenytiny - Teenytiny Starting Point - main.rb~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/99_genre_teentiny/app/main.rb~
+** Processing line: ~ # ./samples/99_genre_teenytiny/teenytiny_starting_point/app/main.rb~
** Processing line: ~ # full documenation is at http://docs.dragonruby.org~
** Processing line: ~ # be sure to come to the discord if you hit any snags: http://discord.dragonruby.org~
** Processing line: ~ def tick args~
@@ -231769,22 +239952,22 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~*** Teentiny - license.txt~
+** Processing line: ~*** Teenytiny - Teenytiny Starting Point - license.txt~
- H3 detected.
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Teentiny - license.txt~
+- Formatting line: ~Teenytiny - Teenytiny Starting Point - license.txt~
- Line's tilde count is: 0
- Line contains link marker: false
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Teentiny - license.txt~
+- Formatting line: ~Teenytiny - Teenytiny Starting Point - license.txt~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
** Processing line: ~#+begin_src ruby~
- PRE start detected.
-** Processing line: ~ # ./samples/99_genre_teentiny/license.txt~
+** Processing line: ~ # ./samples/99_genre_teenytiny/teenytiny_starting_point/license.txt~
** Processing line: ~ Copyright 2019 DragonRuby LLC~
** Processing line: ~~
** Processing line: ~ MIT License~
@@ -231819,6 +240002,661 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 0
- Line contains link marker: true
- LINK detected.
+** Processing line: ~*** api.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~api.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~api.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./dragon/api.rb~
+** Processing line: ~ # coding: utf-8~
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
+** Processing line: ~ # MIT License~
+** Processing line: ~ # api.rb has been released under MIT (*only this file*).~
+** Processing line: ~~
+** Processing line: ~ module GTK~
+** Processing line: ~ class Api~
+** Processing line: ~ def initialize~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_autocomplete args, req~
+** Processing line: ~ html = <<-S~
+** Processing line: ~ <html>~
+** Processing line: ~ <head>~
+** Processing line: ~ <meta charset="UTF-8"/>~
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+** Processing line: ~ <style>~
+** Processing line: ~ pre {~
+** Processing line: ~ border: solid 1px silver;~
+** Processing line: ~ padding: 10px;~
+** Processing line: ~ font-size: 14px;~
+** Processing line: ~ white-space: pre-wrap;~
+** Processing line: ~ white-space: -moz-pre-wrap;~
+** Processing line: ~ white-space: -pre-wrap;~
+** Processing line: ~ white-space: -o-pre-wrap;~
+** Processing line: ~ word-wrap: break-word;~
+** Processing line: ~ }~
+** Processing line: ~ </style>~
+** Processing line: ~ </head>~
+** Processing line: ~ <body>~
+** Processing line: ~ <script>~
+** Processing line: ~ async function submitForm() {~
+** Processing line: ~ const result = await fetch("/dragon/autocomplete/", {~
+** Processing line: ~ method: 'POST',~
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+** Processing line: ~ body: JSON.stringify({ index: document.getElementById("index").value,~
+** Processing line: ~ text: document.getElementById("text").value }),~
+** Processing line: ~ });~
+** Processing line: ~ document.getElementById("autocomplete-results").innerHTML = await result.text();~
+** Processing line: ~ }~
+** Processing line: ~ </script>~
+** Processing line: ~ <form>~
+** Processing line: ~ <div>index</div>~
+** Processing line: ~ <input name="index" id="index" type="text" value="27" />~
+** Processing line: ~ <div>code</div>~
+** Processing line: ~ <textarea name="text" id="text" rows="30" cols="80">def tick args~
+** Processing line: ~ args.state.~
+** Processing line: ~ end</textarea>~
+** Processing line: ~ <br/>~
+** Processing line: ~ <input type="button" value="Get Suggestions" onclick="submitForm();" />~
+** Processing line: ~ <span id="success-notification"></span>~
+** Processing line: ~ </form>~
+** Processing line: ~ <pre id="autocomplete-results">~
+** Processing line: ~ </pre>~
+** Processing line: ~~
+** Processing line: ~ #{links}~
+** Processing line: ~ </body>~
+** Processing line: ~ </html>~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ html,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_autocomplete args, req~
+** Processing line: ~ json = ($gtk.parse_json req.body)~
+** Processing line: ~ index = json["index"].to_i~
+** Processing line: ~ text = json["text"]~
+** Processing line: ~ suggestions = args.gtk.suggest_autocompletion index: index, text: text~
+** Processing line: ~ list_as_string = suggestions.join("\n")~
+** Processing line: ~ req.respond 200, list_as_string, { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ define_method :links do~
+** Processing line: ~ <<-S~
+** Processing line: ~ <ul>~
+** Processing line: ~ <li><a href="/">Home</a></li>~
+** Processing line: ~ <li><a href="/docs.html">Docs</a></li>~
+** Processing line: ~ <li><a href="/dragon/control_panel/">Control Panel</a></li>~
+** Processing line: ~ <li><a href="/dragon/eval/">Console</a></li>~
+** Processing line: ~ <li><a href="/dragon/log/">Logs</a></li>~
+** Processing line: ~ <li><a href="/dragon/puts/">Puts</a></li>~
+** Processing line: ~ <li><a href="/dragon/code/">Code</a></li>~
+** Processing line: ~ </ul>~
+** Processing line: ~ S~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_index args, req~
+** Processing line: ~ req.respond 200, <<-S, { 'Content-Type' => 'text/html' }~
+** Processing line: ~ <html>~
+** Processing line: ~ <head>~
+** Processing line: ~ <meta charset="UTF-8"/>~
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+** Processing line: ~ </head>~
+** Processing line: ~ <body>~
+** Processing line: ~ #{links}~
+** Processing line: ~ </body>~
+** Processing line: ~ </html>~
+** Processing line: ~ S~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def source_code_links args~
+** Processing line: ~ links = args.gtk.reload_list_history.keys.map do |f|~
+** Processing line: ~ "<li><a href=\"/dragon/code/edit/?file=#{f}\">#{f}</a></li>"~
+** Processing line: ~ end~
+** Processing line: ~ <<-S~
+** Processing line: ~ <ul>~
+** Processing line: ~ #{links.join("\n")}~
+** Processing line: ~ </ul>~
+** Processing line: ~ S~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_code args, req~
+** Processing line: ~ view = <<-S~
+** Processing line: ~ <html>~
+** Processing line: ~ <head>~
+** Processing line: ~ <meta charset="UTF-8"/>~
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+** Processing line: ~ </head>~
+** Processing line: ~ <body>~
+** Processing line: ~ #{source_code_links args}~
+** Processing line: ~~
+** Processing line: ~ #{links}~
+** Processing line: ~ </body>~
+** Processing line: ~ </html>~
+** Processing line: ~ S~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def code_edit_view args, file~
+** Processing line: ~ view = <<-S~
+** Processing line: ~ <html>~
+** Processing line: ~ <head>~
+** Processing line: ~ <meta charset="UTF-8"/>~
+** Processing line: ~ <title>DragonRuby Game Toolkit Documentation</title>~
+** Processing line: ~ </head>~
+** Processing line: ~ <body>~
+** Processing line: ~ <script>~
+** Processing line: ~ async function submitForm() {~
+** Processing line: ~ const result = await fetch("/dragon/code/update/?file=#{file}", {~
+** Processing line: ~ method: 'POST',~
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+** Processing line: ~ body: JSON.stringify({ code: document.getElementById("code").value }),~
+** Processing line: ~ });~
+** Processing line: ~ document.getElementById("success-notification").innerHTML = "update successful";~
+** Processing line: ~ setTimeout(function() { document.getElementById("success-notification").innerHTML = ""; }, 3000);~
+** Processing line: ~ }~
+** Processing line: ~ </script>~
+** Processing line: ~ <form>~
+** Processing line: ~ <div><code>#{file}:</code></div>~
+** Processing line: ~ <textarea name="code" id="code" rows="30" cols="80">#{args.gtk.read_file file}</textarea>~
+** Processing line: ~ <br/>~
+** Processing line: ~ <input type="button" value="Update" onclick="submitForm();" />~
+** Processing line: ~ <span id="success-notification"></span>~
+** Processing line: ~ </form>~
+** Processing line: ~ #{source_code_links args}~
+** Processing line: ~~
+** Processing line: ~ #{links}~
+** Processing line: ~ </body>~
+** Processing line: ~ </html>~
+** Processing line: ~ S~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_code_edit args, req~
+** Processing line: ~ file = req.uri.split('?').last.gsub("file=", "")~
+** Processing line: ~ view = code_edit_view args, file~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_code_update args, req~
+** Processing line: ~ file = req.uri.split('?').last.gsub("file=", "")~
+** Processing line: ~ code = ($gtk.parse_json req.body)["code"]~
+** Processing line: ~ args.gtk.write_file file, code~
+** Processing line: ~ view = code_edit_view args, file~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_boot args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("tmp/src_backup/boot.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_trace args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("logs/trace.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_log args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("logs/log.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_log args, req~
+** Processing line: ~ Log.log req.body~
+** Processing line: ~~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ "ok",~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_puts args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("logs/puts.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_changes args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("tmp/src_backup/src_backup_changes.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_favicon_ico args, req~
+** Processing line: ~ @favicon ||= args.gtk.read_file('docs/favicon.ico')~
+** Processing line: ~ req.respond 200, @favicon, { "Content-Type" => 'image/x-icon' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_src_backup args, req~
+** Processing line: ~ file_name = req.uri.gsub("/dragon/", "")~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("tmp/src_backup/#{file_name}"),~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_not_found args, req~
+** Processing line: ~ puts("METHOD: #{req.method}");~
+** Processing line: ~ puts("URI: #{req.uri}");~
+** Processing line: ~ puts("HEADERS:");~
+** Processing line: ~ req.headers.each { |k,v| puts(" #{k}: #{v}") }~
+** Processing line: ~ req.respond 404, "not found: #{req.uri}", { }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_docs_html args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("docs/docs.html"),~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_docs_css args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("docs/docs.css"),~
+** Processing line: ~ { 'Content-Type' => 'text/css' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_docs_search_gif args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("docs/docs_search.gif"),~
+** Processing line: ~ { 'Content-Type' => 'image/gif' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_src_backup_index_html args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_index.html"),~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_src_backup_index_txt args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_index.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/txt' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_src_backup_css args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup.css"),~
+** Processing line: ~ { 'Content-Type' => 'text/css' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_src_backup_changes_html args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_changes.html"),~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_src_backup_changes_txt args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ args.gtk.read_file("/tmp/src_backup/src_backup_changes.txt"),~
+** Processing line: ~ { 'Content-Type' => 'text/txt' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_eval args, req~
+** Processing line: ~ eval_view = <<-S~
+** Processing line: ~ <html lang="en">~
+** Processing line: ~ <head><title>Eval</title></head>~
+** Processing line: ~ <style>~
+** Processing line: ~ pre {~
+** Processing line: ~ border: solid 1px silver;~
+** Processing line: ~ padding: 10px;~
+** Processing line: ~ font-size: 14px;~
+** Processing line: ~ white-space: pre-wrap;~
+** Processing line: ~ white-space: -moz-pre-wrap;~
+** Processing line: ~ white-space: -pre-wrap;~
+** Processing line: ~ white-space: -o-pre-wrap;~
+** Processing line: ~ word-wrap: break-word;~
+** Processing line: ~ }~
+** Processing line: ~ </style>~
+** Processing line: ~ <body>~
+** Processing line: ~ <script>~
+** Processing line: ~ async function submitForm() {~
+** Processing line: ~ const result = await fetch("/dragon/eval/", {~
+** Processing line: ~ method: 'POST',~
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+** Processing line: ~ body: JSON.stringify({ code: document.getElementById("code").value }),~
+** Processing line: ~ });~
+** Processing line: ~ document.getElementById("eval-result").innerHTML = await result.text();~
+** Processing line: ~ }~
+** Processing line: ~ </script>~
+** Processing line: ~ <form>~
+** Processing line: ~ <textarea name="code" id="code" rows="10" cols="80"># write your code here and set $result.\n$result = $gtk.args.state</textarea>~
+** Processing line: ~ <br/>~
+** Processing line: ~ <input type="button" onclick="submitForm();" value="submit" />~
+** Processing line: ~ </form>~
+** Processing line: ~ <pre>curl -H "Content-Type: application/json" --data '{ "code": "$result = $args.state" }' -X POST http://localhost:9001/dragon/eval/</pre>~
+** Processing line: ~ <div>Eval Result:</div>~
+** Processing line: ~ <pre id="eval-result"></pre>~
+** Processing line: ~ #{links}~
+** Processing line: ~ </body>~
+** Processing line: ~ </html>~
+** Processing line: ~ S~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ eval_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_eval args, req~
+** Processing line: ~ if json? req~
+** Processing line: ~ code = ($gtk.parse_json req.body)["code"]~
+** Processing line: ~ code = code.gsub("$result", "$eval_result")~
+** Processing line: ~ Object.new.instance_eval do~
+** Processing line: ~ begin~
+** Processing line: ~ Kernel.eval code~
+** Processing line: ~ rescue Exception => e~
+** Processing line: ~ $eval_result = e~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ "#{$eval_result || $eval_results || "nil"}",~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~~
+** Processing line: ~ $eval_result = nil~
+** Processing line: ~ $eval_results = nil~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def api_css_string~
+** Processing line: ~~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_console args, req~
+** Processing line: ~ html = console_view "# write your code here and set $result.\n$result = $gtk.args.state"~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ html,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def control_panel_view~
+** Processing line: ~ <<-S~
+** Processing line: ~ <html lang="en">~
+** Processing line: ~ <head><title>console</title></head>~
+** Processing line: ~ <body>~
+** Processing line: ~ <script>~
+** Processing line: ~ async function submitForm(url) {~
+** Processing line: ~ const result = await fetch(url, {~
+** Processing line: ~ method: 'POST',~
+** Processing line: ~ headers: { 'Content-Type': 'application/json' },~
+** Processing line: ~ body: JSON.stringify({}),~
+** Processing line: ~ });~
+** Processing line: ~ document.getElementById("success-notification").innerHTML = "successful";~
+** Processing line: ~ setTimeout(function() { document.getElementById("success-notification").innerHTML = ""; }, 3000);~
+** Processing line: ~ }~
+** Processing line: ~ </script>~
+** Processing line: ~ <form>~
+** Processing line: ~ <input type="button" value="Show Console" onclick="submitForm('/dragon/show_console/')" />~
+** Processing line: ~ </form>~
+** Processing line: ~ <form>~
+** Processing line: ~ <input type="button" value="Reset Game" onclick="submitForm('/dragon/reset/');" />~
+** Processing line: ~ </form>~
+** Processing line: ~ <form>~
+** Processing line: ~ <input type="button" value="Record Gameplay" onclick="submitForm('/dragon/record/');" />~
+** Processing line: ~ </form>~
+** Processing line: ~ <form>~
+** Processing line: ~ <input type="button" value="Stop Recording" onclick="submitForm('/dragon/record_stop/');" />~
+** Processing line: ~ </form>~
+** Processing line: ~ <form>~
+** Processing line: ~ <input type="button" value="Replay Recording" onclick="submitForm('/dragon/replay/');" />~
+** Processing line: ~ </form>~
+** Processing line: ~ <div id="success-notification"></div>~
+** Processing line: ~ #{links}~
+** Processing line: ~ </body>~
+** Processing line: ~ </html>~
+** Processing line: ~ S~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_api_control_panel args, req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ control_panel_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def json? req~
+** Processing line: ~ req.headers.find { |k, v| k == "Content-Type" && (v.include? "application/json") }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_reset args, req~
+** Processing line: ~ $gtk.reset if json? req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ control_panel_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_record args, req~
+** Processing line: ~ $recording.start 100 if json? req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ control_panel_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_record_stop args, req~
+** Processing line: ~ $recording.stop 'replay.txt' if json? req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ control_panel_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_replay args, req~
+** Processing line: ~ $replay.start 'replay.txt' if json? req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ control_panel_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def post_api_show_console args, req~
+** Processing line: ~ $gtk.console.show if json? req~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ control_panel_view,~
+** Processing line: ~ { 'Content-Type' => 'text/html' }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~ args.inputs.http_requests.each do |req|~
+** Processing line: ~ match_candidate = { method: req.method.downcase.to_sym,~
+** Processing line: ~ uri: req.uri,~
+** Processing line: ~ uri_without_query_string: (req.uri.split '?').first,~
+** Processing line: ~ query_string: (req.uri.split '?').last,~
+** Processing line: ~ has_query_string: !!(req.uri.split '?').last,~
+** Processing line: ~ has_api_prefix: (req.uri.start_with? "/dragon"),~
+** Processing line: ~ end_with_rb: (req.uri.end_with? ".rb"),~
+** Processing line: ~ has_file_extension: file_extensions.find { |f| req.uri.include? f },~
+** Processing line: ~ has_trailing_slash: (req.uri.split('?').first.end_with? "/") }~
+** Processing line: ~~
+** Processing line: ~ if !match_candidate[:has_file_extension]~
+** Processing line: ~ if !match_candidate[:has_trailing_slash]~
+** Processing line: ~ match_candidate[:uri] = match_candidate[:uri_without_query_string] + "/"~
+** Processing line: ~ if match_candidate[:query_string]~
+** Processing line: ~ match_candidate[:uri] += "?#{match_candidate[:query_string]}"~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ context = { args: args, req: req, match_candidate: match_candidate }~
+** Processing line: ~~
+** Processing line: ~ process! context: context, routes: routes~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def url_decode args, string~
+** Processing line: ~ args.fn.gsub string,~
+** Processing line: ~ '+', " ",~
+** Processing line: ~ '%27', "'",~
+** Processing line: ~ '%22', '"',~
+** Processing line: ~ '%0D%0A', "\n",~
+** Processing line: ~ '%3D', "=",~
+** Processing line: ~ '%3B', ";",~
+** Processing line: ~ '%7C', "|",~
+** Processing line: ~ '%28', "(",~
+** Processing line: ~ '%29', ")",~
+** Processing line: ~ '%7B', "{",~
+** Processing line: ~ '%7D', "}",~
+** Processing line: ~ '%2C', ",",~
+** Processing line: ~ '%3A', ":",~
+** Processing line: ~ '%5B', "[",~
+** Processing line: ~ '%5D', "]",~
+** Processing line: ~ '%23', "#",~
+** Processing line: ~ '%21', "!",~
+** Processing line: ~ '%3C', "<",~
+** Processing line: ~ '%3E', ">",~
+** Processing line: ~ '%2B', "+",~
+** Processing line: ~ '%2F', "/",~
+** Processing line: ~ '%40', "@",~
+** Processing line: ~ '%3F', "?",~
+** Processing line: ~ '%26', "&",~
+** Processing line: ~ '%24', "$",~
+** Processing line: ~ '%5C', "\\",~
+** Processing line: ~ '%60', "`",~
+** Processing line: ~ '%7E', "~",~
+** Processing line: ~ '%C2%B2', "²",~
+** Processing line: ~ '%5E', "^",~
+** Processing line: ~ '%C2%BA', "º",~
+** Processing line: ~ '%C2%A7', "§",~
+** Processing line: ~ '%20', " ",~
+** Processing line: ~ '%0A', "\n",~
+** Processing line: ~ '%25', "%",~
+** Processing line: ~ '%2A', "*"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def file_extensions~
+** Processing line: ~ [".html", ".css", ".gif", ".txt", ".ico", ".rb"]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def routes~
+** Processing line: ~ [{ match_criteria: { method: :get, uri: "/" },~
+** Processing line: ~ handler: :get_index },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/" },~
+** Processing line: ~ handler: :get_index },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/boot/" },~
+** Processing line: ~ handler: :get_api_boot },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/trace/" },~
+** Processing line: ~ handler: :get_api_trace },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/puts/" },~
+** Processing line: ~ handler: :get_api_puts },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/log/" },~
+** Processing line: ~ handler: :get_api_log },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/log/" },~
+** Processing line: ~ handler: :post_api_log },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/changes/" },~
+** Processing line: ~ handler: :get_api_changes },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/eval/" },~
+** Processing line: ~ handler: :get_api_eval },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/eval/" },~
+** Processing line: ~ handler: :post_api_eval },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/console/" },~
+** Processing line: ~ handler: :get_api_console },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/console/" },~
+** Processing line: ~ handler: :post_api_console },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/control_panel/" },~
+** Processing line: ~ handler: :get_api_control_panel },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/reset/" },~
+** Processing line: ~ handler: :post_api_reset },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/record/" },~
+** Processing line: ~ handler: :post_api_record },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/record_stop/" },~
+** Processing line: ~ handler: :post_api_record_stop },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/replay/" },~
+** Processing line: ~ handler: :post_api_replay },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/show_console/" },~
+** Processing line: ~ handler: :post_api_show_console },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/code/" },~
+** Processing line: ~ handler: :get_api_code },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/dragon/autocomplete/" },~
+** Processing line: ~ handler: :get_api_autocomplete },~
+** Processing line: ~ { match_criteria: { method: :post, uri: "/dragon/autocomplete/" },~
+** Processing line: ~ handler: :post_api_autocomplete },~
+** Processing line: ~ { match_criteria: { method: :get, uri_without_query_string: "/dragon/code/edit/", has_query_string: true },~
+** Processing line: ~ handler: :get_api_code_edit },~
+** Processing line: ~ { match_criteria: { method: :post, uri_without_query_string: "/dragon/code/update/", has_query_string: true },~
+** Processing line: ~ handler: :post_api_code_update },~
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/docs.html" },~
+** Processing line: ~ handler: :get_docs_html },~
+** Processing line: ~ { match_criteria: { method: :get, uri_without_query_string: "/docs.css" },~
+** Processing line: ~ handler: :get_docs_css },~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/docs_search.gif" },~
+** Processing line: ~ handler: :get_docs_search_gif },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_index.html" },~
+** Processing line: ~ handler: :get_src_backup_index_html },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_index.txt" },~
+** Processing line: ~ handler: :get_src_backup_index_txt },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_changes.html" },~
+** Processing line: ~ handler: :get_src_backup_changes_html },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup_changes.txt" },~
+** Processing line: ~ handler: :get_src_backup_changes_txt },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/src_backup.css" },~
+** Processing line: ~ handler: :get_src_backup_css },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, uri: "/favicon.ico" },~
+** Processing line: ~ handler: :get_favicon_ico },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, end_with_rb: true },~
+** Processing line: ~ handler: :get_src_backup },~
+** Processing line: ~~
+** Processing line: ~ { match_criteria: { method: :get, end_with_rb: true },~
+** Processing line: ~ handler: :get_src_backup }~
+** Processing line: ~~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def process! opts~
+** Processing line: ~ routes = opts[:routes]~
+** Processing line: ~ context = opts[:context]~
+** Processing line: ~ routes.each do |route|~
+** Processing line: ~ match_found = (process_single! route: route, context: context)~
+** Processing line: ~ return if match_found~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def process_single! opts~
+** Processing line: ~ match_criteria = opts[:route][:match_criteria]~
+** Processing line: ~ m = opts[:route][:handler]~
+** Processing line: ~ args = opts[:context][:args]~
+** Processing line: ~ req = opts[:context][:req]~
+** Processing line: ~ match_candidate = opts[:context][:match_candidate]~
+** Processing line: ~ match_criteria.each do |k, v|~
+** Processing line: ~ return false if match_candidate[k] != v~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin~
+** Processing line: ~ send m, args, req~
+** Processing line: ~ rescue Exception => e~
+** Processing line: ~ req.respond 200,~
+** Processing line: ~ "#{e}\n#{e.__backtrace_to_org__}",~
+** Processing line: ~ { 'Content-Type' => 'text/plain' }~
+** Processing line: ~ end~
+** Processing line: ~ return true~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** args.rb~
- H3 detected.
- Determining if line is a header.
@@ -231847,6 +240685,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ class Args~
** Processing line: ~ include ArgsDeprecated~
** Processing line: ~ include Serialize~
+** Processing line: ~ attr_accessor :cvars~
** Processing line: ~ attr_accessor :inputs~
** Processing line: ~ attr_accessor :outputs~
** Processing line: ~ attr_accessor :audio~
@@ -231867,6 +240706,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def initialize runtime, recording~
** Processing line: ~ @inputs = Inputs.new~
** Processing line: ~ @outputs = Outputs.new args: self~
+** Processing line: ~ @cvars = {}~
** Processing line: ~ @audio = {}~
** Processing line: ~ @passes = []~
** Processing line: ~ @state = OpenEntity.new~
@@ -232409,14 +241249,17 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ class Console~
** Processing line: ~ include ConsoleDeprecated~
** Processing line: ~~
-** Processing line: ~ attr_accessor :show_reason, :log, :logo, :background_color,~
-** Processing line: ~ :text_color, :animation_duration,~
+** Processing line: ~ attr_accessor :show_reason, :log, :logo,~
+** Processing line: ~ :animation_duration,~
** Processing line: ~ :max_log_lines, :max_history, :log,~
-** Processing line: ~ :last_command_errored, :last_command, :error_color, :shown_at,~
-** Processing line: ~ :header_color, :archived_log, :last_log_lines, :last_log_lines_count,~
+** Processing line: ~ :last_command_errored, :last_command, :shown_at,~
+** Processing line: ~ :archived_log, :last_log_lines, :last_log_lines_count,~
** Processing line: ~ :suppress_left_arrow_behavior, :command_set_at,~
** Processing line: ~ :toast_ids, :bottom,~
-** Processing line: ~ :font_style, :menu~
+** Processing line: ~ :font_style, :menu,~
+** Processing line: ~ :background_color, :spam_color, :text_color, :warn_color,~
+** Processing line: ~ :error_color, :header_color, :code_color, :comment_color,~
+** Processing line: ~ :debug_color, :unfiltered_color~
** Processing line: ~~
** Processing line: ~ def initialize~
** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)~
@@ -232434,15 +241277,22 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @command_history_index = -1~
** Processing line: ~ @nonhistory_input = ''~
** Processing line: ~ @logo = 'console-logo.png'~
-** Processing line: ~ @history_fname = 'console_history.txt'~
+** Processing line: ~ @history_fname = 'logs/console_history.txt'~
** Processing line: ~ @background_color = Color.new [0, 0, 0, 224]~
-** Processing line: ~ @text_color = Color.new [255, 255, 255]~
-** Processing line: ~ @error_color = Color.new [200, 50, 50]~
** Processing line: ~ @header_color = Color.new [100, 200, 220]~
** Processing line: ~ @code_color = Color.new [210, 168, 255]~
-** Processing line: ~ @comment_color = Color.new [0, 200, 100]~
+** Processing line: ~ @comment_color = Color.new [0, 200, 100]~
** Processing line: ~ @animation_duration = 1.seconds~
** Processing line: ~ @shown_at = -1~
+** Processing line: ~~
+** Processing line: ~ # these are the colors for text at various log levels.~
+** Processing line: ~ @spam_color = Color.new [160, 160, 160]~
+** Processing line: ~ @debug_color = Color.new [0, 255, 0]~
+** Processing line: ~ @text_color = Color.new [255, 255, 255]~
+** Processing line: ~ @warn_color = Color.new [255, 255, 0]~
+** Processing line: ~ @error_color = Color.new [200, 50, 50]~
+** Processing line: ~ @unfiltered_color = Color.new [0, 255, 255]~
+** Processing line: ~~
** Processing line: ~ load_history~
** Processing line: ~ end~
** Processing line: ~~
@@ -232508,7 +241358,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ nil~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def add_text obj~
+** Processing line: ~ def add_text obj, loglevel=-1~
+** Processing line: ~ # loglevel is one of the values of LogLevel in logging.h, or -1 to say "we don't care, colorize it with your special string parsing magic"~
+** Processing line: ~ loglevel = -1 if loglevel < 0~
+** Processing line: ~ loglevel = 5 if loglevel > 5 # 5 == unfiltered (it's 0x7FFFFFFE in C, clamp it down)~
+** Processing line: ~ loglevel = 2 if (loglevel == -1) && obj.start_with?('!c!') # oh well~
+** Processing line: ~ colorstr = (loglevel != -1) ? "!c!#{loglevel}" : nil~
+** Processing line: ~~
** Processing line: ~ @last_log_lines_count ||= 1~
** Processing line: ~ @log_invocation_count += 1~
** Processing line: ~~
@@ -232517,12 +241373,18 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ log_lines = []~
** Processing line: ~~
** Processing line: ~ str.each_line do |s|~
-** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~
-** Processing line: ~ log_lines << l~
+** Processing line: ~ if colorstr.nil?~
+** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~
+** Processing line: ~ log_lines << l~
+** Processing line: ~ end~
+** Processing line: ~ else~
+** Processing line: ~ s.wrapped_lines(self.console_text_width).each do |l|~
+** Processing line: ~ log_lines << "#{colorstr}#{l}"~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ if log_lines == @last_log_lines~
+** Processing line: ~ if log_lines == @last_log_lines && log_lines.length != 0~
** Processing line: ~ @last_log_lines_count += 1~
** Processing line: ~ new_log_line_with_count = @last_log_lines.last + " (#{@last_log_lines_count})"~
** Processing line: ~ if log_lines.length > 1~
@@ -232797,10 +241659,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def mouse_wheel_scroll args~
** Processing line: ~ @inertia ||= 0~
** Processing line: ~~
-** Processing line: ~ if args.inputs.mouse.wheel && args.inputs.mouse.wheel.y > 0~
-** Processing line: ~ @inertia = 1~
-** Processing line: ~ elsif args.inputs.mouse.wheel && args.inputs.mouse.wheel.y < 0~
-** Processing line: ~ @inertia = -1~
+** Processing line: ~ if args.inputs.mouse.wheel~
+** Processing line: ~ if args.inputs.mouse.wheel.y > 0~
+** Processing line: ~ @inertia = 1~
+** Processing line: ~ elsif args.inputs.mouse.wheel.y < 0~
+** Processing line: ~ @inertia = -1~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if args.inputs.mouse.click~
@@ -232809,13 +241673,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ return if @inertia == 0~
** Processing line: ~~
-** Processing line: ~ if @inertia != 0~
-** Processing line: ~ @inertia = (@inertia * 0.7)~
-** Processing line: ~ if @inertia > 0~
-** Processing line: ~ @log_offset -= 1~
-** Processing line: ~ elsif @inertia < 0~
-** Processing line: ~ @log_offset += 1~
-** Processing line: ~ end~
+** Processing line: ~ @inertia = (@inertia * 0.7)~
+** Processing line: ~ if @inertia > 0~
+** Processing line: ~ @log_offset += 1~
+** Processing line: ~ elsif @inertia < 0~
+** Processing line: ~ @log_offset -= 1~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if @inertia.abs < 0.01~
@@ -232931,7 +241793,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def write_line(args, left, y, str, archived: false)~
** Processing line: ~ color = color_for_log_entry(str)~
** Processing line: ~ color = color.mult_alpha(0.5) if archived~
-** Processing line: ~~
+** Processing line: ~ str = str[4..-1] if str.start_with?('!c!') # chop off loglevel color~
** Processing line: ~ args.outputs.reserved << font_style.label(x: left.shift_right(10), y: y, text: str, color: color)~
** Processing line: ~ end~
** Processing line: ~~
@@ -233167,7 +242029,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ return false~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def color_for_log_entry(log_entry)~
+** Processing line: ~ def color_for_plain_text log_entry~
+** Processing line: ~ log_entry = log_entry[4..-1] if log_entry.start_with? "!c!"~
+** Processing line: ~~
** Processing line: ~ if code? log_entry~
** Processing line: ~ @code_color~
** Processing line: ~ elsif code_comment? log_entry~
@@ -233187,6 +242051,29 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def color_for_log_entry(log_entry)~
+** Processing line: ~ if log_entry.start_with?('!c!') # loglevel color specified.~
+** Processing line: ~ return case log_entry[3..3].to_i~
+** Processing line: ~ when 0 # spam~
+** Processing line: ~ @spam_color~
+** Processing line: ~ when 1 # debug~
+** Processing line: ~ @debug_color~
+** Processing line: ~ #when 2 # info (caught by the `else` block.)~
+** Processing line: ~ # @text_color~
+** Processing line: ~ when 3 # warn~
+** Processing line: ~ @warn_color~
+** Processing line: ~ when 4 # error~
+** Processing line: ~ @error_color~
+** Processing line: ~ when 5 # unfiltered~
+** Processing line: ~ @unfiltered_color~
+** Processing line: ~ else~
+** Processing line: ~ color_for_plain_text log_entry~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ return color_for_plain_text log_entry~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def prompt~
** Processing line: ~ @prompt ||= Prompt.new(font_style: font_style, text_color: @text_color, console_text_width: console_text_width)~
** Processing line: ~ end~
@@ -233698,11 +242585,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ # partition the original list of items into a string to be printed~
** Processing line: ~ items.each_slice(columns).each_with_index do |cells, i|~
-** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~
+** Processing line: ~ pretty_print_row_separator string_width, cell_width, column_width, columns~
** Processing line: ~ pretty_print_row cells, string_width, cell_width, column_width, columns~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ pretty_print_row_seperator string_width, cell_width, column_width, columns~
+** Processing line: ~ pretty_print_row_separator string_width, cell_width, column_width, columns~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -234614,8 +243501,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ ease_extended start_tick,~
** Processing line: ~ current_tick,~
** Processing line: ~ start_tick + duration,~
-** Processing line: ~ (initial_value *definitions),~
-** Processing line: ~ (final_value *definitions),~
+** Processing line: ~ initial_value(*definitions),~
+** Processing line: ~ final_value(*definitions),~
** Processing line: ~ *definitions~
** Processing line: ~ end~
** Processing line: ~~
@@ -234840,8 +243727,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ module GTK~
** Processing line: ~ module Geometry~
** Processing line: ~ def self.rotate_point point, angle, around = nil~
-** Processing line: ~ s = Math.sin a.to_radians~
-** Processing line: ~ c = Math.cos a.to_radians~
+** Processing line: ~ s = Math.sin angle.to_radians~
+** Processing line: ~ c = Math.cos angle.to_radians~
** Processing line: ~ px = point.x~
** Processing line: ~ py = point.y~
** Processing line: ~ cx = 0~
@@ -235022,8 +243909,16 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
-** Processing line: ~ def self.line_y_intercept line~
-** Processing line: ~ line.y - line_slope(line) * line.x~
+** Processing line: ~ def self.line_y_intercept line, replace_infinity: nil~
+** Processing line: ~ line.y - line_slope(line, replace_infinity: replace_infinity) * line.x~
+** Processing line: ~ rescue Exception => e~
+** Processing line: ~ raise <<-S~
+** Processing line: ~ * ERROR: ~Geometry::line_y_intercept~~
+** Processing line: ~ The following exception was thrown for line: #{line}~
+** Processing line: ~ #{e}~
+** Processing line: ~~
+** Processing line: ~ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.~
+** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
@@ -235099,14 +243994,22 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
-** Processing line: ~ def self.line_intersect line_one, line_two~
-** Processing line: ~ m1 = line_slope(line_one)~
-** Processing line: ~ m2 = line_slope(line_two)~
-** Processing line: ~ b1 = line_y_intercept(line_one)~
-** Processing line: ~ b2 = line_y_intercept(line_two)~
+** Processing line: ~ def self.line_intersect line_one, line_two, replace_infinity: nil~
+** Processing line: ~ m1 = line_slope(line_one, replace_infinity: replace_infinity)~
+** Processing line: ~ m2 = line_slope(line_two, replace_infinity: replace_infinity)~
+** Processing line: ~ b1 = line_y_intercept(line_one, replace_infinity: replace_infinity)~
+** Processing line: ~ b2 = line_y_intercept(line_two, replace_infinity: replace_infinity)~
** Processing line: ~ x = (b1 - b2) / (m2 - m1)~
** Processing line: ~ y = (-b2.fdiv(m2) + b1.fdiv(m1)).fdiv(1.fdiv(m1) - 1.fdiv(m2))~
** Processing line: ~ [x, y]~
+** Processing line: ~ rescue Exception => e~
+** Processing line: ~ raise <<-S~
+** Processing line: ~ * ERROR: ~Geometry::line_intersect~~
+** Processing line: ~ The following exception was thrown for line_one: #{line_one}, line_two: #{line_two}~
+** Processing line: ~ #{e}~
+** Processing line: ~~
+** Processing line: ~ Consider passing in ~replace_infinity: VALUE~ to handle for vertical lines.~
+** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def self.contract_intersect_rect?~
@@ -235821,7 +244724,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ value = Kernel.tick_count if value~
** Processing line: ~~
** Processing line: ~ collection.each do |m|~
-** Processing line: ~ self.instance_variable_set("@#{m.to_s}".to_sym, value)~
+** Processing line: ~ m_to_s = m.to_s~
+** Processing line: ~ self.instance_variable_set("@#{m_to_s}".to_sym, value) if m_to_s.strip.length > 0~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise e, <<-S~
** Processing line: ~ * ERROR:~
@@ -236380,6 +245284,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ :check_for_dev_profile,~
** Processing line: ~~
** Processing line: ~ *app_metadata_retrieval_steps,~
+** Processing line: ~ :determine_devcert,~
** Processing line: ~~
** Processing line: ~ :clear_tmp_directory,~
** Processing line: ~ :stage_app,~
@@ -236408,6 +245313,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ :determine_app_version,~
** Processing line: ~~
** Processing line: ~ *app_metadata_retrieval_steps,~
+** Processing line: ~ :determine_prodcert,~
** Processing line: ~~
** Processing line: ~ :clear_tmp_directory,~
** Processing line: ~ :stage_app,~
@@ -236602,6 +245508,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ appid=~
** Processing line: ~ # appname is the name you want to show up underneath the app icon on the device. Keep it under 10 characters.~
** Processing line: ~ appname=~
+** Processing line: ~ # devcert is the certificate to use for development/deploying to your local device~
+** Processing line: ~ devcert=~
+** Processing line: ~ # prodcert is the certificate to use for distribution to the app store~
+** Processing line: ~ prodcert=~
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
@@ -236637,7 +245547,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def raise_ios_metadata_required~
** Processing line: ~ raise WizardException.new(~
** Processing line: ~ "* mygame/metadata/ios_metadata.txt needs to be filled out.",~
-** Processing line: ~ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, and appid.",~
+** Processing line: ~ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, appid, devcert, and prodcert.",~
** Processing line: ~ "Instructions for where the values should come from are within metadata/ios_metadata.txt."~
** Processing line: ~ )~
** Processing line: ~ end~
@@ -236677,7 +245587,19 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def determine_app_id~
** Processing line: ~ @app_id = ios_metadata.appid~
** Processing line: ~ raise_ios_metadata_required if @app_id.strip.length == 0~
-** Processing line: ~ log_info "App Identifier is set to : #{@app_id}"~
+** Processing line: ~ log_info "App Identifier is set to: #{@app_id}"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def determine_devcert~
+** Processing line: ~ @certificate_name = ios_metadata.devcert~
+** Processing line: ~ raise_ios_metadata_required if @certificate_name.strip.length == 0~
+** Processing line: ~ log_info "Dev Certificate is set to: #{@certificate_name}"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def determine_prodcert~
+** Processing line: ~ @certificate_name = ios_metadata.prodcert~
+** Processing line: ~ raise_ios_metadata_required if @certificate_name.strip.length == 0~
+** Processing line: ~ log_info "Production (Distribution) Certificate is set to: #{@certificate_name}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def set_app_name name~
@@ -236699,12 +245621,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ sh "rm -rf #{tmp_directory}"~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def stage_app~
-** Processing line: ~ log_info "Staging."~
-** Processing line: ~ sh "mkdir -p #{tmp_directory}"~
-** Processing line: ~ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def set_app_id id~
** Processing line: ~ log_info = "App Id set to: #{id}"~
** Processing line: ~ @app_id = id~
@@ -236735,34 +245651,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def check_for_certs~
** Processing line: ~ log_info "Attempting to find certificates on your computer."~
** Processing line: ~~
-** Processing line: ~ if !cli_app_exist?(security_cli_app)~
-** Processing line: ~ raise WizardException.new(~
-** Processing line: ~ "* It doesn't look like you have #{security_cli_app}.",~
-** Processing line: ~ "** 1. Open Disk Utility and run First Aid.",~
-** Processing line: ~ { w: 700, h: 148, path: get_reserved_sprite("disk-utility.png") },~
-** Processing line: ~ )~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if valid_certs.length == 0~
-** Processing line: ~ raise WizardException.new(~
-** Processing line: ~ "* It doesn't look like you have any valid certs installed.",~
-** Processing line: ~ "** 1. Open Xcode.",~
-** Processing line: ~ "** 2. Log into your developer account. Xcode -> Preferences -> Accounts.",~
-** Processing line: ~ { w: 700, h: 98, path: get_reserved_sprite("login-xcode.png") },~
-** Processing line: ~ "** 3. After loggin in, select Manage Certificates...",~
-** Processing line: ~ { w: 700, h: 115, path: get_reserved_sprite("manage-certificates.png") },~
-** Processing line: ~ "** 4. Add a certificate for Apple Development.",~
-** Processing line: ~ { w: 700, h: 217, path: get_reserved_sprite("add-cert.png") },~
-** Processing line: ~ )~
-** Processing line: ~ raise "You do not have any Apple development certs on this computer."~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ if @production_build~
-** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Distribution" }.first[:name]~
+** Processing line: ~ @certificate_name = ios_metadata[:prodcert]~
** Processing line: ~ else~
-** Processing line: ~ @certificate_name = valid_certs.find_all { |f| f[:name].include? "Development" }.first[:name]~
+** Processing line: ~ @certificate_name = ios_metadata[:devcert]~
** Processing line: ~ end~
-** Processing line: ~ log_info "I will be using Certificate: '#{@certificate_name}'."~
+** Processing line: ~~
+** Processing line: ~ log_info "I will be using certificate: '#{@certificate_name}'."~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def idevice_id_cli_app~
@@ -236777,24 +245672,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ "xcodebuild"~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def valid_certs~
-** Processing line: ~ certs = sh("#{security_cli_app} -q find-identity -p codesigning -v").each_line.map do |l|~
-** Processing line: ~ if l.include?(")") && !l.include?("Developer ID") && (l.include?("Development") || l.include?("Distribution"))~
-** Processing line: ~ l.strip~
-** Processing line: ~ else~
-** Processing line: ~ nil~
-** Processing line: ~ end~
-** Processing line: ~ end.reject_nil.map do |l|~
-** Processing line: ~ number, id, name = l.split(' ', 3)~
-** Processing line: ~ name = name.gsub("\"", "") if name~
-** Processing line: ~ {~
-** Processing line: ~ number: 1,~
-** Processing line: ~ id: id,~
-** Processing line: ~ name: name~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def connected_devices~
** Processing line: ~ sh("idevice_id -l").strip.each_line.map do |l|~
** Processing line: ~ l.strip~
@@ -237324,6 +246201,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def stage_app~
+** Processing line: ~ log_info "Staging."~
+** Processing line: ~ sh "mkdir -p #{tmp_directory}"~
+** Processing line: ~ sh "cp -R #{relative_path}/dragonruby-ios.app \"#{tmp_directory}/#{@app_name}.app\""~
** Processing line: ~ sh %Q[cp -r "#{root_folder}/app/" "#{app_path}/app/"]~
** Processing line: ~ sh %Q[cp -r "#{root_folder}/sounds/" "#{app_path}/sounds/"]~
** Processing line: ~ sh %Q[cp -r "#{root_folder}/sprites/" "#{app_path}/sprites/"]~
@@ -239236,26 +248116,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ (0..self).to_a~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def >= other~
-** Processing line: ~ return false if !other~
-** Processing line: ~ return gte other~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def > other~
-** Processing line: ~ return false if !other~
-** Processing line: ~ return gt other~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def <= other~
-** Processing line: ~ return false if !other~
-** Processing line: ~ return lte other~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def < other~
-** Processing line: ~ return false if !other~
-** Processing line: ~ return gt other~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def map~
** Processing line: ~ unless block_given?~
@@ -239341,34 +248201,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def - other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self - other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def + other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self + other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def * other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self * other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def / other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self / other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def serialize~
** Processing line: ~ self~
** Processing line: ~ end~
@@ -239423,34 +248255,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ return !even?~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def + other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self + other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def * other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self * other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def / other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self / other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def - other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ self - other~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ # Returns `-1` if the number is less than `0`. `+1` if the number~
** Processing line: ~ # is greater than `0`. Returns `0` if the number is equal to `0`.~
** Processing line: ~ #~
@@ -239506,34 +248310,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ alias_method :__original_multiply__, :* unless Float.instance_methods.include? :__original_multiply__~
** Processing line: ~ alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__~
** Processing line: ~~
-** Processing line: ~ def - other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ super~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :-, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def + other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ super~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :+, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def * other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ super~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :*, e~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def / other~
-** Processing line: ~ return self unless other~
-** Processing line: ~ super~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def serialize~
** Processing line: ~ self~
** Processing line: ~ end~
@@ -239585,6 +248361,287 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** recording.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~recording.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~recording.rb~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src ruby~
+- PRE start detected.
+** Processing line: ~ # ./dragon/recording.rb~
+** Processing line: ~ # coding: utf-8~
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
+** Processing line: ~ # MIT License~
+** Processing line: ~ # recording.rb has been released under MIT (*only this file*).~
+** Processing line: ~~
+** Processing line: ~ module GTK~
+** Processing line: ~ # FIXME: Gross~
+** Processing line: ~ # @gtk~
+** Processing line: ~ class Replay~
+** Processing line: ~ # @gtk~
+** Processing line: ~ def self.start file_name = nil~
+** Processing line: ~ $recording.start_replay file_name~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # @gtk~
+** Processing line: ~ def self.stop~
+** Processing line: ~ $recording.stop_replay~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # @gtk~
+** Processing line: ~ class Recording~
+** Processing line: ~ def initialize runtime~
+** Processing line: ~ @runtime = runtime~
+** Processing line: ~ @tick_count = 0~
+** Processing line: ~ @global_input_order = 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick~
+** Processing line: ~ @tick_count += 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def start_recording seed_number = nil~
+** Processing line: ~ if !seed_number~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * ERROR:~
+** Processing line: ~ To start recording, you must provide an integer value to~
+** Processing line: ~ seed random number generation.~
+** Processing line: ~ S~
+** Processing line: ~ $console.set_command "$recording.start SEED_NUMBER"~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if @is_recording~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * ERROR:~
+** Processing line: ~ You are already recording, first cancel (or stop) the current recording.~
+** Processing line: ~ S~
+** Processing line: ~ $console.set_command "$recording.cancel"~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if @is_replaying~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * ERROR:~
+** Processing line: ~ You are currently replaying a recording, first stop the replay.~
+** Processing line: ~ S~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ log_info <<-S~
+** Processing line: ~ Recording has begun with RNG seed value set to #{seed_number}.~
+** Processing line: ~ To stop recording use stop_recording(filename).~
+** Processing line: ~ The recording will stop without saving a file if a filename is nil.~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ $console.set_command "$recording.stop 'replay.txt'"~
+** Processing line: ~ @runtime.__reset__~
+** Processing line: ~ @seed_number = seed_number~
+** Processing line: ~ @runtime.set_rng seed_number~
+** Processing line: ~~
+** Processing line: ~ @tick_count = 0~
+** Processing line: ~ @global_input_order = 1~
+** Processing line: ~ @is_recording = true~
+** Processing line: ~ @input_history = []~
+** Processing line: ~ @runtime.notify! "Recording started. When completed, open the console to save it using $recording.stop FILE_NAME (or cancel).", 300~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # @gtk~
+** Processing line: ~ def start seed_number = nil~
+** Processing line: ~ start_recording seed_number~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def is_replaying?~
+** Processing line: ~ @is_replaying~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def is_recording?~
+** Processing line: ~ @is_recording~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # @gtk~
+** Processing line: ~ def stop file_name = nil~
+** Processing line: ~ stop_recording file_name~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # @gtk~
+** Processing line: ~ def cancel~
+** Processing line: ~ stop_recording_core~
+** Processing line: ~ @runtime.notify! "Recording cancelled."~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def stop_recording file_name = nil~
+** Processing line: ~ if !file_name~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * ERROR:~
+** Processing line: ~ To please specify a file name when calling:~
+** Processing line: ~ $recording.stop FILE_NAME~
+** Processing line: ~~
+** Processing line: ~ If you do NOT want to save the recording, call:~
+** Processing line: ~ $recording.cancel~
+** Processing line: ~ S~
+** Processing line: ~ $console.set_command "$recording.stop 'replay.txt'"~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if !@is_recording~
+** Processing line: ~ log_info "You are not currently recording. Use start_recording(seed_number) to start recording."~
+** Processing line: ~ $console.set_command "$recording.start"~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if file_name~
+** Processing line: ~ text = "replay_version 2.0\n"~
+** Processing line: ~ text << "stopped_at #{@tick_count}\n"~
+** Processing line: ~ text << "seed #{@seed_number}\n"~
+** Processing line: ~ text << "recorded_at #{Time.now.to_s}\n"~
+** Processing line: ~ @input_history.each do |items|~
+** Processing line: ~ text << "#{items}\n"~
+** Processing line: ~ end~
+** Processing line: ~ @runtime.write_file file_name, text~
+** Processing line: ~ @runtime.write_file 'last_replay.txt', text~
+** Processing line: ~ log_info "The recording has been saved successfully at #{file_name}. You can use start_replay(\"#{file_name}\") to replay the recording."~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $console.set_command "$replay.start '#{file_name}'"~
+** Processing line: ~ stop_recording_core~
+** Processing line: ~ @runtime.notify! "Recording saved to #{file_name}. To replay it: $replay.start \"#{file_name}\"."~
+** Processing line: ~ log_info "You can run the replay later on startup using: ./dragonruby mygame --replay #{@replay_file_name}"~
+** Processing line: ~ nil~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def stop_recording_core~
+** Processing line: ~ @is_recording = false~
+** Processing line: ~ @input_history = nil~
+** Processing line: ~ @last_history = nil~
+** Processing line: ~ @runtime.__reset__~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def start_replay file_name = nil~
+** Processing line: ~ if !file_name~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * ERROR:~
+** Processing line: ~ Please provide a file name to $recording.start.~
+** Processing line: ~ S~
+** Processing line: ~ $console.set_command "$replay.start 'replay.txt'"~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ text = @runtime.read_file file_name~
+** Processing line: ~ return false unless text~
+** Processing line: ~~
+** Processing line: ~ if text.each_line.first.strip != "replay_version 2.0"~
+** Processing line: ~ raise "The replay file #{file_name} is not compatible with this version of DragonRuby Game Toolkit. Please recreate the replay (sorry)."~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ @replay_file_name = file_name~
+** Processing line: ~~
+** Processing line: ~ $replay_data = { input_history: { } }~
+** Processing line: ~ text.each_line do |l|~
+** Processing line: ~ if l.strip.length == 0~
+** Processing line: ~ next~
+** Processing line: ~ elsif l.start_with? 'replay_version'~
+** Processing line: ~ next~
+** Processing line: ~ elsif l.start_with? 'seed'~
+** Processing line: ~ $replay_data[:seed] = l.split(' ').last.to_i~
+** Processing line: ~ elsif l.start_with? 'stopped_at'~
+** Processing line: ~ $replay_data[:stopped_at] = l.split(' ').last.to_i~
+** Processing line: ~ elsif l.start_with? 'recorded_at'~
+** Processing line: ~ $replay_data[:recorded_at] = l.split(' ')[1..-1].join(' ')~
+** Processing line: ~ elsif l.start_with? '['~
+** Processing line: ~ name, value_1, value_2, value_count, id, tick_count = l.strip.gsub('[', '').gsub(']', '').split(',')~
+** Processing line: ~ $replay_data[:input_history][tick_count.to_i] ||= []~
+** Processing line: ~ $replay_data[:input_history][tick_count.to_i] << {~
+** Processing line: ~ id: id.to_i,~
+** Processing line: ~ name: name.gsub(':', '').to_sym,~
+** Processing line: ~ value_1: value_1.to_f,~
+** Processing line: ~ value_2: value_2.to_f,~
+** Processing line: ~ value_count: value_count.to_i~
+** Processing line: ~ }~
+** Processing line: ~ else~
+** Processing line: ~ raise "Replay data seems corrupt. I don't know how to parse #{l}."~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $replay_data[:input_history].keys.each do |key|~
+** Processing line: ~ $replay_data[:input_history][key] = $replay_data[:input_history][key].sort_by {|input| input[:id]}~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ @runtime.__reset__~
+** Processing line: ~ @runtime.set_rng $replay_data[:seed]~
+** Processing line: ~ @tick_count = 0~
+** Processing line: ~ @is_replaying = true~
+** Processing line: ~ log_info "Replay has been started."~
+** Processing line: ~ @runtime.notify! "Replay started [#{@replay_file_name}]."~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def stop_replay notification_message = "Replay has been stopped."~
+** Processing line: ~ if !is_replaying?~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * ERROR:~
+** Processing line: ~ No replay is currently running. Call $replay.start FILE_NAME to start a replay.~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ $console.set_command "$replay.start 'replay.txt'"~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~ log_info notification_message~
+** Processing line: ~ @is_replaying = false~
+** Processing line: ~ $replay_data = nil~
+** Processing line: ~ @tick_count = 0~
+** Processing line: ~ @global_input_order = 1~
+** Processing line: ~ $console.set_command_silent "$replay.start '#{@replay_file_name}'"~
+** Processing line: ~ @runtime.__reset__~
+** Processing line: ~ @runtime.notify! notification_message~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def record_input_history name, value_1, value_2, value_count, clear_cache = false~
+** Processing line: ~ return if @is_replaying~
+** Processing line: ~ return unless @is_recording~
+** Processing line: ~ @input_history << [name, value_1, value_2, value_count, @global_input_order, @tick_count]~
+** Processing line: ~ @global_input_order += 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def stage_replay_values~
+** Processing line: ~ return unless @is_replaying~
+** Processing line: ~ return unless $replay_data~
+** Processing line: ~~
+** Processing line: ~ if $replay_data[:stopped_at] <= @tick_count~
+** Processing line: ~ stop_replay "Replay completed [#{@replay_file_name}]. To rerun, bring up the Console and press enter."~
+** Processing line: ~ return~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ inputs_this_tick = $replay_data[:input_history][@tick_count]~
+** Processing line: ~~
+** Processing line: ~ if @tick_count.zmod? 60~
+** Processing line: ~ log_info "Replay ends in #{($replay_data[:stopped_at] - @tick_count).idiv 60} second(s)."~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ return unless inputs_this_tick~
+** Processing line: ~ inputs_this_tick.each do |v|~
+** Processing line: ~ args = []~
+** Processing line: ~ args << v[:value_1] if v[:value_count] >= 1~
+** Processing line: ~ args << v[:value_2] if v[:value_count] >= 2~
+** Processing line: ~ args << :replay~
+** Processing line: ~ $gtk.send v[:name], *args~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** remote_hotload_client.rb~
- H3 detected.
- Determining if line is a header.
@@ -239999,14 +249056,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ log <<-S~
** Processing line: ~ ** Invoking :#{name}...~
** Processing line: ~ S~
-** Processing line: ~ time_start = Time.now~
** Processing line: ~ idx = 0~
** Processing line: ~ r = nil~
+** Processing line: ~ time_start = Time.now~
** Processing line: ~ while idx < iterations~
** Processing line: ~ r = proc.call~
** Processing line: ~ idx += 1~
** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ result = (Time.now - time_start).round 3~
** Processing line: ~~
** Processing line: ~ { name: name,~
@@ -240146,7 +249202,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ fn.each_send pass.borders, self, :draw_border~
** Processing line: ~ fn.each_send pass.static_borders, self, :draw_border~
** Processing line: ~~
-** Processing line: ~ if !$gtk.production~
+** Processing line: ~ if !self.production~
** Processing line: ~ fn.each_send pass.debug, self, :draw_primitive~
** Processing line: ~ fn.each_send pass.static_debug, self, :draw_primitive~
** Processing line: ~ end~
@@ -240163,6 +249219,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if s.respond_to? :draw_override~
** Processing line: ~ s.draw_override @ffi_draw~
** Processing line: ~ else~
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
** Processing line: ~ @ffi_draw.draw_solid_2 s.x, s.y, s.w, s.h,~
** Processing line: ~ s.r, s.g, s.b, s.a,~
** Processing line: ~ (s.blendmode_enum || 1)~
@@ -240176,6 +249233,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if s.respond_to? :draw_override~
** Processing line: ~ s.draw_override @ffi_draw~
** Processing line: ~ else~
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
** Processing line: ~ @ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,~
** Processing line: ~ (s.path || '').to_s,~
** Processing line: ~ s.angle,~
@@ -240195,6 +249253,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if s.respond_to? :draw_override~
** Processing line: ~ s.draw_override @ffi_draw~
** Processing line: ~ else~
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
** Processing line: ~ @ffi_draw.draw_screenshot (s.path || '').to_s,~
** Processing line: ~ s.x, s.y, s.w, s.h,~
** Processing line: ~ s.angle,~
@@ -240213,6 +249272,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if l.respond_to? :draw_override~
** Processing line: ~ l.draw_override @ffi_draw~
** Processing line: ~ else~
+** Processing line: ~ l = l.as_hash if l.is_a? OpenEntity~
** Processing line: ~ @ffi_draw.draw_label_3 l.x, l.y,~
** Processing line: ~ (l.text || '').to_s,~
** Processing line: ~ l.size_enum, l.alignment_enum,~
@@ -240230,6 +249290,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if l.respond_to? :draw_override~
** Processing line: ~ l.draw_override @ffi_draw~
** Processing line: ~ else~
+** Processing line: ~ l = l.as_hash if l.is_a? OpenEntity~
** Processing line: ~ if l.x2~
** Processing line: ~ @ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,~
** Processing line: ~ l.r, l.g, l.b, l.a,~
@@ -240255,6 +249316,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if s.respond_to? :draw_override~
** Processing line: ~ s.draw_override @ffi_draw~
** Processing line: ~ else~
+** Processing line: ~ s = s.as_hash if s.is_a? OpenEntity~
** Processing line: ~ @ffi_draw.draw_border_2 s.x, s.y, s.w, s.h,~
** Processing line: ~ s.r, s.g, s.b, s.a,~
** Processing line: ~ (s.blendmode_enum || 1)~
@@ -240337,7 +249399,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if @tick_speed_count > 60 * 2~
** Processing line: ~ if framerate_below_threshold?~
** Processing line: ~ @last_framerate = current_framerate~
-** Processing line: ~ if [email protected]?~
+** Processing line: ~ if [email protected]? && [email protected]_replaying?~
** Processing line: ~ log framerate_warning_message~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -241335,9 +250397,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def $top_level.slds! *os~
** Processing line: ~ if (os.first.is_a? Numeric)~
-** Processing line: ~ sld! *os~
+** Processing line: ~ sld!(*os)~
** Processing line: ~ else~
-** Processing line: ~ os.each { |o| sld! *o }~
+** Processing line: ~ os.each { |o| sld!(*o) }~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -241385,6 +250447,31 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ =begin~
+** Processing line: ~ wht = [255] * 3~
+** Processing line: ~ red = [255, 0, 0]~
+** Processing line: ~ blu = [0, 130, 255]~
+** Processing line: ~ purp = [150, 80, 255]~
+** Processing line: ~~
+** Processing line: ~ TICK {~
+** Processing line: ~ bg! 0~
+** Processing line: ~~
+** Processing line: ~ slds << [0, 0, 3, 3, 0, 255, 0, 255]~
+** Processing line: ~~
+** Processing line: ~ sld! 10, 10~
+** Processing line: ~ sld! 20, 20, 3, 2~
+** Processing line: ~ sld! 30, 30, 2, 2, red~
+** Processing line: ~ sld! 35, 35, blu~
+** Processing line: ~~
+** Processing line: ~ slds! 40, 40~
+** Processing line: ~~
+** Processing line: ~ slds! [50, 50],~
+** Processing line: ~ [60, 60, purp],~
+** Processing line: ~ [70, 70, 10, 10, wht],~
+** Processing line: ~ [80, 80, 4, 4, 255, 0, 255]~
+** Processing line: ~ }~
+** Processing line: ~ =end~
+** Processing line: ~~
** Processing line: ~#+end_src~
- PRE end detected.
** Processing line: ~~
diff --git a/docs/todo/05-sprites.md b/docs/todo/05-sprites.md
index e2be250..e8030ab 100644
--- a/docs/todo/05-sprites.md
+++ b/docs/todo/05-sprites.md
@@ -179,14 +179,26 @@ args.outputs.sprites << {
## Duck Typing (Advanced)
-You can also create a class with sprite properties and render it as a primitive,
-using the `attr_sprite` helper.
+You can also create a class with sprite properties and render it as a primitive.
+ALL properties must on the class. ADDITIONALLY, a method called `primitive_marker`
+must be defined on the class.
Here is an example:
```ruby
-class PlayerSprite
- attr_sprite
+# Create type with ALL sprite properties AND primitive_marker
+class Sprite
+ attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :source_x,
+ :source_y, :source_w, :source_h, :flip_horizontally,
+ :flip_vertically, :angle_anchor_x, :angle_anchor_y
+
+ def primitive_marker
+ :sprite
+ end
+end
+
+# Inherit from type
+class PlayerSprite < Sprite
# constructor
def initialize x, y, w, h