summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmir Rajan <[email protected]>2021-08-07 00:14:16 -0500
committerAmir Rajan <[email protected]>2021-08-07 00:14:16 -0500
commit17d6f2a45d07932fb2ac354d4f8996c420eddc27 (patch)
tree7b1ba6b28448d4e4d13d215d86e0e611a42b9d37
parenta503afe87619ff82201c0a43818fa1c3f070a548 (diff)
downloaddragonruby-game-toolkit-contrib-17d6f2a45d07932fb2ac354d4f8996c420eddc27.tar.gz
dragonruby-game-toolkit-contrib-17d6f2a45d07932fb2ac354d4f8996c420eddc27.zip
Docs synced.
-rw-r--r--docs/docs.html5670
-rw-r--r--docs/docs.txt5509
-rw-r--r--docs/parse_log.txt24214
-rw-r--r--docs/todo/03-solids-and-borders.md4
-rw-r--r--docs/todo/04-lines.md4
-rw-r--r--docs/todo/05-sprites.md4
-rw-r--r--docs/todo/08-controllers.md2
7 files changed, 26052 insertions, 9355 deletions
diff --git a/docs/docs.html b/docs/docs.html
index 39d0086..5ad5d6c 100644
--- a/docs/docs.html
+++ b/docs/docs.html
@@ -1,7 +1,8 @@
-<html>
+<html lang="en">
<head>
+ <meta charset="utf-8">
<title>DragonRuby Game Toolkit Documentation</title>
- <link href="docs.css?ver=1617643886" rel="stylesheet" type="text/css" media="all">
+ <link href="docs.css?ver=1628311142" rel="stylesheet" type="text/css" media="all">
</head>
<body>
<div id='toc'>
@@ -10,16 +11,16 @@
<li><a class='header-1' href='#--dragonruby-game-toolkit-live-docs'>DragonRuby Game Toolkit Live Docs</a></li>
<li><a class='header-1' href='#--hello-world'>Hello World</a></li>
<li><a class='header-1' href='#--join-the-discord-and-subscribe-to-the-news-letter'>Join the Discord and Subscribe to the News Letter</a></li>
-<li><a class='header-1' href='#--watch-some-intro-videos'>Watch Some Intro Videos</a></li>
-<li><a class='header-1' href='#--getting-started-tutorial'>Getting Started Tutorial</a></li>
-<ul><li><a class='header-2' href='#---introduction'>Introduction</a></li></ul><ul><li><a class='header-2' href='#---prerequisites'>Prerequisites</a></li></ul><ul><li><a class='header-2' href='#---the-game-loop'>The Game Loop</a></li></ul><ul><li><a class='header-2' href='#---breakdown-of-the--tick--method'>Breakdown Of The <code>tick</code> Method</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-sprite'>Rendering A Sprite</a></li></ul><ul><li><a class='header-2' href='#---coordinate-system-and-virtual-canvas'>Coordinate System and Virtual Canvas</a></li></ul><ul><li><a class='header-2' href='#---game-state'>Game State</a></li></ul><ul><li><a class='header-2' href='#---there-is-no-delta-time'>There Is No Delta Time</a></li></ul><ul><li><a class='header-2' href='#---handling-user-input'>Handling User Input</a></li></ul><ul><li><a class='header-2' href='#---coding-on-a-raspberry-pi'>Coding On A Raspberry Pi</a></li></ul><ul><li><a class='header-2' href='#---conclusion'>Conclusion</a></li></ul><li><a class='header-1' href='#--deploying-to-itch.io'>Deploying To Itch.io</a></li>
+<li><a class='header-1' href='#--intro-videos'>Intro Videos</a></li>
+<ul><li><a class='header-2' href='#---quick-api-tour'>Quick Api Tour</a></li></ul><ul><li><a class='header-2' href='#---if-you-are-completely-new-to-ruby-and-programming'>If You Are Completely New to Ruby and Programming</a></li></ul><ul><li><a class='header-2' href='#---if-you-have-game-dev-experience'>If You Have Game Dev Experience</a></li></ul><li><a class='header-1' href='#--getting-started-tutorial'>Getting Started Tutorial</a></li>
+<ul><li><a class='header-2' href='#---introduction'>Introduction</a></li></ul><ul><li><a class='header-2' href='#---prerequisites'>Prerequisites</a></li></ul><ul><li><a class='header-2' href='#---the-game-loop'>The Game Loop</a></li></ul><ul><li><a class='header-2' href='#---breakdown-of-the--tick--method'>Breakdown Of The <code>tick</code> Method</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-sprite'>Rendering A Sprite</a></li></ul><ul><li><a class='header-2' href='#---coordinate-system-and-virtual-canvas'>Coordinate System and Virtual Canvas</a></li></ul><ul><li><a class='header-2' href='#---game-state'>Game State</a></li></ul><ul><li><a class='header-2' href='#---there-is-no-delta-time'>There Is No Delta Time</a></li></ul><ul><li><a class='header-2' href='#---handling-user-input'>Handling User Input</a></li></ul><ul><li><a class='header-2' href='#---coding-on-a-raspberry-pi'>Coding On A Raspberry Pi</a></li></ul><ul><li><a class='header-2' href='#---conclusion'>Conclusion</a></li></ul><li><a class='header-1' href='#--deploying-to-itch-io'>Deploying To Itch.io</a></li>
<ul><li><a class='header-2' href='#---creating-your-game-landing-page'>Creating Your Game Landing Page</a></li></ul><ul><li><a class='header-2' href='#---update-your-game's-metadata'>Update Your Game's Metadata</a></li></ul><ul><li><a class='header-2' href='#---building-your-game-for-distribution'>Building Your Game For Distribution</a></li></ul><li><a class='header-1' href='#--deploying-to-mobile-devices'>Deploying To Mobile Devices</a></li>
<li><a class='header-1' href='#--dragonruby's-philosophy'>DragonRuby's Philosophy</a></li>
-<ul><li><a class='header-2' href='#---challenge-the-status-quo'>Challenge The Status Quo</a></li></ul><ul><li><a class='header-2' href='#---continuity-of-design'>Continuity of Design</a></li></ul><ul><li><a class='header-2' href='#---release-early-and-often'>Release Early and Often</a></li></ul><ul><li><a class='header-2' href='#---sustainable-and-ethical-monetization'>Sustainable And Ethical Monetization</a></li></ul><ul><li><a class='header-2' href='#---sustainable-and-ethical-open-source'>Sustainable And Ethical Open Source</a></li></ul><ul><li><a class='header-2' href='#---people-over-entities'>People Over Entities</a></li></ul><ul><li><a class='header-2' href='#---building-a-game-should-be-fun-and-bring-happiness'>Building A Game Should Be Fun And Bring Happiness</a></li></ul><ul><li><a class='header-2' href='#---real-world-application-drives-features'>Real World Application Drives Features</a></li></ul><li><a class='header-1' href='#--frequently-asked-questions,-comments,-and-concerns'>Frequently Asked Questions, Comments, and Concerns</a></li>
-<ul><li><a class='header-2' href='#---frequently-asked-questions'>Frequently Asked Questions</a></li></ul><ul><ul><li><a class='header-3' href='#----what-is-dragonruby-llp?'>What is DragonRuby LLP?</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----what-is-dragonruby?'>What is DragonRuby?</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----how-is-dragonruby-different-than-mri?'>How is DragonRuby different than MRI?</a></li></ul></ul><ul><li><a class='header-2' href='#---frequent-comments-about-ruby-as-a-language-choice'>Frequent Comments About Ruby as a Language Choice</a></li></ul><ul><ul><li><a class='header-3' href='#----but-ruby-is-dead.'>But Ruby is dead.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----but-ruby-is-slow.'>But Ruby is slow.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dynamic-languages-are-slow.'>Dynamic languages are slow.</a></li></ul></ul><ul><li><a class='header-2' href='#---frequent-concerns'>Frequent Concerns</a></li></ul><ul><ul><li><a class='header-3' href='#----dragonruby-is-not-open-source.-that's-not-right.'>DragonRuby is not open source. That's not right.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dragonruby-is-for-pay.-you-should-offer-a-free-version.'>DragonRuby is for pay. You should offer a free version.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----but-still,-you-should-offer-a-free-version.-so-i-can-try-it-out-and-see-if-i-like-it.'>But still, you should offer a free version. So I can try it out and see if I like it.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----i-still-think-you-should-do-a-free-version.-think-of-all-people-who-would-give-it-a-shot.'>I still think you should do a free version. Think of all people who would give it a shot.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----what-if-i-build-something-with-dragonruby,-but-dragonruby-llp-becomes-insolvent.'>What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.</a></li></ul></ul><li><a class='header-1' href='#--recipies-'>RECIPIES:</a></li>
-<ul><li><a class='header-2' href='#---how-to-determine-what-frame-you-are-on'>How To Determine What Frame You Are On</a></li></ul><ul><li><a class='header-2' href='#---how-to-get-current-framerate'>How To Get Current Framerate</a></li></ul><ul><li><a class='header-2' href='#---how-to-render-a-sprite-using-an-array'>How To Render A Sprite Using An Array</a></li></ul><ul><li><a class='header-2' href='#---more-sprite-properties-as-an-array'>More Sprite Properties As An Array</a></li></ul><ul><li><a class='header-2' href='#---different-sprite-representations'>Different Sprite Representations</a></li></ul><ul><li><a class='header-2' href='#---how-to-render-a-label'>How To Render A Label</a></li></ul><ul><li><a class='header-2' href='#---a-colored-label'>A Colored Label</a></li></ul><ul><li><a class='header-2' href='#---extended-label-properties'>Extended Label Properties</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-label-as-a--hash-'>Rendering A Label As A <code>Hash</code></a></li></ul><ul><li><a class='header-2' href='#---getting-the-size-of-a-piece-of-text'>Getting The Size Of A Piece Of Text</a></li></ul><ul><li><a class='header-2' href='#---how-to-play-a-sound'>How To Play A Sound</a></li></ul><ul><li><a class='header-2' href='#---using--args.state--to-store-your-game-state'>Using <code>args.state</code> To Store Your Game State</a></li></ul><ul><li><a class='header-2' href='#---troubleshoot-performance'>Troubleshoot Performance</a></li></ul><li><a class='header-1' href='#--docs---gtk--runtime-'>DOCS: <code>GTK::Runtime</code></a></li>
+<ul><li><a class='header-2' href='#---challenge-the-status-quo'>Challenge The Status Quo</a></li></ul><ul><li><a class='header-2' href='#---continuity-of-design'>Continuity of Design</a></li></ul><ul><li><a class='header-2' href='#---release-early-and-often'>Release Early and Often</a></li></ul><ul><li><a class='header-2' href='#---sustainable-and-ethical-monetization'>Sustainable And Ethical Monetization</a></li></ul><ul><li><a class='header-2' href='#---sustainable-and-ethical-open-source'>Sustainable And Ethical Open Source</a></li></ul><ul><li><a class='header-2' href='#---people-over-entities'>People Over Entities</a></li></ul><ul><li><a class='header-2' href='#---building-a-game-should-be-fun-and-bring-happiness'>Building A Game Should Be Fun And Bring Happiness</a></li></ul><ul><li><a class='header-2' href='#---real-world-application-drives-features'>Real World Application Drives Features</a></li></ul><li><a class='header-1' href='#--frequently-asked-questions--comments--and-concerns'>Frequently Asked Questions, Comments, and Concerns</a></li>
+<ul><li><a class='header-2' href='#---frequently-asked-questions'>Frequently Asked Questions</a></li></ul><ul><ul><li><a class='header-3' href='#----what-is-dragonruby-llp-'>What is DragonRuby LLP?</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----what-is-dragonruby-'>What is DragonRuby?</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----how-is-dragonruby-different-than-mri-'>How is DragonRuby different than MRI?</a></li></ul></ul><ul><li><a class='header-2' href='#---frequent-comments-about-ruby-as-a-language-choice'>Frequent Comments About Ruby as a Language Choice</a></li></ul><ul><ul><li><a class='header-3' href='#----but-ruby-is-dead-'>But Ruby is dead.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----but-ruby-is-slow-'>But Ruby is slow.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dynamic-languages-are-slow-'>Dynamic languages are slow.</a></li></ul></ul><ul><li><a class='header-2' href='#---frequent-concerns'>Frequent Concerns</a></li></ul><ul><ul><li><a class='header-3' href='#----dragonruby-is-not-open-source--that's-not-right-'>DragonRuby is not open source. That's not right.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----dragonruby-is-for-pay--you-should-offer-a-free-version-'>DragonRuby is for pay. You should offer a free version.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----but-still--you-should-offer-a-free-version--so-i-can-try-it-out-and-see-if-i-like-it-'>But still, you should offer a free version. So I can try it out and see if I like it.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----i-still-think-you-should-do-a-free-version--think-of-all-people-who-would-give-it-a-shot-'>I still think you should do a free version. Think of all people who would give it a shot.</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----what-if-i-build-something-with-dragonruby--but-dragonruby-llp-becomes-insolvent-'>What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.</a></li></ul></ul><li><a class='header-1' href='#--recipies-'>RECIPIES:</a></li>
+<ul><li><a class='header-2' href='#---how-to-determine-what-frame-you-are-on'>How To Determine What Frame You Are On</a></li></ul><ul><li><a class='header-2' href='#---how-to-get-current-framerate'>How To Get Current Framerate</a></li></ul><ul><li><a class='header-2' href='#---how-to-render-a-sprite-using-an-array'>How To Render A Sprite Using An Array</a></li></ul><ul><li><a class='header-2' href='#---more-sprite-properties-as-an-array'>More Sprite Properties As An Array</a></li></ul><ul><li><a class='header-2' href='#---different-sprite-representations'>Different Sprite Representations</a></li></ul><ul><li><a class='header-2' href='#---how-to-render-a-label'>How To Render A Label</a></li></ul><ul><li><a class='header-2' href='#---a-colored-label'>A Colored Label</a></li></ul><ul><li><a class='header-2' href='#---extended-label-properties'>Extended Label Properties</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-label-as-a--hash-'>Rendering A Label As A <code>Hash</code></a></li></ul><ul><li><a class='header-2' href='#---getting-the-size-of-a-piece-of-text'>Getting The Size Of A Piece Of Text</a></li></ul><ul><li><a class='header-2' href='#---rendering-labels-with-new-line-characters-and-wrapping'>Rendering Labels With New Line Characters And Wrapping</a></li></ul><ul><li><a class='header-2' href='#---how-to-play-a-sound'>How To Play A Sound</a></li></ul><ul><li><a class='header-2' href='#---using--args-state--to-store-your-game-state'>Using <code>args.state</code> To Store Your Game State</a></li></ul><ul><li><a class='header-2' href='#---troubleshoot-performance'>Troubleshoot Performance</a></li></ul><li><a class='header-1' href='#--docs---gtk--runtime-'>DOCS: <code>GTK::Runtime</code></a></li>
<li><a class='header-1' href='#--summary---def-tick-args;-end;-'>SUMMARY: <code>def tick args; end;</code></a></li>
-<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>
+<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---array-'>DOCS: <code>Array</code></a></li>
@@ -29,28 +30,29 @@
<li><a class='header-1' href='#--docs---array#reject_false-'>DOCS: <code>Array#reject_false</code></a></li>
<li><a class='header-1' href='#--docs---array#product-'>DOCS: <code>Array#product</code></a></li>
<li><a class='header-1' href='#--docs---array#map_2d-'>DOCS: <code>Array#map_2d</code></a></li>
-<li><a class='header-1' href='#--docs---array#include_any?-'>DOCS: <code>Array#include_any?</code></a></li>
-<li><a class='header-1' href='#--docs---array#any_intersect_rect?-'>DOCS: <code>Array#any_intersect_rect?</code></a></li>
+<li><a class='header-1' href='#--docs---array#include_any--'>DOCS: <code>Array#include_any?</code></a></li>
+<li><a class='header-1' href='#--docs---array#any_intersect_rect--'>DOCS: <code>Array#any_intersect_rect?</code></a></li>
<li><a class='header-1' href='#--docs---gtk--args#audio-'>DOCS: <code>GTK::Args#audio</code></a></li>
<ul><li><a class='header-2' href='#---audio-synthesis-(pro-only)'>Audio synthesis (Pro only)</a></li></ul><ul><ul><li><a class='header-3' href='#----sound-source'>Sound source</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----example-'>Example:</a></li></ul></ul><li><a class='header-1' href='#--docs---gtk--outputs-'>DOCS: <code>GTK::Outputs</code></a></li>
<li><a class='header-1' href='#--docs---gtk--outputs#solids-'>DOCS: <code>GTK::Outputs#solids</code></a></li>
<ul><li><a class='header-2' href='#---rendering-a-solid-using-an-array'>Rendering a solid using an Array</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-solid-using-an-array-with-colors-and-alpha'>Rendering a solid using an Array with colors and alpha</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-solid-using-a-hash'>Rendering a solid using a Hash</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-solid-using-a-class'>Rendering a solid using a Class</a></li></ul><li><a class='header-1' href='#--docs---gtk--outputs#borders-'>DOCS: <code>GTK::Outputs#borders</code></a></li>
-<li><a class='header-1' href='#--docs---gtk--outputs#screenshots-'>DOCS: <code>GTK::Outputs#screenshots</code></a></li>
+<li><a class='header-1' href='#--docs---gtk--outputs#sprites-'>DOCS: <code>GTK::Outputs#sprites</code></a></li>
+<ul><li><a class='header-2' href='#---rendering-a-sprite-using-an-array'>Rendering a sprite using an Array</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-sprite-using-an-array-with-colors-and-alpha'>Rendering a sprite using an Array with colors and alpha</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-sprite-using-a-hash'>Rendering a sprite using a Hash</a></li></ul><ul><li><a class='header-2' href='#---rendering-a-solid-using-a-class'>Rendering a solid using a Class</a></li></ul><li><a class='header-1' href='#--docs---gtk--outputs#screenshots-'>DOCS: <code>GTK::Outputs#screenshots</code></a></li>
<ul><li><a class='header-2' href='#---chroma-key-(making-a-color-transparent)'>Chroma key (Making a color transparent)</a></li></ul><li><a class='header-1' href='#--docs---gtk--mouse-'>DOCS: <code>GTK::Mouse</code></a></li>
<li><a class='header-1' href='#--docs---gtk--mousepoint-'>DOCS: <code>GTK::MousePoint</code></a></li>
<li><a class='header-1' href='#--docs---gtk--openentity-'>DOCS: <code>GTK::OpenEntity</code></a></li>
<li><a class='header-1' href='#--docs---gtk--openentity#as_hash-'>DOCS: <code>GTK::OpenEntity#as_hash</code></a></li>
<li><a class='header-1' href='#--docs---numeric#frame_index-'>DOCS: <code>Numeric#frame_index</code></a></li>
<li><a class='header-1' href='#--docs---numeric#elapsed_time-'>DOCS: <code>Numeric#elapsed_time</code></a></li>
-<li><a class='header-1' href='#--docs---numeric#elapsed?-'>DOCS: <code>Numeric#elapsed?</code></a></li>
-<li><a class='header-1' href='#--docs---numeric#created?-'>DOCS: <code>Numeric#created?</code></a></li>
+<li><a class='header-1' href='#--docs---numeric#elapsed--'>DOCS: <code>Numeric#elapsed?</code></a></li>
+<li><a class='header-1' href='#--docs---numeric#created--'>DOCS: <code>Numeric#created?</code></a></li>
<li><a class='header-1' href='#--docs---kernel-'>DOCS: <code>Kernel</code></a></li>
<li><a class='header-1' href='#--docs---kernel--tick_count-'>DOCS: <code>Kernel::tick_count</code></a></li>
<li><a class='header-1' href='#--docs---kernel--global_tick_count-'>DOCS: <code>Kernel::global_tick_count</code></a></li>
<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='#----rendering-basics---audio-mixer---main.rb'>Rendering Basics - Audio Mixer - main.rb</a></li></ul></ul><ul><ul><li><a class='header-3' href='#----rendering-basics---sound-synthesis---main.rb'>Rendering Basics - Sound Synthesis - 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---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-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---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='#----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---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---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='#----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='#----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='#----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/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---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='#----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>
<div id='content'>
<h1 id='--dragonruby-game-toolkit-live-docs'>DragonRuby Game Toolkit Live Docs</h1>
<p>
@@ -61,9 +63,6 @@ To search docs you can type <code>docs_search "SEARCH TERM"</code> or if you wan
</p>
<pre><code class="language-ruby">docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }
</code></pre>
-<p>
-<img src='docs_search.gif'></img>
-</p>
<h1 id='--hello-world'>Hello World</h1>
<p>
Welcome to DragonRuby Game Toolkit. Take the steps below to get started.
@@ -91,21 +90,26 @@ Reply with:
I am a Dragon Rider.
</p>
</blockquote>
-<h1 id='--watch-some-intro-videos'>Watch Some Intro Videos</h1>
+<h1 id='--intro-videos'>Intro Videos</h1>
<p>
-Each video is only 20 minutes and all of them will fit into a lunch break. So please watch them:
+Here are some videos to help you get the lay of the land.
</p>
+<h2 id='---quick-api-tour'>Quick Api Tour</h2>
<ol>
<li> Beginner Introduction to DragonRuby Game Toolkit: <a href='https://youtu.be/ixw7TJhU08E'>https://youtu.be/ixw7TJhU08E</a></li>
+</ol>
+<h2 id='---if-you-are-completely-new-to-ruby-and-programming'>If You Are Completely New to Ruby and Programming</h2>
+<ol>
<li> Intermediate Introduction to Ruby Syntax: <a href='https://youtu.be/HG-XRZ5Ppgc'>https://youtu.be/HG-XRZ5Ppgc</a></li>
<li> Intermediate Introduction to Arrays in Ruby: <a href='https://youtu.be/N72sEYFRqfo'>https://youtu.be/N72sEYFRqfo</a></li>
+<li> You may also want to try this free course provided at <a href='http://dragonruby.school'>http://dragonruby.school</a>.</li>
+</ol>
+<h2 id='---if-you-have-game-dev-experience'>If You Have Game Dev Experience</h2>
+<ol>
+<li> Building Tetris - Part 1: <a href='https://youtu.be/xZMwRSbC4rY'>https://youtu.be/xZMwRSbC4rY</a></li>
+<li> Building Tetris - Part 2: <a href='https://youtu.be/C3LLzDUDgz4'>https://youtu.be/C3LLzDUDgz4</a></li>
+<li> Low Res Game Jam Tutorial: <a href='https://youtu.be/pCI90ukKCME'>https://youtu.be/pCI90ukKCME</a></li>
</ol>
-<p>
-The second and third videos are not required if you are proficient with Ruby, but *definitely* watch the first one.
-</p>
-<p>
-You may also want to try this free course provided at <a href='http://dragonruby.school'>http://dragonruby.school</a>.
-</p>
<h1 id='--getting-started-tutorial'>Getting Started Tutorial</h1>
<p>
This is a tutorial written by Ryan C Gordon (a Juggernaut in the industry who has contracted to Valve, Epic, Activision, and EA... check out his Wikipedia page: <a href='https://en.wikipedia.org/wiki/Ryan_C._Gordon'>https://en.wikipedia.org/wiki/Ryan_C._Gordon</a>).
@@ -291,7 +295,7 @@ Note that you can also run DragonRuby without X11 at all: if you run it from a v
<p>
There is a lot more you can do with DragonRuby, but now you've already got just about everything you need to make a simple game. After all, even the most fancy games are just creating objects and moving them around. Experiment a little. Add a few more things and have them interact in small ways. Want something to go away? Just don't add it to <code>args.output</code> anymore.
</p>
-<h1 id='--deploying-to-itch.io'>Deploying To Itch.io</h1>
+<h1 id='--deploying-to-itch-io'>Deploying To Itch.io</h1>
<p>
Once you've built your game, you're all set to deploy! Good luck in your game dev journey and if you get stuck, come to the Discord channel!
</p>
@@ -360,7 +364,7 @@ If you have a Pro subscription, you also have the capability to deploy to mobile
To deploy to iOS, you need to have a Mac running MacOS Catalina, an iOS device, and an active/paid Developer Account with Apple. From the Console type: <code>$wizards.ios.start</code> and you will be guided through the deployment process.
</p>
<p>
-To deploy to Android, you need to have an Android emulator/device, and a environment that is able to run Android SDK. <code>dragonruby-publish</code> will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:
+To deploy to Android, you need to have an Android emulator/device, and an environment that is able to run Android SDK. <code>dragonruby-publish</code> will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:
</p>
<pre><code class="language-ruby">> adb logcat -e mygame # you'll want to run this in a separate terminal
> keytool -genkey -v -keystore mygame.keystore -alias mygame -keyalg RSA -keysize 2048 -validity 10000
@@ -369,7 +373,7 @@ To deploy to Android, you need to have an Android emulator/device, and a environ
</code></pre>
<h1 id='--dragonruby's-philosophy'>DragonRuby's Philosophy</h1>
<p>
-The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principals.
+The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principles.
</p>
<h2 id='---challenge-the-status-quo'>Challenge The Status Quo</h2>
<p>
@@ -388,7 +392,7 @@ It's a hard pill to swallow, but forget blindly accepted best practices and try
There is a programming idiom in software called "The Pit of Success". The term normalizes upfront pain as a necessity/requirement in the hopes that the investment will yield dividends "when you become successful" or "when the code becomes more complicated". This approach to development is strongly discouraged by us. It leads to over-architected and unnecessary code; creates barriers to rapid prototyping and shipping a game; and overwhelms beginners who are new to the engine or programming in general.
</p>
<p>
-DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and string entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).
+DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs that take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and strict entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).
</p>
<h2 id='---release-early-and-often'>Release Early and Often</h2>
<p>
@@ -432,12 +436,12 @@ We are bombarded by marketing speak day in and day out. We don't do that here. T
<p>
We want DragonRuby to *actually* help you build the game you want to build (as opposed to sell you something piece of demoware that doesn't work).
</p>
-<h1 id='--frequently-asked-questions,-comments,-and-concerns'>Frequently Asked Questions, Comments, and Concerns</h1>
+<h1 id='--frequently-asked-questions--comments--and-concerns'>Frequently Asked Questions, Comments, and Concerns</h1>
<p>
Here are questions, comments, and concerns that frequently come up.
</p>
<h2 id='---frequently-asked-questions'>Frequently Asked Questions</h2>
-<h3 id='----what-is-dragonruby-llp?'>What is DragonRuby LLP?</h3>
+<h3 id='----what-is-dragonruby-llp-'>What is DragonRuby LLP?</h3>
<p>
DragonRuby LLP is a partnership of four devs who came together with the goal of bringing the aesthetics and joy of Ruby, everywhere possible.
</p>
@@ -462,7 +466,7 @@ NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just
<p>
NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh?
</p>
-<h3 id='----what-is-dragonruby?'>What is DragonRuby?</h3>
+<h3 id='----what-is-dragonruby-'>What is DragonRuby?</h3>
<p>
The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_.
</p>
@@ -482,7 +486,7 @@ DragonRuby's goal is to be compliant with the ISO/IEC 30170:2012 standard. It's
The elevator pitch is:
</p>
<p>
-DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Scadia.
+DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Stadia.
</p>
<h4>What does Multilevel Cross-platform mean?</h4>
<p>
@@ -513,7 +517,7 @@ These levels allow us to stay up to date with open source implementations of Rub
<p>
DragonRuby is a Ruby runtime implementation that takes all the lessons we've learned from MRI/CRuby, and merges it with the latest and greatest compiler and OSS technologies.
</p>
-<h3 id='----how-is-dragonruby-different-than-mri?'>How is DragonRuby different than MRI?</h3>
+<h3 id='----how-is-dragonruby-different-than-mri-'>How is DragonRuby different than MRI?</h3>
<p>
DragonRuby supports a subset of MRI apis. Our target is to support all of mRuby's standard lib. There are challenges to this given the number of platforms we are trying to support (specifically console).
</p>
@@ -535,7 +539,7 @@ end
</code></pre>
<ul>
<li>If you use the `repl` method, the code will be executed and the DragonRuby Console will automatically open so you can see the results (on Mac and Linux, the results will also be printed to the terminal).</li>
-<li>All <code>puts</code> statements will also be saved to <code>logs/log.txt</code>. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can <code>tail</code> this file.</li>
+<li>All <code>puts</code> statements will also be saved to <code>logs/puts.txt</code>. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can <code>tail</code> this file.</li>
</ul>
<p>
4. To ignore code in <code>repl.rb</code>, instead of commenting it out, prefix <code>repl</code> with the letter <code>x</code> and it'll be ignored.
@@ -568,18 +572,18 @@ You can use DragonRuby's replay capabilities to troubleshoot:
</p>
<ol>
<li> DragonRuby is hot loaded which gives you a very fast feedback loop (if the game throws an exception, it's because of the code you just added).</li>
-<li> Use <code>./dragonruby mygame --record</code> to create a game play recording that you can use to find the exception (you can replay a recoding by executing <code>./dragonruby mygame --replay last_replay.txt</code> or through the DragonRuby Console using <code>$gtk.recording.start_replay "last_replay.txt"</code>.</li>
+<li> Use <code>./dragonruby mygame --record</code> to create a game play recording that you can use to find the exception (you can replay a recording by executing <code>./dragonruby mygame --replay last_replay.txt</code> or through the DragonRuby Console using <code>$gtk.recording.start_replay "last_replay.txt"</code>.</li>
<li> DragonRuby also ships with a unit testing facility. You can invoke the following command to run a test: <code>./dragonruby . --eval some_ruby_file.rb --no-tick</code>.</li>
<li> Get into the habit of adding debugging facilities within the game itself. You can add drawing primitives to <code>args.outputs.debug</code> that will render on top of your game but will be ignored in a production release.</li>
<li> Debugging something that runs at 60fps is (imo) not that helpful. The exception you are seeing could have been because of a change that occurred many frames ago.</li>
</ol>
<h2 id='---frequent-comments-about-ruby-as-a-language-choice'>Frequent Comments About Ruby as a Language Choice</h2>
-<h3 id='----but-ruby-is-dead.'>But Ruby is dead.</h3>
+<h3 id='----but-ruby-is-dead-'>But Ruby is dead.</h3>
<p>
Let's check the official source for the answer to this question: isrubydead.com: <a href='https://isrubydead.com/'>https://isrubydead.com/</a>.
</p>
<p>
-On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Every one chases the new and shiny.
+On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Everyone chases the new and shiny.
</p>
<p>
What really matters is _quality/maturity_. Here is the latest (StackOverflow Survey sorted by highest paid developers)[https://insights.stackoverflow.com/survey/2019#top-paying-technologies].
@@ -587,11 +591,11 @@ What really matters is _quality/maturity_. Here is the latest (StackOverflow Sur
<p>
Let's stop making this comment shall we?
</p>
-<h3 id='----but-ruby-is-slow.'>But Ruby is slow.</h3>
+<h3 id='----but-ruby-is-slow-'>But Ruby is slow.</h3>
<p>
That doesn't make any sense. A language specification can't be slow... it's a language spec. Sure, an _implementation/runtime_ can be slow though, but then we'd have to talk about which runtime.
</p>
-<h3 id='----dynamic-languages-are-slow.'>Dynamic languages are slow.</h3>
+<h3 id='----dynamic-languages-are-slow-'>Dynamic languages are slow.</h3>
<p>
They are certainly slower than statically compiled languages. With the processing power and compiler optimizations we have today, dynamic languages like Ruby are _fast enough_.
</p>
@@ -602,7 +606,7 @@ Unless you are writing in some form of intermediate representation by hand, your
NOTE: If you _are_ hand writing LLVM IR, we are always open to bringing on new partners with such a skill set. Email us ^_^.
</p>
<h2 id='---frequent-concerns'>Frequent Concerns</h2>
-<h3 id='----dragonruby-is-not-open-source.-that's-not-right.'>DragonRuby is not open source. That's not right.</h3>
+<h3 id='----dragonruby-is-not-open-source--that's-not-right-'>DragonRuby is not open source. That's not right.</h3>
<p>
The current state of open source is unsustainable. Contributors work for free, most all open source repositories are severely under-staffed, and burnout from core members is rampant.
</p>
@@ -618,7 +622,7 @@ If the reason above isn't sufficient, then definitely use something else.
<p>
All this being said, we do have parts of the engine open sourced on GitHub: <a href='https://github.com/dragonruby/dragonruby-game-toolkit-contrib/'>https://github.com/dragonruby/dragonruby-game-toolkit-contrib/</a>
</p>
-<h3 id='----dragonruby-is-for-pay.-you-should-offer-a-free-version.'>DragonRuby is for pay. You should offer a free version.</h3>
+<h3 id='----dragonruby-is-for-pay--you-should-offer-a-free-version-'>DragonRuby is for pay. You should offer a free version.</h3>
<p>
If you can afford to pay for DragonRuby, you should (and will). We don't go around telling writers that they should give us their books for free, and only require payment if we read the entire thing. It's time we stop asking that of software products.
</p>
@@ -640,21 +644,21 @@ You qualify for a free, unrestricted license to DragonRuby products if any of th
<p>
Just contact Amir at [email protected] with a short explanation of your current situation and he'll set you up. No questions asked.
</p>
-<h3 id='----but-still,-you-should-offer-a-free-version.-so-i-can-try-it-out-and-see-if-i-like-it.'>But still, you should offer a free version. So I can try it out and see if I like it.</h3>
+<h3 id='----but-still--you-should-offer-a-free-version--so-i-can-try-it-out-and-see-if-i-like-it-'>But still, you should offer a free version. So I can try it out and see if I like it.</h3>
<p>
-You can try our [web-based sandbox environment](). But it won't do the runtime justice. Or just come to our [Slack]() or [Discord]() channel and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.
+You can try our web-based sandbox environment at <a href='http://fiddle.dragonruby.org'>http://fiddle.dragonruby.org</a>. But it won't do the runtime justice. Or just come to our Discord Channel at <a href='http://discord.dragonruby.org'>http://discord.dragonruby.org</a> and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.
</p>
<p>
Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so.
</p>
-<h3 id='----i-still-think-you-should-do-a-free-version.-think-of-all-people-who-would-give-it-a-shot.'>I still think you should do a free version. Think of all people who would give it a shot.</h3>
+<h3 id='----i-still-think-you-should-do-a-free-version--think-of-all-people-who-would-give-it-a-shot-'>I still think you should do a free version. Think of all people who would give it a shot.</h3>
<p>
Free isn't a sustainable financial model. We don't want to spam your email. We don't want to collect usage data off of you either. We just want to provide quality toolchains to quality developers (as opposed to a large quantity of developers).
</p>
<p>
The people that pay for DragonRuby and make an effort to understand it are the ones we want to build a community around, partner with, and collaborate with. So having that small monetary wall deters entitled individuals that don't value the same things we do.
</p>
-<h3 id='----what-if-i-build-something-with-dragonruby,-but-dragonruby-llp-becomes-insolvent.'>What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.</h3>
+<h3 id='----what-if-i-build-something-with-dragonruby--but-dragonruby-llp-becomes-insolvent-'>What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.</h3>
<p>
That won't happen if the development world stop asking for free stuff and non-trivially compensate open source developers. Look, we want to be able to work on the stuff we love, every day of our lives. And we'll go to great lengths to make that happen.
</p>
@@ -743,11 +747,15 @@ You can represent a sprite as a <code>Hash</code>:
flip_vertically: false,
flip_horizontally: false,
angle_anchor_x: 0.5,
- angle_anchor_y: 1.0
+ angle_anchor_y: 1.0,
+ blendmode_enum: 1
}
end
</code></pre>
<p>
+The <code>blendmode_enum</code> value can be set to <code>0</code> (no blending), <code>1</code> (alpha blending), <code>2</code> (additive blending), <code>3</code> (modulo blending), <code>4</code> (multiply blending).
+</p>
+<p>
You can represent a sprite as an <code>object</code>:
</p>
<pre><code class="language-ruby"># Create type with ALL sprite properties AND primitive_marker
@@ -756,7 +764,7 @@ class Sprite
:source_x, :source_y, :source_w, :source_h,
:tile_x, :tile_y, :tile_w, :tile_h,
:flip_horizontally, :flip_vertically,
- :angle_anchor_x, :angle_anchor_y
+ :angle_anchor_x, :angle_anchor_y, :blendmode_enum
def primitive_marker
:sprite
@@ -832,16 +840,17 @@ You can add additional metadata about your game within a label, which requires y
</p>
<pre><code class="language-ruby">def tick args
args.outputs.labels << {
- x: 200,
- y: 550,
- text: "dragonruby",
- size_enum: 2,
- alignment_enum: 1,
- r: 155,
- g: 50,
- b: 50,
- a: 255,
- font: "fonts/manaspc.ttf",
+ x: 200,
+ y: 550,
+ text: "dragonruby",
+ size_enum: 2,
+ alignment_enum: 1,
+ r: 155,
+ g: 50,
+ b: 50,
+ a: 255,
+ font: "fonts/manaspc.ttf",
+ vertical_alignment_enum: 0, # 0 is bottom, 1 is middle, 2 is top
# You can add any properties you like (this will be ignored/won't cause errors)
game_data_one: "Something",
game_data_two: {
@@ -871,6 +880,19 @@ You can get the render size of any string using <code>args.gtk.calcstringbox</co
]
end
</code></pre>
+<h2 id='---rendering-labels-with-new-line-characters-and-wrapping'>Rendering Labels With New Line Characters And Wrapping</h2>
+<p>
+You can use a strategy like the following to create multiple labels from a String.
+</p>
+<pre><code class="language-ruby">def tick args
+ long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elitteger dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."
+ max_character_length = 30
+ long_strings_split = args.string.wrapped_lines long_string, max_character_length
+ args.outputs.labels << long_strings_split.map_with_index do |s, i|
+ { x: 10, y: 600 - (i * 20), text: s }
+ end
+end
+</code></pre>
<h2 id='---how-to-play-a-sound'>How To Play A Sound</h2>
<p>
Sounds that end <code>.wav</code> will play once:
@@ -902,7 +924,7 @@ If you want to play a <code>.ogg</code> once as if it were a sound effect, you c
end
end
</code></pre>
-<h2 id='---using--args.state--to-store-your-game-state'>Using <code>args.state</code> To Store Your Game State</h2>
+<h2 id='---using--args-state--to-store-your-game-state'>Using <code>args.state</code> To Store Your Game State</h2>
<p>
<code>args.state</code> is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of <code>class</code>.
</p>
@@ -975,7 +997,7 @@ All the properties below hang off of <code>args</code> and can be accessed in th
args.PROPERTY
end
</code></pre>
-<h2 id='----args.state-'><code>args.state</code></h2>
+<h2 id='----args-state-'><code>args.state</code></h2>
<p>
Store your game state inside of this <code>state</code>. Properties with arbitrary nesting is allowed and a backing Entity will be created on your behalf.
</p>
@@ -984,35 +1006,35 @@ Store your game state inside of this <code>state</code>. Properties with arbitra
args.state.player.y ||= 0
end
</code></pre>
-<h3 id='-----.-.entity_id-'><code>.*.entity_id</code></h3>
+<h3 id='--------entity_id-'><code>.*.entity_id</code></h3>
<p>
Entities automatically receive an <code>entity_id</code> of type <code>Fixnum</code>.
</p>
-<h3 id='-----.-.entity_type-'><code>.*.entity_type</code></h3>
+<h3 id='--------entity_type-'><code>.*.entity_type</code></h3>
<p>
Entities can have an <code>entity_type</code> which is represented as a <code>Symbol</code>.
</p>
-<h3 id='-----.-.created_at-'><code>.*.created_at</code></h3>
+<h3 id='--------created_at-'><code>.*.created_at</code></h3>
<p>
Entities have <code>created_at</code> set to <code>args.state.tick_count</code> when they are created.
</p>
-<h3 id='-----.-.created_at_elapsed-'><code>.*.created_at_elapsed</code></h3>
+<h3 id='--------created_at_elapsed-'><code>.*.created_at_elapsed</code></h3>
<p>
Returns the elapsed number of ticks since creation.
</p>
-<h3 id='-----.-.global_created_at-'><code>.*.global_created_at</code></h3>
+<h3 id='--------global_created_at-'><code>.*.global_created_at</code></h3>
<p>
Entities have <code>global_created_at</code> set to <code>Kernel.global_tick_count</code> when they are created.
</p>
-<h3 id='-----.-.global_created_at_elapsed-'><code>.*.global_created_at_elapsed</code></h3>
+<h3 id='--------global_created_at_elapsed-'><code>.*.global_created_at_elapsed</code></h3>
<p>
Returns the elapsed number of global ticks since creation.
</p>
-<h3 id='-----.-.as_hash-'><code>.*.as_hash</code></h3>
+<h3 id='--------as_hash-'><code>.*.as_hash</code></h3>
<p>
Entity cast to a <code>Hash</code> so you can update values as if you were updating a <code>Hash</code>.
</p>
-<h3 id='-----.new_entity-'><code>.new_entity</code></h3>
+<h3 id='------new_entity-'><code>.new_entity</code></h3>
<p>
Creates a new Entity with a <code>type</code>, and initial properties. An option block can be passed to change the newly created entity:
</p>
@@ -1023,47 +1045,47 @@ Creates a new Entity with a <code>type</code>, and initial properties. An option
end
end
</code></pre>
-<h3 id='-----.new_entity_strict-'><code>.new_entity_strict</code></h3>
+<h3 id='------new_entity_strict-'><code>.new_entity_strict</code></h3>
<p>
Creates a new Strict Entity. While Entities created via <code>args.state.new_entity</code> can have new properties added later on, Entities created using <code>args.state.new_entity</code> must define all properties that are allowed during its initialization. Attempting to add new properties after initialization will result in an exception.
</p>
-<h3 id='-----.tick_count-'><code>.tick_count</code></h3>
+<h3 id='------tick_count-'><code>.tick_count</code></h3>
<p>
Returns the current tick of the game. <code>args.state.tick_count</code> is <code>0</code> when the game is first started or if the game is reset via <code>$gtk.reset</code>.
</p>
-<h2 id='----args.inputs-'><code>args.inputs</code></h2>
+<h2 id='----args-inputs-'><code>args.inputs</code></h2>
<p>
Access using input using <code>args.inputs</code>.
</p>
-<h3 id='-----.up-'><code>.up</code></h3>
+<h3 id='------up-'><code>.up</code></h3>
<p>
Returns <code>true</code> if: the <code>up</code> arrow or <code>w</code> key is pressed or held on the <code>keyboard</code>; or if <code>up</code> is pressed or held on <code>controller_one</code>; or if the <code>left_analog</code> on <code>controller_one</code> is tilted upwards.
</p>
-<h3 id='-----.down-'><code>.down</code></h3>
+<h3 id='------down-'><code>.down</code></h3>
<p>
Returns <code>true</code> if: the <code>down</code> arrow or <code>s</code> key is pressed or held on the <code>keyboard</code>; or if <code>down</code> is pressed or held on <code>controller_one</code>; or if the <code>left_analog</code> on <code>controller_one</code> is tilted downwards.
</p>
-<h3 id='-----.left-'><code>.left</code></h3>
+<h3 id='------left-'><code>.left</code></h3>
<p>
Returns <code>true</code> if: the <code>left</code> arrow or <code>a</code> key is pressed or held on the <code>keyboard</code>; or if <code>left</code> is pressed or held on <code>controller_one</code>; or if the <code>left_analog</code> on <code>controller_one</code> is tilted to the left.
</p>
-<h3 id='-----.right-'><code>.right</code></h3>
+<h3 id='------right-'><code>.right</code></h3>
<p>
Returns <code>true</code> if: the <code>right</code> arrow or <code>d</code> key is pressed or held on the <code>keyboard</code>; or if <code>right</code> is pressed or held on <code>controller_one</code>; or if the <code>left_analog</code> on <code>controller_one</code> is tilted to the right.
</p>
-<h3 id='-----.left_right-'><code>.left_right</code></h3>
+<h3 id='------left_right-'><code>.left_right</code></h3>
<p>
Returns <code>-1</code> (left), <code>0</code> (neutral), or <code>+1</code> (right) depending on results of <code>args.inputs.left</code> and <code>args.inputs.right</code>.
</p>
-<h3 id='-----.up_down-'><code>.up_down</code></h3>
+<h3 id='------up_down-'><code>.up_down</code></h3>
<p>
-Returns <code>-1</code> (down), <code>0</code> (neutral), or <code>+1</code> (right) depending on results of <code>args.inputs.up</code> and <code>args.inputs.down</code>.
+Returns <code>-1</code> (down), <code>0</code> (neutral), or <code>+1</code> (up) depending on results of <code>args.inputs.down</code> and <code>args.inputs.up</code>.
</p>
-<h3 id='-----.text--or--.history-'><code>.text</code> OR <code>.history</code></h3>
+<h3 id='------text--or---history-'><code>.text</code> OR <code>.history</code></h3>
<p>
Returns a string that represents the last key that was pressed on the keyboard.
</p>
-<h3 id='-----.mouse-'><code>.mouse</code></h3>
+<h3 id='------mouse-'><code>.mouse</code></h3>
<p>
Represents the user's
</p>
@@ -1105,37 +1127,49 @@ Returns a bitmask for all buttons on the mouse: <code>1</code> for a button in t
</p>
<h4><code>mouse.wheel</code></h4>
<p>
-Represents the mouse wheel. Returns <code>nil</code> if no mouse wheel actions occurred. ***** <code>.x</code> Returns the negative or positive number if the mouse wheel has changed in the <code>x</code> axis. ***** <code>.y</code> Returns the negative or positive number if the mouse wheel has changed in the <code>y</code> axis.
+Represents the mouse wheel. Returns <code>nil</code> if no mouse wheel actions occurred.
+</p>
+<p>
+***** <code>.x</code>
+</p>
+<p>
+Returns the negative or positive number if the mouse wheel has changed in the <code>x</code> axis.
+</p>
+<p>
+***** <code>.y</code>
+</p>
+<p>
+Returns the negative or positive number if the mouse wheel has changed in the <code>y</code> axis.
</p>
<h4><code>.click</code> OR <code>.down</code>, <code>.previous_click</code>, <code>.up</code></h4>
<p>
The properties <code>args.inputs.mouse.(click|down|previous_click|up)</code> each return <code>nil</code> if the mouse button event didn't occur. And return an Entity that has an <code>x</code>, <code>y</code> properties along with helper functions to determine collision: <code>inside_rect?</code>, <code>inside_circle</code>.
</p>
-<h3 id='-----.controller_one-,--.controller_two-'><code>.controller_one</code>, <code>.controller_two</code></h3>
+<h3 id='------controller_one-----controller_two-'><code>.controller_one</code>, <code>.controller_two</code></h3>
<p>
Represents controllers connected to the usb ports.
</p>
-<h4>~.up</h4>
+<h4><code>.up</code></h4>
<p>
Returns <code>true</code> if <code>up</code> is pressed or held on the directional or left analog.
</p>
-<h4>~.down</h4>
+<h4><code>.down</code></h4>
<p>
Returns <code>true</code> if <code>down</code> is pressed or held on the directional or left analog.
</p>
-<h4>~.left</h4>
+<h4><code>.left</code></h4>
<p>
Returns <code>true</code> if <code>left</code> is pressed or held on the directional or left analog.
</p>
-<h4>~.right</h4>
+<h4><code>.right</code></h4>
<p>
Returns <code>true</code> if <code>right</code> is pressed or held on the directional or left analog.
</p>
-<h4>~.left_right</h4>
+<h4><code>.left_right</code></h4>
<p>
Returns <code>-1</code> (left), <code>0</code> (neutral), or <code>+1</code> (right) depending on results of <code>args.inputs.controller_(one|two).left</code> and <code>args.inputs.controller_(one|two).right</code>.
</p>
-<h4>~.up_down</h4>
+<h4><code>.up_down</code></h4>
<p>
Returns <code>-1</code> (down), <code>0</code> (neutral), or <code>+1</code> (up) depending on results of <code>args.inputs.controller_(one|two).up</code> and <code>args.inputs.controller_(one|two).down</code>.
</p>
@@ -1155,19 +1189,19 @@ Returns a number between <code>-1</code> and <code>1</code> which represents the
<p>
Returns a number between <code>-1</code> and <code>1</code> which represents the percentage the analog is moved vertically as a ratio of the maximum vertical movement.
</p>
-<h4><code>.directional_up)</code></h4>
+<h4><code>.directional_up</code></h4>
<p>
Returns <code>true</code> if <code>up</code> is pressed or held on the directional.
</p>
-<h4><code>.directional_down)</code></h4>
+<h4><code>.directional_down</code></h4>
<p>
Returns <code>true</code> if <code>down</code> is pressed or held on the directional.
</p>
-<h4><code>.directional_left)</code></h4>
+<h4><code>.directional_left</code></h4>
<p>
Returns <code>true</code> if <code>left</code> is pressed or held on the directional.
</p>
-<h4><code>.directional_right)</code></h4>
+<h4><code>.directional_right</code></h4>
<p>
Returns <code>true</code> if <code>right</code> is pressed or held on the directional.
</p>
@@ -1191,7 +1225,7 @@ Returns <code>true</code> if the specific button is being held. <code>args.input
<p>
Returns <code>true</code> if the specific button was released. <code>args.inputs.controller_(one|two).key_up.BUTTON</code> will be true only on the frame the button was released.
</p>
-<h3 id='-----.keyboard-'><code>.keyboard</code></h3>
+<h3 id='------keyboard-'><code>.keyboard</code></h3>
<p>
Represents the user's keyboard
</p>
@@ -1333,139 +1367,148 @@ Returns a <code>Hash</code> with all keys on the keyboard in their respective st
<li><code>:down_or_held</code></li>
<li><code>:up</code></li>
</ul>
-<h2 id='----args.outputs-'><code>args.outputs</code></h2>
+<h2 id='----args-outputs-'><code>args.outputs</code></h2>
<p>
<code>args.outputs.PROPERTY</code> is how you render to the screen.
</p>
-<h3 id='-----.background_color-'><code>.background_color</code></h3>
+<h3 id='------background_color-'><code>.background_color</code></h3>
<p>
Set <code>args.outputs.background_color</code> to an <code>Array</code> with <code>RGB</code> values (eg. <code>[255, 255, 255]</code> for the color white).
</p>
-<h3 id='-----.sounds-'><code>.sounds</code></h3>
+<h3 id='------sounds-'><code>.sounds</code></h3>
<p>
Send a file path to this collection to play a sound. The sound file must be under the <code>mygame</code> directory. Example: <code>args.outputs.sounds << "sounds/jump.wav"</code>.
</p>
-<h3 id='-----.solids-'><code>.solids</code></h3>
+<h3 id='------solids-'><code>.solids</code></h3>
<p>
Send a Primitive to this collection to render a filled in rectangle to the screen. This collection is cleared at the end of every frame.
</p>
-<h3 id='-----.static_solids-'><code>.static_solids</code></h3>
+<h3 id='------static_solids-'><code>.static_solids</code></h3>
<p>
Send a Primitive to this collection to render a filled in rectangle to the screen. This collection is not cleared at the end of every frame. And objects can be mutated by reference.
</p>
-<h3 id='-----.sprites-,--.static_sprites-'><code>.sprites</code>, <code>.static_sprites</code></h3>
+<h3 id='------sprites-----static_sprites-'><code>.sprites</code>, <code>.static_sprites</code></h3>
<p>
Send a Primitive to this collection to render a sprite to the screen.
</p>
-<h3 id='-----.primitives-,--.static_primitives-'><code>.primitives</code>, <code>.static_primitives</code></h3>
+<h3 id='------primitives-----static_primitives-'><code>.primitives</code>, <code>.static_primitives</code></h3>
<p>
Send a Primitive of any type and it'll be rendered. The Primitive must have a <code>primitive_marker</code> that returns <code>:solid</code>, <code>:sprite</code>, <code>:label</code>, <code>:line</code>, <code>:border</code>.
</p>
-<h3 id='-----.labels-,--.static_labels-'><code>.labels</code>, <code>.static_labels</code></h3>
+<h3 id='------labels-----static_labels-'><code>.labels</code>, <code>.static_labels</code></h3>
<p>
Send a Primitive to this collection to render text to the screen.
</p>
-<h3 id='-----.lines-,--.static_lines-'><code>.lines</code>, <code>.static_lines</code></h3>
+<h3 id='------lines-----static_lines-'><code>.lines</code>, <code>.static_lines</code></h3>
<p>
Send a Primitive to this collection to render a line to the screen.
</p>
-<h3 id='-----.borders-,--.static_borders-'><code>.borders</code>, <code>.static_borders</code></h3>
+<h3 id='------borders-----static_borders-'><code>.borders</code>, <code>.static_borders</code></h3>
<p>
Send a Primitive to this collection to render an unfilled rectangle to the screen.
</p>
-<h3 id='-----.debug-,--.static_debug-'><code>.debug</code>, <code>.static_debug</code></h3>
+<h3 id='------debug-----static_debug-'><code>.debug</code>, <code>.static_debug</code></h3>
<p>
Send any Primitive to this collection which represents things you render to the screen for debugging purposes. Primitives in this collection will not be rendered in a production release of your game.
</p>
-<h2 id='----args.geometry-'><code>args.geometry</code></h2>
+<h2 id='----args-geometry-'><code>args.geometry</code></h2>
<p>
This property contains geometric functions. Functions can be invoked via <code>args.geometry.FUNCTION</code>.
</p>
-<h3 id='-----.inside_rect?-rect_1,-rect_2-'><code>.inside_rect? rect_1, rect_2</code></h3>
+<p>
+Here are some general notes with regards to the arguments these geometric functions accept.
+</p>
+<ol>
+<li> <code>Rectangles</code> can be represented as an <code>Array</code> with four (or more) values <code>[x, y, w, h]</code>, as a <code>Hash</code> <code>{ x:, y:, w:, h: }</code> or an object that responds to <code>x</code>, <code>y</code>, <code>w</code>, and <code>h</code>.</li>
+<li> <code>Points</code> can be represent as an <code>Array</code> with two (or more) values <code>[x, y]</code>, as a <code>Hash</code> <code>{ x:, y:}</code> or an object that responds to <code>x</code>, and <code>y</code>.</li>
+<li> <code>Lines</code> can be represented as an <code>Array</code> with four (or more) values <code>[x, y, x2, y2]</code>, as a <code>Hash</code> <code>{ x:, y:, x2:, y2: }</code> or an object that responds to <code>x</code>, <code>y</code>, <code>x2</code>, and <code>y2</code>.</li>
+<li> <code>Angles</code> are represented as degrees (not radians).</li>
+</ol>
+<h3 id='------inside_rect--rect_1--rect_2-'><code>.inside_rect? rect_1, rect_2</code></h3>
<p>
Returns <code>true</code> if <code>rect_1</code> is inside <code>rect_2</code>.
</p>
-<h3 id='-----.intersect_rect?-rect_2,-rect_2-'><code>.intersect_rect? rect_2, rect_2</code></h3>
+<h3 id='------intersect_rect--rect_2--rect_2-'><code>.intersect_rect? rect_2, rect_2</code></h3>
<p>
Returns <code>true</code> if <code>rect_1</code> intersects <code>rect_2</code>.
</p>
-<h3 id='-----.scale_rect-rect,-x_percentage,-y_percentage-'><code>.scale_rect rect, x_percentage, y_percentage</code></h3>
+<h3 id='------scale_rect-rect--x_percentage--y_percentage-'><code>.scale_rect rect, x_percentage, y_percentage</code></h3>
<p>
Returns a new rectangle that is scaled by the percentages provided.
</p>
-<h3 id='-----.angle_to-start_point,-end_point-'><code>.angle_to start_point, end_point</code></h3>
+<h3 id='------angle_to-start_point--end_point-'><code>.angle_to start_point, end_point</code></h3>
<p>
Returns the angle in degrees between two points <code>start_point</code> to <code>end_point</code>.
</p>
-<h3 id='-----.angle_from-start_point,-end_point-'><code>.angle_from start_point, end_point</code></h3>
+<h3 id='------angle_from-start_point--end_point-'><code>.angle_from start_point, end_point</code></h3>
<p>
Returns the angle in degrees between two points <code>start_point</code> from <code>end_point</code>.
</p>
-<h3 id='-----.point_inside_circle?-point,-circle_center_point,-radius-'><code>.point_inside_circle? point, circle_center_point, radius</code></h3>
+<h3 id='------point_inside_circle--point--circle_center_point--radius-'><code>.point_inside_circle? point, circle_center_point, radius</code></h3>
<p>
Returns <code>true</code> if a point is inside a circle defined by its center and radius.
</p>
-<h3 id='-----.center_inside_rect-rect,-other_rect-'><code>.center_inside_rect rect, other_rect</code></h3>
+<h3 id='------center_inside_rect-rect--other_rect-'><code>.center_inside_rect rect, other_rect</code></h3>
<p>
Returns a new rectangle based of off <code>rect</code> that is centered inside of <code>other_rect</code>.
</p>
-<h3 id='-----.center_inside_rect_x-rect,-other_rect-'><code>.center_inside_rect_x rect, other_rect</code></h3>
+<h3 id='------center_inside_rect_x-rect--other_rect-'><code>.center_inside_rect_x rect, other_rect</code></h3>
<p>
Returns a new rectangle based of off <code>rect</code> that is centered horizontally inside of <code>other_rect</code>.
</p>
-<h3 id='-----.center_inside_rect_y-rect,-other_rect-'><code>.center_inside_rect_y rect, other_rect</code></h3>
+<h3 id='------center_inside_rect_y-rect--other_rect-'><code>.center_inside_rect_y rect, other_rect</code></h3>
<p>
Returns a new rectangle based of off <code>rect</code> that is centered vertically inside of <code>other_rect</code>.
</p>
-<h3 id='-----.anchor_rect-rect,-anchor_x,-anchor_y-'><code>.anchor_rect rect, anchor_x, anchor_y</code></h3>
+<h3 id='------anchor_rect-rect--anchor_x--anchor_y-'><code>.anchor_rect rect, anchor_x, anchor_y</code></h3>
<p>
Returns a new rectangle based of off <code>rect</code> that has been repositioned based on the percentages passed into anchor_x, and anchor_y.
</p>
-<h3 id='-----.shift_line-line,-x,-y-'><code>.shift_line line, x, y</code></h3>
+<h3 id='------shift_line-line--x--y-'><code>.shift_line line, x, y</code></h3>
<p>
Returns a line that is offset by <code>x</code>, and <code>y</code>.
</p>
-<h3 id='-----.line_y_intercept-line-'><code>.line_y_intercept line</code></h3>
+<h3 id='------line_y_intercept-line-'><code>.line_y_intercept line</code></h3>
<p>
Given a line, the <code>b</code> value is determined for the point slope form equation: <code>y = mx + b</code>.
</p>
-<h3 id='-----.angle_between_lines-line_one,-line_two,-replace_infinity--'><code>.angle_between_lines line_one, line_two, replace_infinity:</code></h3>
+<h3 id='------angle_between_lines-line_one--line_two--replace_infinity--'><code>.angle_between_lines line_one, line_two, replace_infinity:</code></h3>
<p>
Returns the angle between two lines as if they were infinitely long. A numeric value can be passed in for the last parameter which would represent lines that do not intersect.
</p>
-<h3 id='-----.line_slope-line,-replace_infinity--'><code>.line_slope line, replace_infinity:</code></h3>
+<h3 id='------line_slope-line--replace_infinity--'><code>.line_slope line, replace_infinity:</code></h3>
<p>
Given a line, the <code>m</code> value is determined for the point slope form equation: <code>y = mx + b</code>.
</p>
-<h3 id='-----.line_rise_run-'><code>.line_rise_run</code></h3>
+<h3 id='------line_rise_run-'><code>.line_rise_run</code></h3>
<p>
Given a line, a <code>Hash</code> is returned that returns the slope as <code>x</code> and <code>y</code> properties with normalized values (the number is between -1 and 1).
</p>
-<h3 id='-----.ray_test-point,-line-'><code>.ray_test point, line</code></h3>
+<h3 id='------ray_test-point--line-'><code>.ray_test point, line</code></h3>
<p>
Given a point and a line, <code>:on</code>, <code>:left</code>, or <code>:right</code> which represents the location of the point relative to the line.
</p>
-<h3 id='-----.line_rect-line-'><code>.line_rect line</code></h3>
+<h3 id='------line_rect-line-'><code>.line_rect line</code></h3>
<p>
Returns the bounding rectangle for a line.
</p>
-<h3 id='-----.line_intersect-line_one,-line_two-'><code>.line_intersect line_one, line_two</code></h3>
+<h3 id='------line_intersect-line_one--line_two-'><code>.line_intersect line_one, line_two</code></h3>
<p>
Returns a point that represents the intersection of the lines.
</p>
-<h3 id='-----.distance-point_one,-point_two-'><code>.distance point_one, point_two</code></h3>
+<h3 id='------distance-point_one--point_two-'><code>.distance point_one, point_two</code></h3>
<p>
Returns the distance between two points.
</p>
-<h3 id='-----.cubic_bezier-t,-a,-b,-c,-d-'><code>.cubic_bezier t, a, b, c, d</code></h3>
+<h3 id='------cubic_bezier-t--a--b--c--d-'><code>.cubic_bezier t, a, b, c, d</code></h3>
<p>
Returns the cubic bezier function for tick_count <code>t</code> with anchors <code>a</code>, <code>b</code>, <code>c</code>, and <code>d</code>.
</p>
-<h2 id='----args.easing-'><code>args.easing</code></h2>
+<h2 id='----args-easing-'><code>args.easing</code></h2>
<p>
A set of functions that allow you to determine the current progression of an easing function.
</p>
-<h3 id='-----.ease-start_tick,-current_tick,-duration,-easing_functions-'><code>.ease start_tick, current_tick, duration, easing_functions</code></h3>
+<h3 id='------ease-start_tick--current_tick--duration--easing_functions-'><code>.ease start_tick, current_tick, duration, easing_functions</code></h3>
<p>
Given a start, current, duration, and easing function names, <code>ease</code> returns a number between 0 and 1 that represents the progress of an easing function.
</p>
@@ -1485,7 +1528,7 @@ This example will move a box at a linear speed from 0 to 1280.
args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 }
end
</code></pre>
-<h3 id='-----.ease_spline-start_tick,-current_tick,-duration,-spline-'><code>.ease_spline start_tick, current_tick, duration, spline</code></h3>
+<h3 id='------ease_spline-start_tick--current_tick--duration--spline-'><code>.ease_spline start_tick, current_tick, duration, spline</code></h3>
<p>
Given a start, current, duration, and a multiple bezier values, this function returns a number between 0 and 1 that represents the progress of an easing function.
</p>
@@ -1506,11 +1549,11 @@ This example will move a box at a linear speed from 0 to 1280 and then back to 0
args.outputs.solids << { x: 1280 * current_progress, y: 360, w: 10, h: 10 }
end
</code></pre>
-<h2 id='----args.string-'><code>args.string</code></h2>
+<h2 id='----args-string-'><code>args.string</code></h2>
<p>
Useful string functions not included in Ruby core libraries.
</p>
-<h3 id='-----.wrapped_lines-string,-max_character_length-'><code>.wrapped_lines string, max_character_length</code></h3>
+<h3 id='------wrapped_lines-string--max_character_length-'><code>.wrapped_lines string, max_character_length</code></h3>
<p>
This function will return a collection of strings given an input <code>string</code> and <code>max_character_length</code>. The collection of strings returned will split the input string into strings of <code>length <= max_character_length</code>.
</p>
@@ -1527,175 +1570,175 @@ teger dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."
end
end
</code></pre>
-<h2 id='----args.grid-'><code>args.grid</code></h2>
+<h2 id='----args-grid-'><code>args.grid</code></h2>
<p>
Returns the virtual grid for the game.
</p>
-<h3 id='-----.name-'><code>.name</code></h3>
+<h3 id='------name-'><code>.name</code></h3>
<p>
Returns either <code>:origin_bottom_left</code> or <code>:origin_center</code>.
</p>
-<h3 id='-----.bottom-'><code>.bottom</code></h3>
+<h3 id='------bottom-'><code>.bottom</code></h3>
<p>
Returns the <code>y</code> value that represents the bottom of the grid.
</p>
-<h3 id='-----.top-'><code>.top</code></h3>
+<h3 id='------top-'><code>.top</code></h3>
<p>
Returns the <code>y</code> value that represents the top of the grid.
</p>
-<h3 id='-----.left-'><code>.left</code></h3>
+<h3 id='------left-'><code>.left</code></h3>
<p>
Returns the <code>x</code> value that represents the left of the grid.
</p>
-<h3 id='-----.right-'><code>.right</code></h3>
+<h3 id='------right-'><code>.right</code></h3>
<p>
Returns the <code>x</code> value that represents the right of the grid.
</p>
-<h3 id='-----.rect-'><code>.rect</code></h3>
+<h3 id='------rect-'><code>.rect</code></h3>
<p>
Returns a rectangle Primitive that represents the grid.
</p>
-<h3 id='-----.origin_bottom_left!-'><code>.origin_bottom_left!</code></h3>
+<h3 id='------origin_bottom_left!-'><code>.origin_bottom_left!</code></h3>
<p>
Change the grids coordinate system to 0, 0 at the bottom left corner.
</p>
-<h3 id='-----.origin_center!-'><code>.origin_center!</code></h3>
+<h3 id='------origin_center!-'><code>.origin_center!</code></h3>
<p>
Change the grids coordinate system to 0, 0 at the center of the screen.
</p>
-<h3 id='-----.w-'><code>.w</code></h3>
+<h3 id='------w-'><code>.w</code></h3>
<p>
Returns the grid's width (always 1280).
</p>
-<h3 id='-----.h-'><code>.h</code></h3>
+<h3 id='------h-'><code>.h</code></h3>
<p>
Returns the grid's height (always 720).
</p>
-<h2 id='----args.gtk-'><code>args.gtk</code></h2>
+<h2 id='----args-gtk-'><code>args.gtk</code></h2>
<p>
This represents the DragonRuby Game Toolkit's Runtime Environment and can be accessed via <code>args.gtk.METHOD</code>.
</p>
-<h3 id='-----.argv-'><code>.argv</code></h3>
+<h3 id='------argv-'><code>.argv</code></h3>
<p>
Returns a <code>String</code> that represents the parameters passed into the <code>./dragonruby</code> binary.
</p>
-<h3 id='-----.platform-'><code>.platform</code></h3>
+<h3 id='------platform-'><code>.platform</code></h3>
<p>
Returns a <code>String</code> representing the operating system the game is running on.
</p>
-<h3 id='-----.request_quit-'><code>.request_quit</code></h3>
+<h3 id='------request_quit-'><code>.request_quit</code></h3>
<p>
Request that the runtime quit the game.
</p>
-<h3 id='-----.write_file-path,-contents-'><code>.write_file path, contents</code></h3>
+<h3 id='------write_file-path--contents-'><code>.write_file path, contents</code></h3>
<p>
Writes/overwrites a file within the game directory + path.
</p>
-<h3 id='-----.write_file_root-'><code>.write_file_root</code></h3>
+<h3 id='------write_file_root-'><code>.write_file_root</code></h3>
<p>
Writes/overwrites a file within the root dragonruby binary directory + path.
</p>
-<h3 id='-----.append_file-path,-contents-'><code>.append_file path, contents</code></h3>
+<h3 id='------append_file-path--contents-'><code>.append_file path, contents</code></h3>
<p>
Append content to a file located at the game directory + path.
</p>
-<h3 id='-----.append_file_root-path,-contents-'><code>.append_file_root path, contents</code></h3>
+<h3 id='------append_file_root-path--contents-'><code>.append_file_root path, contents</code></h3>
<p>
Append content to a file located at the root dragonruby binary directory + path.
</p>
-<h3 id='-----.read_file-path-'><code>.read_file path</code></h3>
+<h3 id='------read_file-path-'><code>.read_file path</code></h3>
<p>
Reads a file from the sandboxed file system.
</p>
-<h3 id='-----.parse_xml-string,-parse_xml_file-path-'><code>.parse_xml string, parse_xml_file path</code></h3>
+<h3 id='------parse_xml-string--parse_xml_file-path-'><code>.parse_xml string, parse_xml_file path</code></h3>
<p>
Returns a <code>Hash</code> for a <code>String</code> that represents XML.
</p>
-<h3 id='-----.parse_json-string,-parse_json_file-path-'><code>.parse_json string, parse_json_file path</code></h3>
+<h3 id='------parse_json-string--parse_json_file-path-'><code>.parse_json string, parse_json_file path</code></h3>
<p>
Returns a <code>Hash</code> for a <code>String</code> that represents JSON.
</p>
-<h3 id='-----.http_get-url,-extra_headers-=-{}-'><code>.http_get url, extra_headers = {}</code></h3>
+<h3 id='------http_get-url--extra_headers-=-{}-'><code>.http_get url, extra_headers = {}</code></h3>
<p>
Creates an async task to perform an HTTP GET.
</p>
-<h3 id='-----.http_post-url,-form_fields-=-{},-extra_headers-=-{}-'><code>.http_post url, form_fields = {}, extra_headers = {}</code></h3>
+<h3 id='------http_post-url--form_fields-=-{}--extra_headers-=-{}-'><code>.http_post url, form_fields = {}, extra_headers = {}</code></h3>
<p>
Creates an async task to perform an HTTP POST.
</p>
-<h3 id='-----.reset-'><code>.reset</code></h3>
+<h3 id='------reset-'><code>.reset</code></h3>
<p>
Resets the game by deleting all data in <code>args.state</code> and setting <code>args.state.tick_count</code> back to <code>0</code>.
</p>
-<h3 id='-----.stop_music-'><code>.stop_music</code></h3>
+<h3 id='------stop_music-'><code>.stop_music</code></h3>
<p>
Stops all background music.
</p>
-<h3 id='-----.calcstringbox-str,-size_enum,-font-'><code>.calcstringbox str, size_enum, font</code></h3>
+<h3 id='------calcstringbox-str--size_enum--font-'><code>.calcstringbox str, size_enum, font</code></h3>
<p>
Returns a tuple with width and height of a string being rendered.
</p>
-<h3 id='-----.slowmo!-factor-'><code>.slowmo! factor</code></h3>
+<h3 id='------slowmo!-factor-'><code>.slowmo! factor</code></h3>
<p>
Slows the game down by the factor provided.
</p>
-<h3 id='-----.notify!-string-'><code>.notify! string</code></h3>
+<h3 id='------notify!-string-'><code>.notify! string</code></h3>
<p>
Renders a toast message at the bottom of the screen.
</p>
-<h3 id='-----.system-'><code>.system</code></h3>
+<h3 id='------system-'><code>.system</code></h3>
<p>
Invokes a shell command and prints the result to the console.
</p>
-<h3 id='-----.exec-'><code>.exec</code></h3>
+<h3 id='------exec-'><code>.exec</code></h3>
<p>
Invokes a shell command and returns a <code>String</code> that represents the result.
</p>
-<h3 id='-----.save_state-'><code>.save_state</code></h3>
+<h3 id='------save_state-'><code>.save_state</code></h3>
<p>
Saves the game state to <code>game_state.txt</code>.
</p>
-<h3 id='-----.load_state-'><code>.load_state</code></h3>
+<h3 id='------load_state-'><code>.load_state</code></h3>
<p>
Load <code>args.state</code> from <code>game_state.txt</code>.
</p>
-<h3 id='-----.serialize_state-file,-state-'><code>.serialize_state file, state</code></h3>
+<h3 id='------serialize_state-file--state-'><code>.serialize_state file, state</code></h3>
<p>
Saves entity state to a file. If only one parameter is provided a string is returned for state instead of writing to a file.
</p>
-<h3 id='-----.deserialize_state-file-'><code>.deserialize_state file</code></h3>
+<h3 id='------deserialize_state-file-'><code>.deserialize_state file</code></h3>
<p>
Returns entity state from a file or serialization data represented as a <code>String</code>.
</p>
-<h3 id='-----.reset_sprite-path-'><code>.reset_sprite path</code></h3>
+<h3 id='------reset_sprite-path-'><code>.reset_sprite path</code></h3>
<p>
Invalids the texture cache of a sprite.
</p>
-<h3 id='-----.show_cursor-'><code>.show_cursor</code></h3>
+<h3 id='------show_cursor-'><code>.show_cursor</code></h3>
<p>
Shows the mouse cursor.
</p>
-<h3 id='-----.hide_cursor-'><code>.hide_cursor</code></h3>
+<h3 id='------hide_cursor-'><code>.hide_cursor</code></h3>
<p>
Hides the mouse cursor.
</p>
-<h3 id='-----.cursor_shown?-'><code>.cursor_shown?</code></h3>
+<h3 id='------cursor_shown--'><code>.cursor_shown?</code></h3>
<p>
Returns <code>true</code> if the mouse cursor is shown.
</p>
-<h3 id='-----.set_window_fullscreen-enabled-'><code>.set_window_fullscreen enabled</code></h3>
+<h3 id='------set_window_fullscreen-enabled-'><code>.set_window_fullscreen enabled</code></h3>
<p>
Sets the game to either fullscreen (<code>enabled=true</code>) or windowed (<code>enabled=false)</code>.
</p>
-<h3 id='-----.openurl-url-'><code>.openurl url</code></h3>
+<h3 id='------openurl-url-'><code>.openurl url</code></h3>
<p>
Opens a url using the Operating System's default browser.
</p>
-<h3 id='-----.get_base_dir-'><code>.get_base_dir</code></h3>
+<h3 id='------get_base_dir-'><code>.get_base_dir</code></h3>
<p>
Returns the full path of the DragonRuby binary directory.
</p>
-<h3 id='-----.get_game_dir-'><code>.get_game_dir</code></h3>
+<h3 id='------get_game_dir-'><code>.get_game_dir</code></h3>
<p>
Returns the full path of the game directory in its sandboxed environment.
</p>
@@ -1869,11 +1912,11 @@ Assuming the array is an array of arrays, Given a block, each 2D array index inv
puts occupied_tiles
end
</code></pre>
-<h1 id='--docs---array#include_any?-'>DOCS: <code>Array#include_any?</code></h1>
+<h1 id='--docs---array#include_any--'>DOCS: <code>Array#include_any?</code></h1>
<p>
Given a collection of items, the function will return <code>true</code> if any of <code>self</code>'s items exists in the collection of items passed in:
</p>
-<h1 id='--docs---array#any_intersect_rect?-'>DOCS: <code>Array#any_intersect_rect?</code></h1>
+<h1 id='--docs---array#any_intersect_rect--'>DOCS: <code>Array#any_intersect_rect?</code></h1>
<p>
Assuming the array contains objects that respond to <code>left</code>, <code>right</code>, <code>top</code>, <code>bottom</code>, this method returns <code>true</code> if any of the elements within the array intersect the object being passed in. You are given an optional parameter called <code>tolerance</code> which informs how close to the other rectangles the elements need to be for it to be considered intersecting.
</p>
@@ -2018,7 +2061,7 @@ end
</code></pre>
<h2 id='---rendering-a-solid-using-an-array-with-colors-and-alpha'>Rendering a solid using an Array with colors and alpha</h2>
<p>
-The value for the color and alpha is an number between <code>0</code> and <code>255</code>. The alpha property is optional and will be set to <code>255</code> if not specified.
+The value for the color and alpha is a number between <code>0</code> and <code>255</code>. The alpha property is optional and will be set to <code>255</code> if not specified.
</p>
<p>
Creates a green solid rectangle with an opacity of 50%.
@@ -2047,7 +2090,7 @@ end
</code></pre>
<h2 id='---rendering-a-solid-using-a-class'>Rendering a solid using a Class</h2>
<p>
-You can also create a class with solid/border properties and render it as a primitive. ALL properties must on the class. *Additionally*, a method called <code>primitive_marker</code> must be defined on the class.
+You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called <code>primitive_marker</code> must be defined on the class.
</p>
<p>
Here is an example:
@@ -2100,6 +2143,93 @@ You have to use <code>args.outputs.borders</code>:
args.outputs.borders << [100, 100, 160, 90]
end
</code></pre>
+<h1 id='--docs---gtk--outputs#sprites-'>DOCS: <code>GTK::Outputs#sprites</code></h1>
+<p>
+Add primitives to this collection to render a sprite to the screen.
+</p>
+<h2 id='---rendering-a-sprite-using-an-array'>Rendering a sprite using an Array</h2>
+<p>
+Creates a sprite of a white circle located at 100, 100. 160 pixels wide and 90 pixels tall.
+</p>
+<pre><code class="language-ruby">def tick args
+ # X Y WIDTH HEIGHT PATH
+ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png]
+end
+</code></pre>
+<h2 id='---rendering-a-sprite-using-an-array-with-colors-and-alpha'>Rendering a sprite using an Array with colors and alpha</h2>
+<p>
+The value for the color and alpha is a number between <code>0</code> and <code>255</code>. The alpha property is optional and will be set to <code>255</code> if not specified.
+</p>
+<p>
+Creates a green circle sprite with an opacity of 50%.
+</p>
+<pre><code class="language-ruby">def tick args
+ # X Y WIDTH HEIGHT PATH ANGLE ALPHA RED GREEN BLUE
+ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png", 0, 128, 0, 255, 0]
+end
+</code></pre>
+<h2 id='---rendering-a-sprite-using-a-hash'>Rendering a sprite using a Hash</h2>
+<p>
+If you want a more readable invocation. You can use the following hash to create a sprite. Any parameters that are not specified will be given a default value. The keys of the hash can be provided in any order.
+</p>
+<pre><code class="language-ruby">def tick args
+ args.outputs.sprites << {
+ x: 0,
+ y: 0,
+ w: 100,
+ h: 100,
+ path: "sprites/circle/white.png",
+ angle: 0,
+ a: 255,
+ r: 0,
+ g: 255,
+ b: 0
+ }
+end
+</code></pre>
+<h2 id='---rendering-a-solid-using-a-class'>Rendering a solid using a Class</h2>
+<p>
+You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called <code>primitive_marker</code> must be defined on the class.
+</p>
+<p>
+Here is an example:
+</p>
+<pre><code class="language-ruby"># Create type with ALL sprite properties AND primitive_marker
+class Sprite
+ attr_accessor :x, :y, :w, :h, :path, :angle, :angle_anchor_x, :angle_anchor_y, :tile_x, :tile_y, :tile_w, :tile_h, :source_x, :source_y, :source_w, :source_h, :flip_horizontally, :flip_vertically, :a, :r, :g, :b
+
+ def primitive_marker
+ :sprite
+ end
+end
+
+# Inherit from type
+class Circle < Sprite
+# constructor
+ def initialize x, y, size, path
+ self.x = x
+ self.y = y
+ self.w = size
+ self.h = size
+ self.path = path
+ end
+ def serlialize
+ {x:self.x, y:self.y, w:self.w, h:self.h, path:self.path}
+ end
+
+ def inspect
+ serlialize.to_s
+ end
+
+ def to_s
+ serlialize.to_s
+ end
+end
+def tick args
+ # render circle sprite
+ args.outputs.sprites << Circle.new(10, 10, 32,"sprites/circle/white.png")
+end
+</code></pre>
<h1 id='--docs---gtk--outputs#screenshots-'>DOCS: <code>GTK::Outputs#screenshots</code></h1>
<p>
Add a hash to this collection to take a screenshot and save as png file. The keys of the hash can be provided in any order.
@@ -2160,12 +2290,12 @@ The <code>GTK::MousePoint</code> has the following properties.
<li><code>x</code>: Integer representing the mouse's x.</li>
<li><code>y</code>: Integer representing the mouse's y.</li>
<li><code>point</code>: Array with the <code>x</code> and <code>y</code> values.</li>
-<li><code>w</code>: Width of the point that always returns <code>0</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li>
-<li><code>h</code>: Height of the point that always returns <code>0</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li>
-<li><code>left</code>: This value is the same as <code>x</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li>
-<li><code>right</code>: This value is the same as <code>x</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li>
-<li><code>top</code>: This value is the same as <code>y</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li>
-<li><code>bottom</code>: This value is the same as <code>y</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li>
+<li><code>w</code>: Width of the point that always returns <code>0</code> (included so that it can seamlessly work with <code>GTK::Geometry</code> functions).</li>
+<li><code>h</code>: Height of the point that always returns <code>0</code> (included so that it can seamlessly work with <code>GTK::Geometry</code> functions).</li>
+<li><code>left</code>: This value is the same as <code>x</code> (included so that it can seamlessly work with <code>GTK::Geometry</code> functions).</li>
+<li><code>right</code>: This value is the same as <code>x</code> (included so that it can seamlessly work with <code>GTK::Geometry</code> functions).</li>
+<li><code>top</code>: This value is the same as <code>y</code> (included so that it can seamlessly work with <code>GTK::Geometry</code> functions).</li>
+<li><code>bottom</code>: This value is the same as <code>y</code> (included so that it can seamlessly work with <code>GTK::Geometry</code> functions).</li>
<li><code>created_at</code>: The tick (<code>args.state.tick_count</code>) that this structure was created.</li>
<li><code>global_created_at</code>: The global tick (<code>Kernel.global_tick_count</code>) that this structure was created.</li>
</ul>
@@ -2322,7 +2452,7 @@ And here is an example where the override parameter is passed in:
end
end
</code></pre>
-<h1 id='--docs---numeric#elapsed?-'>DOCS: <code>Numeric#elapsed?</code></h1>
+<h1 id='--docs---numeric#elapsed--'>DOCS: <code>Numeric#elapsed?</code></h1>
<p>
Returns true if <code>Numeric#elapsed_time</code> is greater than the number. An optional parameter can be passed into <code>elapsed?</code> which is added to the number before evaluating whether <code>elapsed?</code> is true.
</p>
@@ -2386,7 +2516,7 @@ Example usage (with optional parameter):
args.state.box_queue -= boxes_to_destroy
end
</code></pre>
-<h1 id='--docs---numeric#created?-'>DOCS: <code>Numeric#created?</code></h1>
+<h1 id='--docs---numeric#created--'>DOCS: <code>Numeric#created?</code></h1>
<p>
Returns true if <code>Numeric#elapsed_time == 0</code>. Essentially communicating that number is equal to the current frame.
</p>
@@ -2455,7 +2585,7 @@ end
Follows is a source code listing for all files that have been open sourced. This code can be found in the <code>./samples</code> directory.
</p>
<h2 id='---samples'>Samples</h2>
-<h3 id='----learn-ruby-optional---beginner-ruby-primer---automation.rb'>Learn Ruby Optional - Beginner Ruby Primer - automation.rb</h3>
+<h3 id='----learn-ruby-optional---beginner-ruby-primer---automation-rb'>Learn Ruby Optional - Beginner Ruby Primer - automation.rb</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_beginner_ruby_primer/app/automation.rb
# ==========================================================================
# _ _ ________ __ _ _____ _____ _______ ______ _ _ _ _ _ _
@@ -2579,7 +2709,7 @@ $gtk.schedule_callback 400 do
end
</code></pre>
-<h3 id='----learn-ruby-optional---beginner-ruby-primer---main.rb'>Learn Ruby Optional - Beginner Ruby Primer - main.rb</h3>
+<h3 id='----learn-ruby-optional---beginner-ruby-primer---main-rb'>Learn Ruby Optional - Beginner Ruby Primer - main.rb</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_beginner_ruby_primer/app/main.rb
# ==========================================================================
# _ _ ________ __ _ _____ _____ _______ ______ _ _ _ _ _ _
@@ -2900,7 +3030,7 @@ def outputs
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---printing.txt'>Learn Ruby Optional - Intermediate Ruby Primer - printing.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---printing-txt'>Learn Ruby Optional - Intermediate Ruby Primer - printing.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/01_printing.txt
# ====================================================================================
# Commenting Code
@@ -2935,7 +3065,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---strings.txt'>Learn Ruby Optional - Intermediate Ruby Primer - strings.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---strings-txt'>Learn Ruby Optional - Intermediate Ruby Primer - strings.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/02_strings.txt
# ====================================================================================
# Strings
@@ -2954,7 +3084,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---numbers.txt'>Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---numbers-txt'>Learn Ruby Optional - Intermediate Ruby Primer - numbers.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/03_numbers.txt
# ====================================================================================
# Numerics
@@ -2979,7 +3109,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---booleans.txt'>Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---booleans-txt'>Learn Ruby Optional - Intermediate Ruby Primer - booleans.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/04_booleans.txt
# ====================================================================================
# Booleans
@@ -3015,7 +3145,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---conditionals.txt'>Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---conditionals-txt'>Learn Ruby Optional - Intermediate Ruby Primer - conditionals.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/05_conditionals.txt
# ====================================================================================
# Conditionals
@@ -3133,7 +3263,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---looping.txt'>Learn Ruby Optional - Intermediate Ruby Primer - looping.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---looping-txt'>Learn Ruby Optional - Intermediate Ruby Primer - looping.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/06_looping.txt
# ====================================================================================
# Looping
@@ -3192,7 +3322,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---functions.txt'>Learn Ruby Optional - Intermediate Ruby Primer - functions.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---functions-txt'>Learn Ruby Optional - Intermediate Ruby Primer - functions.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/07_functions.txt
# ====================================================================================
# Functions
@@ -3265,7 +3395,7 @@ repl do
end
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---arrays.txt'>Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---arrays-txt'>Learn Ruby Optional - Intermediate Ruby Primer - arrays.txt</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/08_arrays.txt
# ====================================================================================
# Arrays
@@ -3479,14 +3609,14 @@ end
# ====================================================================================
</code></pre>
-<h3 id='----learn-ruby-optional---intermediate-ruby-primer---main.rb'>Learn Ruby Optional - Intermediate Ruby Primer - main.rb</h3>
+<h3 id='----learn-ruby-optional---intermediate-ruby-primer---main-rb'>Learn Ruby Optional - Intermediate Ruby Primer - main.rb</h3>
<pre><code class="language-ruby"># ./samples/00_learn_ruby_optional/00_intermediate_ruby_primer/app/main.rb
def tick args
args.outputs.labels << [640, 380, "Open repl.rb in the text editor of your choice and follow the document.", 0, 1]
end
</code></pre>
-<h3 id='----rendering-basics---labels---main.rb'>Rendering Basics - Labels - main.rb</h3>
+<h3 id='----rendering-basics---labels---main-rb'>Rendering Basics - Labels - main.rb</h3>
<pre><code class="language-ruby"># ./samples/01_rendering_basics/01_labels/app/main.rb
=begin
@@ -3557,7 +3687,7 @@ def tick args
g: 0,
b: 200,
a: 255,
- font: "manaspc.ttf" }.label
+ font: "manaspc.ttf" }.label!
# Primitives can hold anything, and can be given a label in the following forms
args.outputs.primitives << [690 + 150, 330 - 80, "Custom font (.primitives Array)", 0, 1, 125, 0, 200, 255, "manaspc.ttf" ].label
@@ -3571,7 +3701,7 @@ def tick args
g: 0,
b: 200,
a: 255,
- font: "manaspc.ttf" }.label
+ font: "manaspc.ttf" }.label!
end
def tick_instructions args, text, y = 715
@@ -3589,7 +3719,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----rendering-basics---lines---main.rb'>Rendering Basics - Lines - main.rb</h3>
+<h3 id='----rendering-basics---lines---main-rb'>Rendering Basics - Lines - main.rb</h3>
<pre><code class="language-ruby"># ./samples/01_rendering_basics/02_lines/app/main.rb
=begin
@@ -3647,7 +3777,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----rendering-basics---solids-borders---main.rb'>Rendering Basics - Solids Borders - main.rb</h3>
+<h3 id='----rendering-basics---solids-borders---main-rb'>Rendering Basics - Solids Borders - main.rb</h3>
<pre><code class="language-ruby"># ./samples/01_rendering_basics/03_solids_borders/app/main.rb
=begin
@@ -3717,7 +3847,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----rendering-basics---sprites---main.rb'>Rendering Basics - Sprites - main.rb</h3>
+<h3 id='----rendering-basics---sprites---main-rb'>Rendering Basics - Sprites - main.rb</h3>
<pre><code class="language-ruby"># ./samples/01_rendering_basics/04_sprites/app/main.rb
=begin
@@ -3764,7 +3894,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----rendering-basics---sounds---main.rb'>Rendering Basics - Sounds - main.rb</h3>
+<h3 id='----rendering-basics---sounds---main-rb'>Rendering Basics - Sounds - main.rb</h3>
<pre><code class="language-ruby"># ./samples/01_rendering_basics/05_sounds/app/main.rb
=begin
@@ -3799,768 +3929,7 @@ def tick args
end
</code></pre>
-<h3 id='----rendering-basics---audio-mixer---main.rb'>Rendering Basics - Audio Mixer - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/01_rendering_basics/06_audio_mixer/app/main.rb
-$gtk.reset
-
-$boxsize = 30
-
-def render_sources args
- mouse_in_panel = (args.state.selected != 0) && args.inputs.mouse.position.inside_rect?([900, 450, 340, 250])
- mouse_new_down = (args.state.mouse_held == 1)
-
- if (mouse_new_down && !mouse_in_panel)
- args.state.selected = 0 # will reset below if we hit something.
- end
-
- args.audio.keys.each { |k|
- s = args.audio[k]
-
- if (mouse_new_down) && !mouse_in_panel && args.inputs.mouse.position.inside_rect?([s[:screenx], s[:screeny], $boxsize, $boxsize])
- args.state.selected = k
- args.state.dragging_source = true
- end
-
- isselected = (k == args.state.selected)
-
- if isselected && args.state.dragging_source
- # you can hang anything on the audio hashes you want, so we store the
- # actual screen position so it doesn't scale weirdly vs your mouse.
- s[:screenx] = args.inputs.mouse.x - ($boxsize / 2)
- s[:screeny] = args.inputs.mouse.y - ($boxsize / 2)
-
- s[:screeny] = 50 if s[:screeny] < 50
- s[:screeny] = (719 - $boxsize) if s[:screeny] > (719 - $boxsize)
- s[:screenx] = 0 if s[:screenx] < 0
- s[:screenx] = (1279 - $boxsize) if s[:screenx] > (1279 - $boxsize)
-
- s[:x] = ((s[:screenx] / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
- s[:y] = ((s[:screeny] / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
- end
-
- color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]
- args.outputs.primitives << [s[:screenx], s[:screeny], $boxsize, $boxsize, *color].solid
- }
-end
-
-def render_panel args
- s = args.audio[args.state.selected]
- return if s.nil?
- mouse_down = (args.state.mouse_held > 0)
-
- args.outputs.primitives << [900, 450, 340, 250, 127, 127, 200, 255].solid
- args.outputs.primitives << [1075, 690, "Source ##{args.state.selected}", 3, 1, 255, 255, 255].label
- args.outputs.primitives << [910, 660, 1230, 660, 255, 255, 255].line
- args.outputs.primitives << [910, 650, "screen: (#{s[:screenx].to_i}, #{s[:screeny].to_i})", 0, 0, 255, 255, 255].label
- args.outputs.primitives << [910, 625, "position: (#{s[:x].round(5).to_s[0..6]}, #{s[:y].round(5).to_s[0..6]})", 0, 0, 255, 255, 255].label
-
- slider = [1022, 586, 200, 7]
- if mouse_down && args.inputs.mouse.position.inside_rect?(slider)
- s[:pitch] = ((args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)) * 2.0
- end
- slidercolor = (s[:pitch] / 2.0) * 255
- args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid
- args.outputs.primitives << [910, 600, "pitch: #{s[:pitch].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label
-
- slider = [1022, 561, 200, 7]
- if mouse_down && args.inputs.mouse.position.inside_rect?(slider)
- s[:gain] = (args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)
- end
- slidercolor = s[:gain] * 255
- args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid
- args.outputs.primitives << [910, 575, "gain: #{s[:gain].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label
-
- checkbox = [1022, 533, 10, 12]
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)
- s[:looping] = !s[:looping]
- end
- checkboxcolor = s[:looping] ? 255 : 0
- args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid
- args.outputs.primitives << [910, 550, "looping:", 0, 0, 255, 255, 255].label
-
- checkbox = [1022, 508, 10, 12]
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)
- s[:paused] = !s[:paused]
- end
- checkboxcolor = s[:paused] ? 255 : 0
- args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid
- args.outputs.primitives << [910, 525, "paused:", 0, 0, 255, 255, 255].label
-
- button = [910, 460, 320, 20]
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(button)
- args.audio.delete(args.state.selected)
- args.state.selected = 0
- end
- args.outputs.primitives << [*button, 255, 0, 0, 255].solid
- args.outputs.primitives << [button[0] + (button[2] / 2), button[1]+20, "DELETE SOURCE", 0, 1, 255, 255, 0].label
-end
-
-def spawn_new_sound args, num
- input = nil
- input = "sounds/#{num}.#{(num == 6) ? 'ogg' : 'wav'}"
-
- # Spawn randomly in an area that won't be covered by UI.
- screenx = (rand * 600.0) + 200.0
- screeny = (rand * 400.0) + 100.0
-
- args.state.next_sound_index += 1
-
- # you can hang anything on the audio hashes you want, so we store the
- # actual screen position in here for convenience.
- args.audio[args.state.next_sound_index] = {
- input: input,
- screenx: screenx,
- screeny: screeny,
- x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
- y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
- z: 0.0,
- gain: 1.0,
- pitch: 1.0,
- looping: true,
- paused: false
- }
-
- args.state.selected = args.state.next_sound_index
-end
-
-def render_launcher args
- total = 6
- x = (1280 - (total * $boxsize * 3)) / 2
- y = 10
- args.outputs.primitives << [0, 0, 1280, ((y*2) + $boxsize), 127, 127, 127, 255].solid
- for i in 1..total
- args.outputs.primitives << [x, y, $boxsize, $boxsize, 255, 255, 255, 255].solid
- args.outputs.primitives << [x+8, y+28, i.to_s, 3, 0, 0, 0, 255, 255].label
- if args.inputs.mouse.click && args.inputs.mouse.click.point.inside_rect?([x, y, $boxsize, $boxsize])
- spawn_new_sound args, i
- end
- x = x + ($boxsize * 3)
- end
-end
-
-def render_ui args
- render_launcher args
- render_panel args
-end
-
-def tick args
- args.state.mouse_held ||= 0
- args.state.dragging_source ||= false
- args.state.selected ||= 0
- args.state.next_sound_index ||= 0
-
- if args.inputs.mouse.up
- args.state.mouse_held = 0
- args.state.dragging_source = false
- elsif args.inputs.mouse.down || (args.state.mouse_held > 0)
- args.state.mouse_held += 1
- else
- end
-
- args.outputs.background_color = [ 0, 0, 0, 255 ]
- render_sources args
- render_ui args
-end
-
-</code></pre>
-<h3 id='----rendering-basics---sound-synthesis---main.rb'>Rendering Basics - Sound Synthesis - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/01_rendering_basics/07_sound_synthesis/app/main.rb
-begin # region: top level tick methods
- def tick args
- defaults args
- render args
- input args
- process_audio_queue args
- end
-
- def defaults args
- args.state.sine_waves ||= {}
- args.state.square_waves ||= {}
- args.state.saw_tooth_waves ||= {}
- args.state.triangle_waves ||= {}
- args.state.audio_queue ||= []
- args.state.buttons ||= [
- (frequency_buttons args),
- (sine_wave_note_buttons args),
- (bell_buttons args),
- (square_wave_note_buttons args),
- (saw_tooth_wave_note_buttons args),
- (triangle_wave_note_buttons args),
- ].flatten
- end
-
- def render args
- args.outputs.borders << args.state.buttons.map { |b| b[:border] }
- args.outputs.labels << args.state.buttons.map { |b| b[:label] }
- args.outputs.labels << args.layout
- .rect(row: 0, col: 11.5)
- .yield_self { |r| r.merge y: r.y + r.h }
- .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",
- alignment_enum: 1)
- end
-
-
- def input args
- args.state.buttons.each do |b|
- if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])
- parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "
- args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"
- send b[:method_to_call], args, b
- end
- end
-
- if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))
- args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'
- end
- end
-
- def process_audio_queue args
- to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }
- args.state.audio_queue -= to_queue
- to_queue.each { |a| args.audio[a[:id]] = a }
-
- args.audio.find_all { |k, v| v[:decay_rate] }
- .each { |k, v| v[:gain] -= v[:decay_rate] }
-
- sounds_to_stop = args.audio
- .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }
- .map { |k, v| k }
-
- sounds_to_stop.each { |k| args.audio.delete k }
- end
-end
-
-begin # region: button definitions, ui layout, callback functions
- def button args, opts
- button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
-
- button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
-
- label_offset_x = 5
- label_offset_y = 30
-
- button_def[:label] = button_def[:rect].merge text: opts[:text],
- size_enum: -2.5,
- x: button_def[:rect].x + label_offset_x,
- y: button_def[:rect].y + label_offset_y
-
- button_def
- end
-
- def play_sine_wave args, sender
- queue_sine_wave args,
- frequency: sender[:frequency],
- duration: 1.seconds,
- fade_out: true
- end
-
- def play_note args, sender
- method_to_call = :queue_sine_wave
- method_to_call = :queue_square_wave if sender[:type] == :square
- method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth
- method_to_call = :queue_triangle_wave if sender[:type] == :triangle
- method_to_call = :queue_bell if sender[:type] == :bell
-
- send method_to_call, args,
- frequency: (frequency_for note: sender[:note], octave: sender[:octave]),
- duration: 1.seconds,
- fade_out: true
- end
-
- def frequency_buttons args
- [
- (button args,
- row: 4.0, col: 0, text: "300hz",
- frequency: 300,
- method_to_call: :play_sine_wave),
- (button args,
- row: 5.0, col: 0, text: "400hz",
- frequency: 400,
- method_to_call: :play_sine_wave),
- (button args,
- row: 6.0, col: 0, text: "500hz",
- frequency: 500,
- method_to_call: :play_sine_wave),
- ]
- end
-
- def sine_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 2, text: "Sine C4",
- note: :c, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 2, text: "Sine D4",
- note: :d, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 2, text: "Sine E4",
- note: :e, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 2, text: "Sine F4",
- note: :f, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 2, text: "Sine G4",
- note: :g, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 2, text: "Sine A5",
- note: :a, octave: 5, type: :sine, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 2, text: "Sine B5",
- note: :b, octave: 5, type: :sine, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 2, text: "Sine C5",
- note: :c, octave: 5, type: :sine, method_to_call: :play_note),
- ]
- end
-
- def square_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 6, text: "Square C4",
- note: :c, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 6, text: "Square D4",
- note: :d, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 6, text: "Square E4",
- note: :e, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 6, text: "Square F4",
- note: :f, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 6, text: "Square G4",
- note: :g, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 6, text: "Square A5",
- note: :a, octave: 5, type: :square, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 6, text: "Square B5",
- note: :b, octave: 5, type: :square, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 6, text: "Square C5",
- note: :c, octave: 5, type: :square, method_to_call: :play_note),
- ]
- end
- def saw_tooth_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 8, text: "Saw C4",
- note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 8, text: "Saw D4",
- note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 8, text: "Saw E4",
- note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 8, text: "Saw F4",
- note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 8, text: "Saw G4",
- note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 8, text: "Saw A5",
- note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 8, text: "Saw B5",
- note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 8, text: "Saw C5",
- note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),
- ]
- end
-
- def triangle_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 10, text: "Triangle C4",
- note: :c, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 10, text: "Triangle D4",
- note: :d, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 10, text: "Triangle E4",
- note: :e, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 10, text: "Triangle F4",
- note: :f, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 10, text: "Triangle G4",
- note: :g, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 10, text: "Triangle A5",
- note: :a, octave: 5, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 10, text: "Triangle B5",
- note: :b, octave: 5, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 10, text: "Triangle C5",
- note: :c, octave: 5, type: :triangle, method_to_call: :play_note),
- ]
- end
-
- def bell_buttons args
- [
- (button args,
- row: 1.5, col: 4, text: "Bell C4",
- note: :c, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 4, text: "Bell D4",
- note: :d, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 4, text: "Bell E4",
- note: :e, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 4, text: "Bell F4",
- note: :f, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 4, text: "Bell G4",
- note: :g, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 4, text: "Bell A5",
- note: :a, octave: 5, type: :bell, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 4, text: "Bell B5",
- note: :b, octave: 5, type: :bell, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 4, text: "Bell C5",
- note: :c, octave: 5, type: :bell, method_to_call: :play_note),
- ]
- end
-end
-
-begin # region: wave generation
- begin # sine wave
- def defaults_sine_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def sine_wave_for opts = {}
- opts = defaults_sine_wave_for.merge opts
- frequency = opts[:frequency]
- sample_rate = opts[:sample_rate]
- period_size = (sample_rate.fdiv frequency).ceil
- period_size.map_with_index do |i|
- Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)
- end.to_a
- end
-
- def defaults_queue_sine_wave
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
- end
-
- def queue_sine_wave args, opts = {}
- opts = defaults_queue_sine_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.sine_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: sine_wave
- end
- end
-
- begin # region: square wave
- def defaults_square_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def square_wave_for opts = {}
- opts = defaults_square_wave_for.merge opts
- sine_wave = sine_wave_for opts
- sine_wave.map do |v|
- if v >= 0
- 1.0
- else
- -1.0
- end
- end.to_a
- end
-
- def defaults_queue_square_wave
- { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
- end
-
- def queue_square_wave args, opts = {}
- opts = defaults_queue_square_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.square_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: square_wave
- end
- end
-
- begin # region: saw tooth wave
- def defaults_saw_tooth_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def saw_tooth_wave_for opts = {}
- opts = defaults_saw_tooth_wave_for.merge opts
- sine_wave = sine_wave_for opts
- period_size = sine_wave.length
- sine_wave.map_with_index do |v, i|
- (((i % period_size).fdiv period_size) * 2) - 1
- end
- end
-
- def defaults_queue_saw_tooth_wave
- { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
- end
-
- def queue_saw_tooth_wave args, opts = {}
- opts = defaults_queue_saw_tooth_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: saw_tooth_wave
- end
- end
-
- begin # region: triangle wave
- def defaults_triangle_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def triangle_wave_for opts = {}
- opts = defaults_saw_tooth_wave_for.merge opts
- sine_wave = sine_wave_for opts
- period_size = sine_wave.length
- sine_wave.map_with_index do |v, i|
- ratio = (i.fdiv period_size)
- if ratio <= 0.5
- (ratio * 4) - 1
- else
- ratio -= 0.5
- 1 - (ratio * 4)
- end
- end
- end
-
- def defaults_queue_triangle_wave
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
- end
-
- def queue_triangle_wave args, opts = {}
- opts = defaults_queue_triangle_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.triangle_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: triangle_wave
- end
- end
-
- begin # region: bell
- def defaults_queue_bell
- { frequency: 440, duration: 1.seconds, queue_in: 0 }
- end
-
- def queue_bell args, opts = {}
- (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }
- end
-
- def bell_harmonics
- [
- { frequency_ratio: 0.5, duration_ratio: 1.00 },
- { frequency_ratio: 1.0, duration_ratio: 0.80 },
- { frequency_ratio: 2.0, duration_ratio: 0.60 },
- { frequency_ratio: 3.0, duration_ratio: 0.40 },
- { frequency_ratio: 4.2, duration_ratio: 0.25 },
- { frequency_ratio: 5.4, duration_ratio: 0.20 },
- { frequency_ratio: 6.8, duration_ratio: 0.15 }
- ]
- end
-
- def defaults_bell_to_sine_waves
- { frequency: 440, duration: 1.seconds, queue_in: 0 }
- end
-
- def bell_to_sine_waves opts = {}
- opts = defaults_bell_to_sine_waves.merge opts
- bell_harmonics.map do |b|
- {
- frequency: opts[:frequency] * b[:frequency_ratio],
- duration: opts[:duration] * b[:duration_ratio],
- queue_in: opts[:queue_in],
- gain: (1.fdiv bell_harmonics.length),
- fade_out: true
- }
- end
- end
- end
-
- begin # audio entity construction
- def generate_audio_data sine_wave, sample_rate
- sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil
- copy_count = (sample_size.fdiv sine_wave.length).ceil
- sine_wave * copy_count
- end
-
- def defaults_new_audio_state
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
- end
-
- def new_audio_state args, opts = {}
- opts = defaults_new_audio_state.merge opts
- decay_rate = 0
- decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]
- frequency = opts[:frequency]
- sample_rate = 48000
-
- {
- id: (new_id! args),
- frequency: frequency,
- sample_rate: 48000,
- stop_at: args.tick_count + opts[:queue_in] + opts[:duration],
- gain: opts[:gain].to_f,
- queue_at: args.state.tick_count + opts[:queue_in],
- decay_rate: decay_rate,
- pitch: 1.0,
- looping: true,
- paused: false
- }
- end
-
- def queue_audio args, opts = {}
- graph_wave args, opts[:wave], opts[:audio_state][:frequency]
- args.state.audio_queue << opts[:audio_state]
- end
-
- def new_id! args
- args.state.audio_id ||= 0
- args.state.audio_id += 1
- end
-
- def graph_wave args, wave, frequency
- if args.state.tick_count != args.state.graphed_at
- args.outputs.static_lines.clear
- args.outputs.static_sprites.clear
- end
-
- wave = wave
-
- r, g, b = frequency.to_i % 85,
- frequency.to_i % 170,
- frequency.to_i % 255
-
- starting_rect = args.layout.rect(row: 5, col: 13)
- x_scale = 10
- y_scale = 100
- max_points = 25
-
- points = wave
- if wave.length > max_points
- resolution = wave.length.idiv max_points
- points = wave.find_all.with_index { |y, i| (i % resolution == 0) }
- end
-
- args.outputs.static_lines << points.map_with_index do |y, x|
- next_y = points[x + 1]
-
- if next_y
- {
- x: starting_rect.x + (x * x_scale),
- y: starting_rect.y + starting_rect.h.half + y_scale * y,
- x2: starting_rect.x + ((x + 1) * x_scale),
- y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,
- r: r,
- g: g,
- b: b
- }
- end
- end
-
- args.outputs.static_sprites << points.map_with_index do |y, x|
- {
- x: (starting_rect.x + (x * x_scale)) - 2,
- y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,
- w: 4,
- h: 4,
- path: 'sprites/square-white.png',
- r: r,
- g: g,
- b: b
- }
- end
-
- args.state.graphed_at = args.state.tick_count
- end
- end
-
- begin # region: musical note mapping
- def defaults_frequency_for
- { note: :a, octave: 5, sharp: false, flat: false }
- end
-
- def frequency_for opts = {}
- opts = defaults_frequency_for.merge opts
- octave_offset_multiplier = opts[:octave] - 5
- note = note_frequencies_octave_5[opts[:note]]
- if octave_offset_multiplier < 0
- note = note * 1 / (octave_offset_multiplier.abs + 1)
- elsif octave_offset_multiplier > 0
- note = note * (octave_offset_multiplier.abs + 1) / 1
- end
- note
- end
-
- def note_frequencies_octave_5
- {
- a: 440.0,
- a_sharp: 466.16, b_flat: 466.16,
- b: 493.88,
- c: 523.25,
- c_sharp: 554.37, d_flat: 587.33,
- d: 587.33,
- d_sharp: 622.25, e_flat: 659.25,
- e: 659.25,
- f: 698.25,
- f_sharp: 739.99, g_flat: 739.99,
- g: 783.99,
- g_sharp: 830.61, a_flat: 830.61
- }
- end
- end
-end
-
-$gtk.reset
-
-</code></pre>
-<h3 id='----input-basics---keyboard---main.rb'>Input Basics - Keyboard - main.rb</h3>
+<h3 id='----input-basics---keyboard---main-rb'>Input Basics - Keyboard - main.rb</h3>
<pre><code class="language-ruby"># ./samples/02_input_basics/01_keyboard/app/main.rb
=begin
@@ -4589,9 +3958,9 @@ APIs listing that haven't been encountered in a previous sample apps:
def tick args
tick_instructions args, "Sample app shows how keyboard events are registered and accessed.", 360
# Notice how small_font accounts for all the remaining parameters
- args.outputs.labels << [460, row_to_px(args, 0), "Current game time: #{args.state.tick_count}", small_font]
- args.outputs.labels << [460, row_to_px(args, 2), "Keyboard input: args.inputs.keyboard.key_up.h", small_font]
- args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 0), text: "Current game time: #{args.state.tick_count}", size_enum: -1 }
+ args.outputs.labels << { x: 460, y: row_to_px(args, 2), text: "Keyboard input: args.inputs.keyboard.key_up.h", size_enum: -1 }
+ args.outputs.labels << { x: 460, y: row_to_px(args, 3), text: "Press \"h\" on the keyboard.", size_enum: -1 }
# Input on a specifc key can be found through args.inputs.keyboard.key_up followed by the key
if args.inputs.keyboard.key_up.h
@@ -4602,27 +3971,19 @@ def tick args
args.state.h_pressed_at ||= false
if args.state.h_pressed_at
- args.outputs.labels << [460, row_to_px(args, 4), "\"h\" was pressed at time: #{args.state.h_pressed_at}", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" was pressed at time: #{args.state.h_pressed_at}", size_enum: -1 }
else
- args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" has never been pressed.", size_enum: -1 }
end
tick_help_text args
end
-def small_font
- # This method provides some values for the construction of labels
- # Specifically, Size, Alignment, & RGBA
- # This makes it so that custom parameters don't have to be repeatedly typed.
- # Additionally "small_font" provides programmers with more information than some numbers
- [-2, 0, 0, 0, 0, 255]
-end
-
-def row_to_px args, row_number
+def row_to_px args, row_number, y_offset = 20
# This takes a row_number and converts it to pixels DragonRuby understands.
# Row 0 starts 5 units below the top of the grid
# Each row afterward is 20 units lower
- args.grid.top.shift_down(5).shift_down(20 * row_number)
+ args.grid.top - 5 - (y_offset * row_number)
end
# Don't worry about understanding the code within this method just yet.
@@ -4652,17 +4013,17 @@ def tick_help_text args
end
end
- args.outputs.labels << [10, row_to_px(args, 6), "Advanced Help:", small_font]
+ args.outputs.labels << { x: 10, y: row_to_px(args, 6), text: "This is the api for the keys you've pressed:", size_enum: -1, r: 180 }
if !args.state.help_available
args.outputs.labels << [10, row_to_px(args, 7), "Press a key and I'll show code to access the key and what value will be returned if you used the code.", small_font]
return
end
- args.outputs.labels << [10 , row_to_px(args, 7), "args.inputs.keyboard", small_font]
- args.outputs.labels << [330, row_to_px(args, 7), "args.inputs.keyboard.key_down", small_font]
- args.outputs.labels << [650, row_to_px(args, 7), "args.inputs.keyboard.key_held", small_font]
- args.outputs.labels << [990, row_to_px(args, 7), "args.inputs.keyboard.key_up", small_font]
+ args.outputs.labels << { x: 10 , y: row_to_px(args, 7), text: "args.inputs.keyboard", size_enum: -2 }
+ args.outputs.labels << { x: 330, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_down", size_enum: -2 }
+ args.outputs.labels << { x: 650, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_held", size_enum: -2 }
+ args.outputs.labels << { x: 990, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_up", size_enum: -2 }
fill_history args, :key_value_history, :down_or_held, nil
fill_history args, :key_down_value_history, :down, :key_down
@@ -4708,12 +4069,8 @@ def render_help_labels args, history_key, state_key, keyboard_method, x
end
idx += 2
[
- [x, row_to_px(args, idx - 2),
- " .#{k} is #{current_value || "nil"}",
- small_font],
- [x, row_to_px(args, idx - 1),
- " was #{v}",
- small_font]
+ { x: x, y: row_to_px(args, idx + 0, 16), text: " .#{k} is #{current_value || "nil"}", size_enum: -2 },
+ { x: x, y: row_to_px(args, idx + 1, 16), text: " was #{v}", size_enum: -2 }
]
end
end
@@ -4728,13 +4085,49 @@ def tick_instructions args, text, y = 715
args.state.key_event_occurred = true
end
- args.outputs.debug << [0, y - 50, 1280, 60].solid
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+ args.outputs.debug << { x: 640, y: y, text: text,
+ size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)",
+ size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
</code></pre>
-<h3 id='----input-basics---mouse---main.rb'>Input Basics - Mouse - main.rb</h3>
+<h3 id='----input-basics---moving-a-sprite---main-rb'>Input Basics - Moving A Sprite - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/02_input_basics/01_moving_a_sprite/app/main.rb
+def tick args
+ # create a player and set default values
+ # for the player's x, y, w (width), and h (height)
+ args.state.player.x ||= 100
+ args.state.player.y ||= 100
+ args.state.player.w ||= 50
+ args.state.player.h ||= 50
+
+ # render the player to the screen
+ 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' }
+
+ # move the player around using the keyboard
+ if args.inputs.up
+ args.state.player.y += 10
+ elsif args.inputs.down
+ args.state.player.y -= 10
+ end
+
+ if args.inputs.left
+ args.state.player.x -= 10
+ elsif args.inputs.right
+ args.state.player.x += 10
+ end
+end
+
+$gtk.reset
+
+</code></pre>
+<h3 id='----input-basics---mouse---main-rb'>Input Basics - Mouse - main.rb</h3>
<pre><code class="language-ruby"># ./samples/02_input_basics/02_mouse/app/main.rb
=begin
@@ -4799,11 +4192,7 @@ def small_label args, x, row, message
# This method effectively combines the row_to_px and small_font methods
# It changes the given row value to a DragonRuby pixel value
# and adds the customization parameters
- [x, row_to_px(args, row), message, small_font]
-end
-
-def small_font
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, alignment_enum: -2 }
end
def row_to_px args, row_number
@@ -4819,13 +4208,13 @@ def tick_instructions args, text, y = 715
args.state.key_event_occurred = true
end
- args.outputs.debug << [0, y - 50, 1280, 60].solid
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
</code></pre>
-<h3 id='----input-basics---mouse-point-to-rect---main.rb'>Input Basics - Mouse Point To Rect - main.rb</h3>
+<h3 id='----input-basics---mouse-point-to-rect---main-rb'>Input Basics - Mouse Point To Rect - main.rb</h3>
<pre><code class="language-ruby"># ./samples/02_input_basics/03_mouse_point_to_rect/app/main.rb
=begin
@@ -4871,7 +4260,7 @@ def tick args
args.outputs.labels << small_label(args, x, 15, "Click inside the blue box maybe ---->")
- box = [785, 370, 50, 50, 0, 0, 170]
+ box = { x: 785, y: 370, w: 50, h: 50, r: 0, g: 0, b: 170 }
args.outputs.borders << box
# Saves the most recent click into args.state
@@ -4893,11 +4282,7 @@ def tick args
end
def small_label args, x, row, message
- [x, row_to_px(args, row), message, small_font]
-end
-
-def small_font
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }
end
def row_to_px args, row_number
@@ -4913,13 +4298,13 @@ def tick_instructions args, text, y = 715
args.state.key_event_occurred = true
end
- args.outputs.debug << [0, y - 50, 1280, 60].solid
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
</code></pre>
-<h3 id='----input-basics---mouse-rect-to-rect---main.rb'>Input Basics - Mouse Rect To Rect - main.rb</h3>
+<h3 id='----input-basics---mouse-rect-to-rect---main-rb'>Input Basics - Mouse Rect To Rect - main.rb</h3>
<pre><code class="language-ruby"># ./samples/02_input_basics/04_mouse_rect_to_rect/app/main.rb
=begin
@@ -4965,9 +4350,15 @@ def tick args
# They are stored in game so that they do not get reset every tick
if args.inputs.mouse.click
if !args.state.box_collision_one
- args.state.box_collision_one = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 180, 0, 0, 180]
+ args.state.box_collision_one = { x: args.inputs.mouse.click.point.x - 25,
+ y: args.inputs.mouse.click.point.y - 25,
+ w: 125, h: 125,
+ r: 180, g: 0, b: 0, a: 180 }
elsif !args.state.box_collision_two
- args.state.box_collision_two = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 0, 0, 180, 180]
+ args.state.box_collision_two = { x: args.inputs.mouse.click.point.x - 25,
+ y: args.inputs.mouse.click.point.y - 25,
+ w: 125, h: 125,
+ r: 0, g: 0, b: 180, a: 180 }
else
args.state.box_collision_one = nil
args.state.box_collision_two = nil
@@ -4994,15 +4385,11 @@ def tick args
end
def small_label args, x, row, message
- [x, row_to_px(args, row), message, small_font]
-end
-
-def small_font
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }
end
def row_to_px args, row_number
- args.grid.top.shift_down(5).shift_down(20 * row_number)
+ args.grid.top - 5 - (20 * row_number)
end
def tick_instructions args, text, y = 715
@@ -5020,7 +4407,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----input-basics---controller---main.rb'>Input Basics - Controller - main.rb</h3>
+<h3 id='----input-basics---controller---main-rb'>Input Basics - Controller - main.rb</h3>
<pre><code class="language-ruby"># ./samples/02_input_basics/05_controller/app/main.rb
=begin
@@ -5066,57 +4453,51 @@ class ControllerDemo
def process_inputs
state.buttons = []
- state.buttons << [100, 500, inputs.controller_one.key_held.l1, "L1"]
- state.buttons << [100, 600, inputs.controller_one.key_held.l2, "L2"]
-
- state.buttons << [1100, 500, inputs.controller_one.key_held.r1, "R1"]
- state.buttons << [1100, 600, inputs.controller_one.key_held.r2, "R2"]
-
- state.buttons << [540, 450, inputs.controller_one.key_held.select, "Select"]
- state.buttons << [660, 450, inputs.controller_one.key_held.start, "Start"]
-
- state.buttons << [200, 300, inputs.controller_one.key_held.left, "Left"]
- state.buttons << [300, 400, inputs.controller_one.key_held.up, "Up"]
- state.buttons << [400, 300, inputs.controller_one.key_held.right, "Right"]
- state.buttons << [300, 200, inputs.controller_one.key_held.down, "Down"]
-
- state.buttons << [800, 300, inputs.controller_one.key_held.x, "X"]
- state.buttons << [900, 400, inputs.controller_one.key_held.y, "Y"]
- state.buttons << [1000, 300, inputs.controller_one.key_held.a, "A"]
- state.buttons << [900, 200, inputs.controller_one.key_held.b, "B"]
-
- state.buttons << [450 + inputs.controller_one.left_analog_x_perc * 100,
- 100 + inputs.controller_one.left_analog_y_perc * 100,
- inputs.controller_one.key_held.l3,
- "L3"]
-
- state.buttons << [750 + inputs.controller_one.right_analog_x_perc * 100,
- 100 + inputs.controller_one.right_analog_y_perc * 100,
- inputs.controller_one.key_held.r3,
- "R3"]
+ state.buttons << { x: 100, y: 500, active: inputs.controller_one.key_held.l1, text: "L1"}
+ state.buttons << { x: 100, y: 600, active: inputs.controller_one.key_held.l2, text: "L2"}
+ state.buttons << { x: 1100, y: 500, active: inputs.controller_one.key_held.r1, text: "R1"}
+ state.buttons << { x: 1100, y: 600, active: inputs.controller_one.key_held.r2, text: "R2"}
+ state.buttons << { x: 540, y: 450, active: inputs.controller_one.key_held.select, text: "Select"}
+ state.buttons << { x: 660, y: 450, active: inputs.controller_one.key_held.start, text: "Start"}
+ state.buttons << { x: 200, y: 300, active: inputs.controller_one.key_held.left, text: "Left"}
+ state.buttons << { x: 300, y: 400, active: inputs.controller_one.key_held.up, text: "Up"}
+ state.buttons << { x: 400, y: 300, active: inputs.controller_one.key_held.right, text: "Right"}
+ state.buttons << { x: 300, y: 200, active: inputs.controller_one.key_held.down, text: "Down"}
+ state.buttons << { x: 800, y: 300, active: inputs.controller_one.key_held.x, text: "X"}
+ state.buttons << { x: 900, y: 400, active: inputs.controller_one.key_held.y, text: "Y"}
+ state.buttons << { x: 1000, y: 300, active: inputs.controller_one.key_held.a, text: "A"}
+ state.buttons << { x: 900, y: 200, active: inputs.controller_one.key_held.b, text: "B"}
+ state.buttons << { x: 450 + inputs.controller_one.left_analog_x_perc * 100,
+ y: 100 + inputs.controller_one.left_analog_y_perc * 100,
+ active: inputs.controller_one.key_held.l3,
+ text: "L3" }
+ state.buttons << { x: 750 + inputs.controller_one.right_analog_x_perc * 100,
+ y: 100 + inputs.controller_one.right_analog_y_perc * 100,
+ active: inputs.controller_one.key_held.r3,
+ text: "R3" }
end
# Gives each button a square shape.
# If the button is being pressed or held (which means it is considered active),
# the square is filled in. Otherwise, the button simply has a border.
def render
- state.buttons.each do |x, y, active, text|
- rect = [x, y, 75, 75]
+ state.buttons.each do |b|
+ rect = { x: b.x, y: b.y, w: 75, h: 75 }
- if active # if button is pressed
+ if b.active # if button is pressed
outputs.solids << rect # rect is output as solid (filled in)
else
outputs.borders << rect # otherwise, output as border
end
# Outputs the text of each button using labels.
- outputs.labels << [x, y + 95, text] # add 95 to place label above button
+ outputs.labels << { x: b.x, y: b.y + 95, text: b.text } # add 95 to place label above button
end
- outputs.labels << [10, 60, "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)"]
- outputs.labels << [10, 30, "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)"]
- outputs.labels << [900, 60, "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)"]
- outputs.labels << [900, 30, "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)"]
+ outputs.labels << { x: 10, y: 60, text: "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)" }
+ outputs.labels << { x: 10, y: 30, text: "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)" }
+ outputs.labels << { x: 900, y: 60, text: "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)" }
+ outputs.labels << { x: 900, y: 30, text: "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)" }
end
end
@@ -5150,7 +4531,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----input-basics---touch---main.rb'>Input Basics - Touch - main.rb</h3>
+<h3 id='----input-basics---touch---main-rb'>Input Basics - Touch - main.rb</h3>
<pre><code class="language-ruby"># ./samples/02_input_basics/06_touch/app/main.rb
def tick args
args.outputs.background_color = [ 0, 0, 0 ]
@@ -5165,10 +4546,12 @@ def tick args
# the next new touch will be finger_one again, but until then, new touches
# don't fill in earlier slots.
if !args.inputs.finger_one.nil?
- args.outputs.primitives << [640, 650, "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).", 5, 1, 255, 255, 255].label
+ args.outputs.primitives << { x: 640, y: 650, text: "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).",
+ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
if !args.inputs.finger_two.nil?
- args.outputs.primitives << [640, 600, "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).", 5, 1, 255, 255, 255].label
+ args.outputs.primitives << { x: 640, y: 600, text: "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).",
+ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
# Here's the more flexible interface: this will report as many simultaneous
@@ -5189,14 +4572,13 @@ def tick args
r = (color & 0xFF0000) >> 16
g = (color & 0x00FF00) >> 8
b = (color & 0x0000FF)
- args.outputs.primitives << [v.x - (size / 2), v.y + (size / 2), size, size, r, g, b, 255].solid
- args.outputs.primitives << [v.x, v.y + size, k.to_s, 0, 1, 0, 0, 0].label
+ args.outputs.primitives << { x: v.x - (size / 2), y: v.y + (size / 2), w: size, h: size, r: r, g: g, b: b, a: 255 }.solid!
+ args.outputs.primitives << { x: v.x, y: v.y + size, text: k.to_s, alignment_enum: 1 }.label!
}
end
-
</code></pre>
-<h3 id='----rendering-sprites---animation-using-separate-pngs---main.rb'>Rendering Sprites - Animation Using Separate Pngs - main.rb</h3>
+<h3 id='----rendering-sprites---animation-using-separate-pngs---main-rb'>Rendering Sprites - Animation Using Separate Pngs - main.rb</h3>
<pre><code class="language-ruby"># ./samples/03_rendering_sprites/01_animation_using_separate_pngs/app/main.rb
=begin
@@ -5231,6 +4613,8 @@ end
# in this tick "entry point": `looping_animation`, and the
# second method is `one_time_animation`.
def tick args
+ # uncomment the line below to see animation play out in slow motion
+ # args.gtk.slowmo! 6
looping_animation args
one_time_animation args
end
@@ -5263,22 +4647,22 @@ def looping_animation args
does_sprite_loop
# Now that we have `sprite_index, we can present the correct file.
- args.outputs.sprites << [100, 100, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]
+ args.outputs.sprites << { x: 100, y: 100, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }
# Try changing the numbers below to see how the animation changes:
- args.outputs.sprites << [100, 200, 100, 100, "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png"]
+ args.outputs.sprites << { x: 100, y: 200, w: 100, h: 100, path: "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png" }
end
# This function shows how to animate a sprite that executes
# only once when the "f" key is pressed.
def one_time_animation args
# This is just a label the shows instructions within the game.
- args.outputs.labels << [220, 350, "(press f to animate)"]
+ args.outputs.labels << { x: 220, y: 350, text: "(press f to animate)" }
# If "f" is pressed on the keyboard...
if args.inputs.keyboard.key_down.f
# Print the frame that "f" was pressed on.
- puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.inputs.keyboard.key_down.f}"
+ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.state.tick_count}"
# And MOST IMPORTANTLY set the point it time to start the animation,
# equal to "now" which is represented as args.state.tick_count.
@@ -5311,7 +4695,7 @@ def one_time_animation args
sprite_index ||= 0
# Present the sprite.
- args.outputs.sprites << [100, 300, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]
+ args.outputs.sprites << { x: 100, y: 300, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }
tick_instructions args, "Sample app shows how to use Numeric#frame_index and string interpolation to animate a sprite over time."
end
@@ -5331,7 +4715,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----rendering-sprites---animation-using-sprite-sheet---main.rb'>Rendering Sprites - Animation Using Sprite Sheet - main.rb</h3>
+<h3 id='----rendering-sprites---animation-using-sprite-sheet---main-rb'>Rendering Sprites - Animation Using Sprite Sheet - main.rb</h3>
<pre><code class="language-ruby"># ./samples/03_rendering_sprites/02_animation_using_sprite_sheet/app/main.rb
def tick args
args.state.player.x ||= 100
@@ -5433,7 +4817,7 @@ def running_sprite args
end
</code></pre>
-<h3 id='----rendering-sprites---animation-states---main.rb'>Rendering Sprites - Animation States - main.rb</h3>
+<h3 id='----rendering-sprites---animation-states---main-rb'>Rendering Sprites - Animation States - main.rb</h3>
<pre><code class="language-ruby"># ./samples/03_rendering_sprites/03_animation_states/app/main.rb
class Game
attr_gtk
@@ -5620,7 +5004,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----rendering-sprites---color-and-rotation---main.rb'>Rendering Sprites - Color And Rotation - main.rb</h3>
+<h3 id='----rendering-sprites---color-and-rotation---main-rb'>Rendering Sprites - Color And Rotation - main.rb</h3>
<pre><code class="language-ruby"># ./samples/03_rendering_sprites/04_color_and_rotation/app/main.rb
=begin
APIs listing that haven't been encountered in previous sample apps:
@@ -5850,7 +5234,7 @@ def source_rect state
end
</code></pre>
-<h3 id='----physics-and-collisions---simple---main.rb'>Physics And Collisions - Simple - main.rb</h3>
+<h3 id='----physics-and-collisions---simple---main-rb'>Physics And Collisions - Simple - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/01_simple/app/main.rb
=begin
@@ -5962,7 +5346,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----physics-and-collisions---moving-objects---main.rb'>Physics And Collisions - Moving Objects - main.rb</h3>
+<h3 id='----physics-and-collisions---moving-objects---main-rb'>Physics And Collisions - Moving Objects - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/02_moving_objects/app/main.rb
=begin
@@ -6266,7 +5650,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----physics-and-collisions---entities---main.rb'>Physics And Collisions - Entities - main.rb</h3>
+<h3 id='----physics-and-collisions---entities---main-rb'>Physics And Collisions - Entities - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/03_entities/app/main.rb
=begin
@@ -6421,7 +5805,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----physics-and-collisions---box-collision---main.rb'>Physics And Collisions - Box Collision - main.rb</h3>
+<h3 id='----physics-and-collisions---box-collision---main-rb'>Physics And Collisions - Box Collision - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/04_box_collision/app/main.rb
=begin
@@ -6762,7 +6146,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----physics-and-collisions---box-collision-2---main.rb'>Physics And Collisions - Box Collision 2 - main.rb</h3>
+<h3 id='----physics-and-collisions---box-collision-2---main-rb'>Physics And Collisions - Box Collision 2 - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/05_box_collision_2/app/main.rb
=begin
APIs listing that haven't been encountered in previous sample apps:
@@ -7236,7 +6620,7 @@ def tick args
end
</code></pre>
-<h3 id='----physics-and-collisions---box-collision-3---main.rb'>Physics And Collisions - Box Collision 3 - main.rb</h3>
+<h3 id='----physics-and-collisions---box-collision-3---main-rb'>Physics And Collisions - Box Collision 3 - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/06_box_collision_3/app/main.rb
class Game
attr_gtk
@@ -7286,9 +6670,9 @@ class Game
mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode
if state.mouse_held
- outputs.primitives << mouse_overlay.border
+ outputs.primitives << mouse_overlay.border!
else
- outputs.primitives << mouse_overlay.solid
+ outputs.primitives << mouse_overlay.solid!
end
end
@@ -7495,7 +6879,7 @@ def tick args
end
</code></pre>
-<h3 id='----physics-and-collisions---jump-physics---main.rb'>Physics And Collisions - Jump Physics - main.rb</h3>
+<h3 id='----physics-and-collisions---jump-physics---main-rb'>Physics And Collisions - Jump Physics - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/07_jump_physics/app/main.rb
=begin
@@ -7695,7 +7079,7 @@ def tick args
end
</code></pre>
-<h3 id='----physics-and-collisions---bouncing-on-collision---ball.rb'>Physics And Collisions - Bouncing On Collision - ball.rb</h3>
+<h3 id='----physics-and-collisions---bouncing-on-collision---ball-rb'>Physics And Collisions - Bouncing On Collision - ball.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/ball.rb
GRAVITY = -0.08
@@ -7786,7 +7170,7 @@ class Ball
end
</code></pre>
-<h3 id='----physics-and-collisions---bouncing-on-collision---block.rb'>Physics And Collisions - Bouncing On Collision - block.rb</h3>
+<h3 id='----physics-and-collisions---bouncing-on-collision---block-rb'>Physics And Collisions - Bouncing On Collision - block.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/block.rb
DEGREES_TO_RADIANS = Math::PI / 180
@@ -7949,7 +7333,7 @@ class Block
end
</code></pre>
-<h3 id='----physics-and-collisions---bouncing-on-collision---cannon.rb'>Physics And Collisions - Bouncing On Collision - cannon.rb</h3>
+<h3 id='----physics-and-collisions---bouncing-on-collision---cannon-rb'>Physics And Collisions - Bouncing On Collision - cannon.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/cannon.rb
class Cannon
def initialize args
@@ -7973,7 +7357,7 @@ class Cannon
end
</code></pre>
-<h3 id='----physics-and-collisions---bouncing-on-collision---main.rb'>Physics And Collisions - Bouncing On Collision - main.rb</h3>
+<h3 id='----physics-and-collisions---bouncing-on-collision---main-rb'>Physics And Collisions - Bouncing On Collision - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb
INFINITY= 10**10
@@ -8094,7 +7478,7 @@ def tick args
end
</code></pre>
-<h3 id='----physics-and-collisions---bouncing-on-collision---peg.rb'>Physics And Collisions - Bouncing On Collision - peg.rb</h3>
+<h3 id='----physics-and-collisions---bouncing-on-collision---peg-rb'>Physics And Collisions - Bouncing On Collision - peg.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/peg.rb
class Peg
def initialize(x, y, block_size)
@@ -8280,7 +7664,7 @@ class Peg
end
</code></pre>
-<h3 id='----physics-and-collisions---bouncing-on-collision---vector2d.rb'>Physics And Collisions - Bouncing On Collision - vector2d.rb</h3>
+<h3 id='----physics-and-collisions---bouncing-on-collision---vector2d-rb'>Physics And Collisions - Bouncing On Collision - vector2d.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/08_bouncing_on_collision/app/vector2d.rb
class Vector2d
attr_accessor :x, :y
@@ -8332,7 +7716,7 @@ class Vector2d
end
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---ball.rb'>Physics And Collisions - Arbitrary Collision - ball.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---ball-rb'>Physics And Collisions - Arbitrary Collision - ball.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/ball.rb
class Ball
@@ -8502,7 +7886,7 @@ class Ball
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---blocks.rb'>Physics And Collisions - Arbitrary Collision - blocks.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---blocks-rb'>Physics And Collisions - Arbitrary Collision - blocks.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/blocks.rb
MAX_COUNT=100
@@ -9124,7 +8508,7 @@ class Line
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---linear_collider.rb'>Physics And Collisions - Arbitrary Collision - linear_collider.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---linear_collider-rb'>Physics And Collisions - Arbitrary Collision - linear_collider.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/linear_collider.rb
COLLISIONWIDTH=8
@@ -9308,7 +8692,7 @@ class LinearCollider
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---main.rb'>Physics And Collisions - Arbitrary Collision - main.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---main-rb'>Physics And Collisions - Arbitrary Collision - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/main.rb
INFINITY= 10**10
MAX_VELOCITY = 8.0
@@ -9483,7 +8867,7 @@ def tick args
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---paddle.rb'>Physics And Collisions - Arbitrary Collision - paddle.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---paddle-rb'>Physics And Collisions - Arbitrary Collision - paddle.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/paddle.rb
class Paddle
attr_accessor :enabled
@@ -9540,7 +8924,7 @@ class Paddle
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---rectangle.rb'>Physics And Collisions - Arbitrary Collision - rectangle.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---rectangle-rb'>Physics And Collisions - Arbitrary Collision - rectangle.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/rectangle.rb
class Rectangle
def initialize args
@@ -9634,7 +9018,7 @@ class Rectangle
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---square_collider.rb'>Physics And Collisions - Arbitrary Collision - square_collider.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---square_collider-rb'>Physics And Collisions - Arbitrary Collision - square_collider.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/square_collider.rb
class SquareCollider
@@ -9667,7 +9051,7 @@ class SquareCollider
end
</code></pre>
-<h3 id='----physics-and-collisions---arbitrary-collision---vector2d.rb'>Physics And Collisions - Arbitrary Collision - vector2d.rb</h3>
+<h3 id='----physics-and-collisions---arbitrary-collision---vector2d-rb'>Physics And Collisions - Arbitrary Collision - vector2d.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/09_arbitrary_collision/app/vector2d.rb
class Vector2d
attr_accessor :x, :y
@@ -9719,7 +9103,7 @@ class Vector2d
end
end
</code></pre>
-<h3 id='----physics-and-collisions---collision-with-object-removal---ball.rb'>Physics And Collisions - Collision With Object Removal - ball.rb</h3>
+<h3 id='----physics-and-collisions---collision-with-object-removal---ball-rb'>Physics And Collisions - Collision With Object Removal - ball.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/ball.rb
class Ball
#TODO limit accessors?
@@ -9754,7 +9138,7 @@ class Ball
end
</code></pre>
-<h3 id='----physics-and-collisions---collision-with-object-removal---linear_collider.rb'>Physics And Collisions - Collision With Object Removal - linear_collider.rb</h3>
+<h3 id='----physics-and-collisions---collision-with-object-removal---linear_collider-rb'>Physics And Collisions - Collision With Object Removal - linear_collider.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/linear_collider.rb
#The LinearCollider (theoretically) produces collisions upon a line segment defined point.y two x,y cordinates
@@ -9924,7 +9308,7 @@ class LinearCollider
end
</code></pre>
-<h3 id='----physics-and-collisions---collision-with-object-removal---main.rb'>Physics And Collisions - Collision With Object Removal - main.rb</h3>
+<h3 id='----physics-and-collisions---collision-with-object-removal---main-rb'>Physics And Collisions - Collision With Object Removal - main.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/main.rb
# coding: utf-8
INFINITY= 10**10
@@ -10117,7 +9501,7 @@ def tick args
end
</code></pre>
-<h3 id='----physics-and-collisions---collision-with-object-removal---paddle.rb'>Physics And Collisions - Collision With Object Removal - paddle.rb</h3>
+<h3 id='----physics-and-collisions---collision-with-object-removal---paddle-rb'>Physics And Collisions - Collision With Object Removal - paddle.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/paddle.rb
class Paddle
attr_accessor :enabled
@@ -10174,7 +9558,7 @@ class Paddle
end
</code></pre>
-<h3 id='----physics-and-collisions---collision-with-object-removal---tests.rb'>Physics And Collisions - Collision With Object Removal - tests.rb</h3>
+<h3 id='----physics-and-collisions---collision-with-object-removal---tests-rb'>Physics And Collisions - Collision With Object Removal - tests.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/tests.rb
# For advanced users:
# You can put some quick verification tests here, any method
@@ -10207,7 +9591,7 @@ $gtk.log_level = :off
$gtk.tests.start
</code></pre>
-<h3 id='----physics-and-collisions---collision-with-object-removal---vector2d.rb'>Physics And Collisions - Collision With Object Removal - vector2d.rb</h3>
+<h3 id='----physics-and-collisions---collision-with-object-removal---vector2d-rb'>Physics And Collisions - Collision With Object Removal - vector2d.rb</h3>
<pre><code class="language-ruby"># ./samples/04_physics_and_collisions/10_collision_with_object_removal/app/vector2d.rb
class Vector2d
@@ -10261,7 +9645,7 @@ class Vector2d
end
</code></pre>
-<h3 id='----mouse---mouse-click---main.rb'>Mouse - Mouse Click - main.rb</h3>
+<h3 id='----mouse---mouse-click---main-rb'>Mouse - Mouse Click - main.rb</h3>
<pre><code class="language-ruby"># ./samples/05_mouse/01_mouse_click/app/main.rb
=begin
@@ -10509,7 +9893,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----mouse---mouse-move---main.rb'>Mouse - Mouse Move - main.rb</h3>
+<h3 id='----mouse---mouse-move---main-rb'>Mouse - Mouse Move - main.rb</h3>
<pre><code class="language-ruby"># ./samples/05_mouse/02_mouse_move/app/main.rb
=begin
@@ -10809,7 +10193,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----mouse---mouse-move-paint-app---main.rb'>Mouse - Mouse Move Paint App - main.rb</h3>
+<h3 id='----mouse---mouse-move-paint-app---main-rb'>Mouse - Mouse Move Paint App - main.rb</h3>
<pre><code class="language-ruby"># ./samples/05_mouse/03_mouse_move_paint_app/app/main.rb
=begin
@@ -11053,7 +10437,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----mouse---coordinate-systems---main.rb'>Mouse - Coordinate Systems - main.rb</h3>
+<h3 id='----mouse---coordinate-systems---main-rb'>Mouse - Coordinate Systems - main.rb</h3>
<pre><code class="language-ruby"># ./samples/05_mouse/04_coordinate_systems/app/main.rb
=begin
@@ -11137,7 +10521,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----save-load---save-load-game---main.rb'>Save Load - Save Load Game - main.rb</h3>
+<h3 id='----save-load---save-load-game---main-rb'>Save Load - Save Load Game - main.rb</h3>
<pre><code class="language-ruby"># ./samples/06_save_load/01_save_load_game/app/main.rb
=begin
@@ -11530,7 +10914,1001 @@ def tick args
end
</code></pre>
-<h3 id='----advanced-rendering---simple-render-targets---main.rb'>Advanced Rendering - Simple Render Targets - main.rb</h3>
+<h3 id='----advanced-audio---audio-mixer---main-rb'>Advanced Audio - Audio Mixer - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_audio/01_audio_mixer/app/main.rb
+# these are the properties that you can sent on args.audio
+def spawn_new_sound args, name, path
+ # Spawn randomly in an area that won't be covered by UI.
+ screenx = (rand * 600.0) + 200.0
+ screeny = (rand * 400.0) + 100.0
+
+ id = new_sound_id! args
+ # you can hang anything on the audio hashes you want, so we store the
+ # actual screen position in here for convenience.
+ args.audio[id] = {
+ name: name,
+ input: path,
+ screenx: screenx,
+ screeny: screeny,
+ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
+ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
+ z: 0.0,
+ gain: 1.0,
+ pitch: 1.0,
+ looping: true,
+ paused: false
+ }
+
+ args.state.selected = id
+end
+
+# these are values you can change on the ~args.audio~ data structure
+def input_panel args
+ return unless args.state.panel
+ return if args.state.dragging
+
+ audio_entry = args.audio[args.state.selected]
+ results = args.state.panel
+
+ if args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.pitch_slider_rect.rect)
+ audio_entry.pitch = 2.0 * ((args.inputs.mouse.x - results.pitch_slider_rect.x).to_f / (results.pitch_slider_rect.w - 1.0))
+ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.playtime_slider_rect.rect)
+ audio_entry.playtime = audio_entry.length_ * ((args.inputs.mouse.x - results.playtime_slider_rect.x).to_f / (results.playtime_slider_rect.w - 1.0))
+ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.gain_slider_rect.rect)
+ audio_entry.gain = (args.inputs.mouse.x - results.gain_slider_rect.x).to_f / (results.gain_slider_rect.w - 1.0)
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.looping_checkbox_rect.rect)
+ audio_entry.looping = !audio_entry.looping
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.paused_checkbox_rect.rect)
+ audio_entry.paused = !audio_entry.paused
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.delete_button_rect.rect)
+ args.audio.delete args.state.selected
+ end
+end
+
+def render_sources args
+ args.outputs.primitives << args.audio.keys.map do |k|
+ s = args.audio[k]
+
+ isselected = (k == args.state.selected)
+
+ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]
+ [
+ [s.screenx, s.screeny, args.state.boxsize, args.state.boxsize, *color].solid,
+
+ {
+ x: s.screenx + args.state.boxsize.half,
+ y: s.screeny,
+ text: s.name,
+ r: 255,
+ g: 255,
+ b: 255,
+ alignment_enum: 1
+ }.label!
+ ]
+ end
+end
+
+def playtime_str 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]
+end
+
+def label_with_drop_shadow x, y, text
+ [
+ { x: x + 1, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,
+ { x: x + 2, y: y + 0, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,
+ { x: x + 0, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 200, g: 200, b: 200 }.label!
+ ]
+end
+
+def check_box opts = {}
+ checkbox_template = opts.args.layout.rect(w: 0.5, h: 0.5, col: 2)
+ final_rect = checkbox_template.center_inside_rect_y(opts.args.layout.rect(row: opts.row, col: opts.col))
+ color = { r: 0, g: 0, b: 0 }
+ color = { r: 255, g: 255, b: 255 } if opts.checked
+
+ {
+ rect: final_rect,
+ primitives: [
+ (final_rect.to_solid color)
+ ]
+ }
+end
+
+def progress_bar opts = {}
+ outer_rect = opts.args.layout.rect(row: opts.row, col: opts.col, w: 5, h: 1)
+ color = opts.percentage * 255
+ baseline_progress_bar = opts.args
+ .layout
+ .rect(w: 5, h: 0.5)
+
+ final_rect = baseline_progress_bar.center_inside_rect(outer_rect)
+ center = final_rect.rect_center_point
+
+ {
+ rect: final_rect,
+ primitives: [
+ final_rect.merge(r: color, g: color, b: color, a: 128).solid!,
+ label_with_drop_shadow(center.x, center.y, opts.text)
+ ]
+ }
+end
+
+def panel_primitives args, audio_entry
+ results = { primitives: [] }
+
+ return results unless audio_entry
+
+ # this uses DRGTK's layout apis to layout the controls
+ # imagine the screen is split into equal cells (24 cells across, 12 cells up and down)
+ # args.layout.rect returns a hash which we merge values with to create primitives
+ # using args.layout.rect removes the need for pixel pushing
+
+ # args.outputs.debug << args.layout.debug_primitives(r: 255, g: 255, b: 255)
+
+ white_color = { r: 255, g: 255, b: 255 }
+ label_style = white_color.merge(vertical_alignment_enum: 1)
+
+ # panel background
+ results.primitives << args.layout.rect(row: 0, col: 0, w: 7, h: 6, include_col_gutter: true, include_row_gutter: true)
+ .border!(r: 255, g: 255, b: 255)
+
+ # title
+ results.primitives << args.layout.point(row: 0, col: 3.5, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "Source #{args.state.selected} (#{args.audio[args.state.selected].name})",
+ size_enum: 3,
+ alignment_enum: 1)
+
+ # seperator line
+ results.primitives << args.layout.rect(row: 1, col: 0, w: 7, h: 0)
+ .line!(white_color)
+
+ # screen location
+ results.primitives << args.layout.point(row: 1.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "screen:")
+
+ results.primitives << args.layout.point(row: 1.0, col: 2, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "(#{audio_entry.screenx.to_i}, #{audio_entry.screeny.to_i})")
+
+ # position
+ results.primitives << args.layout.point(row: 1.5, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "position:")
+
+ results.primitives << args.layout.point(row: 1.5, col: 2, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "(#{audio_entry[:x].round(5).to_s[0..6]}, #{audio_entry[:y].round(5).to_s[0..6]})")
+
+ results.primitives << args.layout.point(row: 2.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "pitch:")
+
+ results.pitch_slider_rect = progress_bar(row: 2.0, col: 2,
+ percentage: audio_entry.pitch / 2.0,
+ text: "#{audio_entry.pitch.to_sf}",
+ args: args)
+
+ results.primitives << results.pitch_slider_rect.primitives
+
+ results.primitives << args.layout.point(row: 2.5, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "playtime:")
+
+ results.playtime_slider_rect = progress_bar(args: args,
+ row: 2.5,
+ col: 2,
+ percentage: audio_entry.playtime / audio_entry.length_,
+ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")
+
+ results.primitives << results.playtime_slider_rect.primitives
+
+ results.primitives << args.layout.point(row: 3.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "gain:")
+
+ results.gain_slider_rect = progress_bar(args: args,
+ row: 3.0,
+ col: 2,
+ percentage: audio_entry.gain,
+ text: "#{audio_entry.gain.to_sf}")
+
+ results.primitives << results.gain_slider_rect.primitives
+
+
+ results.primitives << args.layout.point(row: 3.5, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "looping:")
+
+ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)
+
+ results.looping_checkbox_rect = check_box(args: args, row: 3.5, col: 2, checked: audio_entry.looping)
+ results.primitives << results.looping_checkbox_rect.primitives
+
+ results.primitives << args.layout.point(row: 4.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "paused:")
+
+ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)
+
+ results.paused_checkbox_rect = check_box(args: args, row: 4.0, col: 2, checked: !audio_entry.paused)
+ results.primitives << results.paused_checkbox_rect.primitives
+
+ results.delete_button_rect = { rect: args.layout.rect(row: 5, col: 0, w: 7, h: 1) }
+
+ results.primitives << results.delete_button_rect.to_solid(r: 180)
+
+ results.primitives << args.layout.point(row: 5, col: 3.5, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "DELETE", alignment_enum: 1)
+
+ return results
+end
+
+def render_panel args
+ args.state.panel = nil
+ audio_entry = args.audio[args.state.selected]
+ return unless audio_entry
+
+ mouse_down = (args.state.mouse_held >= 0)
+ args.state.panel = panel_primitives args, audio_entry
+ args.outputs.primitives << args.state.panel.primitives
+end
+
+def new_sound_id! args
+ args.state.sound_id ||= 0
+ args.state.sound_id += 1
+ args.state.sound_id
+end
+
+def render_launcher args
+ args.outputs.primitives << args.state.spawn_sound_buttons.map(&:primitives)
+end
+
+def render_ui args
+ render_launcher args
+ render_panel args
+end
+
+def tick args
+ defaults args
+ render args
+ input args
+end
+
+def input args
+ if !args.audio[args.state.selected]
+ args.state.selected = nil
+ args.state.dragging = nil
+ end
+
+ # spawn button and node interaction
+ if args.inputs.mouse.click
+ spawn_sound_button = args.state.spawn_sound_buttons.find { |b| args.inputs.mouse.inside_rect? b.rect }
+
+ audio_click_key, audio_click_value = args.audio.find do |k, v|
+ args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]
+ end
+
+ if spawn_sound_button
+ args.state.selected = nil
+ spawn_new_sound args, spawn_sound_button.name, spawn_sound_button.path
+ elsif audio_click_key
+ args.state.selected = audio_click_key
+ end
+ end
+
+ if args.state.mouse_state == :held && args.state.selected
+ v = args.audio[args.state.selected]
+ if args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]
+ args.state.dragging = args.state.selected
+ end
+
+ if args.state.dragging
+ s = args.audio[args.state.selected]
+ # you can hang anything on the audio hashes you want, so we store the
+ # actual screen position so it doesn't scale weirdly vs your mouse.
+ s.screenx = args.inputs.mouse.x - (args.state.boxsize / 2)
+ s.screeny = args.inputs.mouse.y - (args.state.boxsize / 2)
+
+ s.screeny = 50 if s.screeny < 50
+ s.screeny = (719 - args.state.boxsize) if s.screeny > (719 - args.state.boxsize)
+ s.screenx = 0 if s.screenx < 0
+ s.screenx = (1279 - args.state.boxsize) if s.screenx > (1279 - args.state.boxsize)
+
+ s.x = ((s.screenx / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
+ s.y = ((s.screeny / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
+ end
+ elsif args.state.mouse_state == :released
+ args.state.dragging = nil
+ end
+
+ input_panel args
+end
+
+def defaults args
+ args.state.mouse_state ||= :released
+ args.state.dragging_source ||= false
+ args.state.selected ||= 0
+ args.state.next_sound_index ||= 0
+ args.state.boxsize ||= 30
+ args.state.sound_files ||= [
+ { name: :tada, path: "sounds/tada.wav" },
+ { name: :splash, path: "sounds/splash.wav" },
+ { name: :drum, path: "sounds/drum.wav" },
+ { name: :spring, path: "sounds/spring.wav" },
+ { name: :music, path: "sounds/music.ogg" }
+ ]
+
+ # generate buttons based off the sound collection above
+ args.state.spawn_sound_buttons ||= begin
+ # create a group of buttons
+ # column centered (using col_offset to calculate the column offset)
+ # where each item is 2 columns apart
+ rects = args.layout.rect_group row: 11,
+ col_offset: {
+ count: args.state.sound_files.length,
+ w: 2
+ },
+ dcol: 2,
+ w: 2,
+ h: 1,
+ group: args.state.sound_files
+
+ # now that you have the rects
+ # construct the metadata for the buttons
+ rects.map do |rect|
+ {
+ rect: rect,
+ name: rect.name,
+ path: rect.path,
+ primitives: [
+ rect.to_border(r: 255, g: 255, b: 255),
+ rect.to_label(x: rect.center_x,
+ y: rect.center_y,
+ text: "#{rect.name}",
+ alignment_enum: 1,
+ vertical_alignment_enum: 1,
+ r: 255, g: 255, b: 255)
+ ]
+ }
+ end
+ end
+
+ if args.inputs.mouse.up
+ args.state.mouse_state = :released
+ args.state.dragging_source = false
+ elsif args.inputs.mouse.down
+ args.state.mouse_state = :held
+ end
+
+ args.outputs.background_color = [ 0, 0, 0, 255 ]
+end
+
+def render args
+ render_ui args
+ render_sources args
+end
+
+</code></pre>
+<h3 id='----advanced-audio---audio-mixer---server_ip_address-txt'>Advanced Audio - Audio Mixer - server_ip_address.txt</h3>
+<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
+ def tick args
+ defaults args
+ render args
+ input args
+ process_audio_queue args
+ end
+
+ def defaults args
+ args.state.sine_waves ||= {}
+ args.state.square_waves ||= {}
+ args.state.saw_tooth_waves ||= {}
+ args.state.triangle_waves ||= {}
+ args.state.audio_queue ||= []
+ args.state.buttons ||= [
+ (frequency_buttons args),
+ (sine_wave_note_buttons args),
+ (bell_buttons args),
+ (square_wave_note_buttons args),
+ (saw_tooth_wave_note_buttons args),
+ (triangle_wave_note_buttons args),
+ ].flatten
+ end
+
+ def render args
+ args.outputs.borders << args.state.buttons.map { |b| b[:border] }
+ args.outputs.labels << args.state.buttons.map { |b| b[:label] }
+ args.outputs.labels << args.layout
+ .rect(row: 0, col: 11.5)
+ .yield_self { |r| r.merge y: r.y + r.h }
+ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",
+ alignment_enum: 1)
+ end
+
+
+ def input args
+ args.state.buttons.each do |b|
+ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])
+ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "
+ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"
+ send b[:method_to_call], args, b
+ end
+ end
+
+ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))
+ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'
+ end
+ end
+
+ def process_audio_queue args
+ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }
+ args.state.audio_queue -= to_queue
+ to_queue.each { |a| args.audio[a[:id]] = a }
+
+ args.audio.find_all { |k, v| v[:decay_rate] }
+ .each { |k, v| v[:gain] -= v[:decay_rate] }
+
+ sounds_to_stop = args.audio
+ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }
+ .map { |k, v| k }
+
+ sounds_to_stop.each { |k| args.audio.delete k }
+ end
+end
+
+begin # region: button definitions, ui layout, callback functions
+ def button args, opts
+ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
+
+ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
+
+ label_offset_x = 5
+ label_offset_y = 30
+
+ button_def[:label] = button_def[:rect].merge text: opts[:text],
+ size_enum: -2.5,
+ x: button_def[:rect].x + label_offset_x,
+ y: button_def[:rect].y + label_offset_y
+
+ button_def
+ end
+
+ def play_sine_wave args, sender
+ queue_sine_wave args,
+ frequency: sender[:frequency],
+ duration: 1.seconds,
+ fade_out: true
+ end
+
+ def play_note args, sender
+ method_to_call = :queue_sine_wave
+ method_to_call = :queue_square_wave if sender[:type] == :square
+ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth
+ method_to_call = :queue_triangle_wave if sender[:type] == :triangle
+ method_to_call = :queue_bell if sender[:type] == :bell
+
+ send method_to_call, args,
+ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),
+ duration: 1.seconds,
+ fade_out: true
+ end
+
+ def frequency_buttons args
+ [
+ (button args,
+ row: 4.0, col: 0, text: "300hz",
+ frequency: 300,
+ method_to_call: :play_sine_wave),
+ (button args,
+ row: 5.0, col: 0, text: "400hz",
+ frequency: 400,
+ method_to_call: :play_sine_wave),
+ (button args,
+ row: 6.0, col: 0, text: "500hz",
+ frequency: 500,
+ method_to_call: :play_sine_wave),
+ ]
+ end
+
+ def sine_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 2, text: "Sine C4",
+ note: :c, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 2, text: "Sine D4",
+ note: :d, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 2, text: "Sine E4",
+ note: :e, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 2, text: "Sine F4",
+ note: :f, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 2, text: "Sine G4",
+ note: :g, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 2, text: "Sine A5",
+ note: :a, octave: 5, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 2, text: "Sine B5",
+ note: :b, octave: 5, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 2, text: "Sine C5",
+ note: :c, octave: 5, type: :sine, method_to_call: :play_note),
+ ]
+ end
+
+ def square_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 6, text: "Square C4",
+ note: :c, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 6, text: "Square D4",
+ note: :d, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 6, text: "Square E4",
+ note: :e, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 6, text: "Square F4",
+ note: :f, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 6, text: "Square G4",
+ note: :g, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 6, text: "Square A5",
+ note: :a, octave: 5, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 6, text: "Square B5",
+ note: :b, octave: 5, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 6, text: "Square C5",
+ note: :c, octave: 5, type: :square, method_to_call: :play_note),
+ ]
+ end
+ def saw_tooth_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 8, text: "Saw C4",
+ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 8, text: "Saw D4",
+ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 8, text: "Saw E4",
+ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 8, text: "Saw F4",
+ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 8, text: "Saw G4",
+ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 8, text: "Saw A5",
+ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 8, text: "Saw B5",
+ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 8, text: "Saw C5",
+ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+ ]
+ end
+
+ def triangle_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 10, text: "Triangle C4",
+ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 10, text: "Triangle D4",
+ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 10, text: "Triangle E4",
+ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 10, text: "Triangle F4",
+ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 10, text: "Triangle G4",
+ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 10, text: "Triangle A5",
+ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 10, text: "Triangle B5",
+ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 10, text: "Triangle C5",
+ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),
+ ]
+ end
+
+ def bell_buttons args
+ [
+ (button args,
+ row: 1.5, col: 4, text: "Bell C4",
+ note: :c, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 4, text: "Bell D4",
+ note: :d, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 4, text: "Bell E4",
+ note: :e, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 4, text: "Bell F4",
+ note: :f, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 4, text: "Bell G4",
+ note: :g, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 4, text: "Bell A5",
+ note: :a, octave: 5, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 4, text: "Bell B5",
+ note: :b, octave: 5, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 4, text: "Bell C5",
+ note: :c, octave: 5, type: :bell, method_to_call: :play_note),
+ ]
+ end
+end
+
+begin # region: wave generation
+ begin # sine wave
+ def defaults_sine_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def sine_wave_for opts = {}
+ opts = defaults_sine_wave_for.merge opts
+ frequency = opts[:frequency]
+ sample_rate = opts[:sample_rate]
+ period_size = (sample_rate.fdiv frequency).ceil
+ period_size.map_with_index do |i|
+ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)
+ end.to_a
+ end
+
+ def defaults_queue_sine_wave
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_sine_wave args, opts = {}
+ opts = defaults_queue_sine_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.sine_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: sine_wave
+ end
+ end
+
+ begin # region: square wave
+ def defaults_square_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def square_wave_for opts = {}
+ opts = defaults_square_wave_for.merge opts
+ sine_wave = sine_wave_for opts
+ sine_wave.map do |v|
+ if v >= 0
+ 1.0
+ else
+ -1.0
+ end
+ end.to_a
+ end
+
+ def defaults_queue_square_wave
+ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_square_wave args, opts = {}
+ opts = defaults_queue_square_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.square_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: square_wave
+ end
+ end
+
+ begin # region: saw tooth wave
+ def defaults_saw_tooth_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def saw_tooth_wave_for opts = {}
+ opts = defaults_saw_tooth_wave_for.merge opts
+ sine_wave = sine_wave_for opts
+ period_size = sine_wave.length
+ sine_wave.map_with_index do |v, i|
+ (((i % period_size).fdiv period_size) * 2) - 1
+ end
+ end
+
+ def defaults_queue_saw_tooth_wave
+ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_saw_tooth_wave args, opts = {}
+ opts = defaults_queue_saw_tooth_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave
+ end
+ end
+
+ begin # region: triangle wave
+ def defaults_triangle_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def triangle_wave_for opts = {}
+ opts = defaults_saw_tooth_wave_for.merge opts
+ sine_wave = sine_wave_for opts
+ period_size = sine_wave.length
+ sine_wave.map_with_index do |v, i|
+ ratio = (i.fdiv period_size)
+ if ratio <= 0.5
+ (ratio * 4) - 1
+ else
+ ratio -= 0.5
+ 1 - (ratio * 4)
+ end
+ end
+ end
+
+ def defaults_queue_triangle_wave
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_triangle_wave args, opts = {}
+ opts = defaults_queue_triangle_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.triangle_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: triangle_wave
+ end
+ end
+
+ begin # region: bell
+ def defaults_queue_bell
+ { frequency: 440, duration: 1.seconds, queue_in: 0 }
+ end
+
+ def queue_bell args, opts = {}
+ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }
+ end
+
+ def bell_harmonics
+ [
+ { frequency_ratio: 0.5, duration_ratio: 1.00 },
+ { frequency_ratio: 1.0, duration_ratio: 0.80 },
+ { frequency_ratio: 2.0, duration_ratio: 0.60 },
+ { frequency_ratio: 3.0, duration_ratio: 0.40 },
+ { frequency_ratio: 4.2, duration_ratio: 0.25 },
+ { frequency_ratio: 5.4, duration_ratio: 0.20 },
+ { frequency_ratio: 6.8, duration_ratio: 0.15 }
+ ]
+ end
+
+ def defaults_bell_to_sine_waves
+ { frequency: 440, duration: 1.seconds, queue_in: 0 }
+ end
+
+ def bell_to_sine_waves opts = {}
+ opts = defaults_bell_to_sine_waves.merge opts
+ bell_harmonics.map do |b|
+ {
+ frequency: opts[:frequency] * b[:frequency_ratio],
+ duration: opts[:duration] * b[:duration_ratio],
+ queue_in: opts[:queue_in],
+ gain: (1.fdiv bell_harmonics.length),
+ fade_out: true
+ }
+ end
+ end
+ end
+
+ begin # audio entity construction
+ def generate_audio_data sine_wave, sample_rate
+ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil
+ copy_count = (sample_size.fdiv sine_wave.length).ceil
+ sine_wave * copy_count
+ end
+
+ def defaults_new_audio_state
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+ end
+
+ def new_audio_state args, opts = {}
+ opts = defaults_new_audio_state.merge opts
+ decay_rate = 0
+ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ {
+ id: (new_id! args),
+ frequency: frequency,
+ sample_rate: 48000,
+ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],
+ gain: opts[:gain].to_f,
+ queue_at: args.state.tick_count + opts[:queue_in],
+ decay_rate: decay_rate,
+ pitch: 1.0,
+ looping: true,
+ paused: false
+ }
+ end
+
+ def queue_audio args, opts = {}
+ graph_wave args, opts[:wave], opts[:audio_state][:frequency]
+ args.state.audio_queue << opts[:audio_state]
+ end
+
+ def new_id! args
+ args.state.audio_id ||= 0
+ args.state.audio_id += 1
+ end
+
+ def graph_wave args, wave, frequency
+ if args.state.tick_count != args.state.graphed_at
+ args.outputs.static_lines.clear
+ args.outputs.static_sprites.clear
+ end
+
+ wave = wave
+
+ r, g, b = frequency.to_i % 85,
+ frequency.to_i % 170,
+ frequency.to_i % 255
+
+ starting_rect = args.layout.rect(row: 5, col: 13)
+ x_scale = 10
+ y_scale = 100
+ max_points = 25
+
+ points = wave
+ if wave.length > max_points
+ resolution = wave.length.idiv max_points
+ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }
+ end
+
+ args.outputs.static_lines << points.map_with_index do |y, x|
+ next_y = points[x + 1]
+
+ if next_y
+ {
+ x: starting_rect.x + (x * x_scale),
+ y: starting_rect.y + starting_rect.h.half + y_scale * y,
+ x2: starting_rect.x + ((x + 1) * x_scale),
+ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,
+ r: r,
+ g: g,
+ b: b
+ }
+ end
+ end
+
+ args.outputs.static_sprites << points.map_with_index do |y, x|
+ {
+ x: (starting_rect.x + (x * x_scale)) - 2,
+ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,
+ w: 4,
+ h: 4,
+ path: 'sprites/square-white.png',
+ r: r,
+ g: g,
+ b: b
+ }
+ end
+
+ args.state.graphed_at = args.state.tick_count
+ end
+ end
+
+ begin # region: musical note mapping
+ def defaults_frequency_for
+ { note: :a, octave: 5, sharp: false, flat: false }
+ end
+
+ def frequency_for opts = {}
+ opts = defaults_frequency_for.merge opts
+ octave_offset_multiplier = opts[:octave] - 5
+ note = note_frequencies_octave_5[opts[:note]]
+ if octave_offset_multiplier < 0
+ note = note * 1 / (octave_offset_multiplier.abs + 1)
+ elsif octave_offset_multiplier > 0
+ note = note * (octave_offset_multiplier.abs + 1) / 1
+ end
+ note
+ end
+
+ def note_frequencies_octave_5
+ {
+ a: 440.0,
+ a_sharp: 466.16, b_flat: 466.16,
+ b: 493.88,
+ c: 523.25,
+ c_sharp: 554.37, d_flat: 587.33,
+ d: 587.33,
+ d_sharp: 622.25, e_flat: 659.25,
+ e: 659.25,
+ f: 698.25,
+ f_sharp: 739.99, g_flat: 739.99,
+ g: 783.99,
+ g_sharp: 830.61, a_flat: 830.61
+ }
+ end
+ end
+end
+
+$gtk.reset
+
+</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
# args.outputs.render_targets are really really powerful.
@@ -11586,7 +11964,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----advanced-rendering---render-targets-with-tile-manipulation---main.rb'>Advanced Rendering - Render Targets With Tile Manipulation - main.rb</h3>
+<h3 id='----advanced-rendering---render-targets-with-tile-manipulation---main-rb'>Advanced Rendering - Render Targets With Tile Manipulation - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_rendering/02_render_targets_with_tile_manipulation/app/main.rb
# This sample is meant to show you how to do that dripping transition thing
# at the start of the original Doom. Most of this file is here to animate
@@ -11685,7 +12063,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----advanced-rendering---render-target-viewports---main.rb'>Advanced Rendering - Render Target Viewports - main.rb</h3>
+<h3 id='----advanced-rendering---render-target-viewports---main-rb'>Advanced Rendering - Render Target Viewports - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_rendering/03_render_target_viewports/app/main.rb
=begin
@@ -12157,7 +12535,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----advanced-rendering---render-primitive-hierarchies---main.rb'>Advanced Rendering - Render Primitive Hierarchies - main.rb</h3>
+<h3 id='----advanced-rendering---render-primitive-hierarchies---main-rb'>Advanced Rendering - Render Primitive Hierarchies - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_rendering/04_render_primitive_hierarchies/app/main.rb
=begin
@@ -12333,7 +12711,7 @@ def collection_of_sprites args
end
</code></pre>
-<h3 id='----advanced-rendering---render-primitives-as-hash---main.rb'>Advanced Rendering - Render Primitives As Hash - main.rb</h3>
+<h3 id='----advanced-rendering---render-primitives-as-hash---main-rb'>Advanced Rendering - Render Primitives As Hash - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_rendering/05_render_primitives_as_hash/app/main.rb
=begin
@@ -12473,7 +12851,7 @@ def tick args
flip_horizontally: false,
angle_anchor_x: 0.5, # rotation center set to middle
angle_anchor_y: 0.5
- }.sprite
+ }.sprite!
# Outputs label as primitive using a hash
args.outputs.primitives << {
@@ -12487,7 +12865,7 @@ def tick args
b: 50,
a: 255, # transparency
font: "fonts/manaspc.ttf" # font style
- }.label
+ }.label!
# Outputs solid as primitive using a hash
args.outputs.primitives << {
@@ -12499,7 +12877,7 @@ def tick args
g: 50,
b: 50,
a: 255 # transparency
- }.solid
+ }.solid!
# Outputs border as primitive using a hash
# Same parameters as solid
@@ -12512,7 +12890,7 @@ def tick args
g: 50,
b: 50,
a: 255 # transparency
- }.border
+ }.border!
# Outputs line as primitive using a hash
args.outputs.primitives << {
@@ -12524,11 +12902,11 @@ def tick args
g: 50,
b: 50,
a: 255 # transparency
- }.line
+ }.line!
end
</code></pre>
-<h3 id='----advanced-rendering---pixel-arrays---main.rb'>Advanced Rendering - Pixel Arrays - main.rb</h3>
+<h3 id='----advanced-rendering---pixel-arrays---main-rb'>Advanced Rendering - Pixel Arrays - main.rb</h3>
<pre><code class="language-ruby"># ./samples/07_advanced_rendering/06_pixel_arrays/app/main.rb
$gtk.reset
@@ -12573,8 +12951,105 @@ end
</code></pre>
-<h3 id='----advanced-rendering---splitscreen-camera---main.rb'>Advanced Rendering - Splitscreen Camera - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/07_advanced_rendering/07_splitscreen_camera/app/main.rb
+<h3 id='----advanced-rendering---simple-camera---main-rb'>Advanced Rendering - Simple Camera - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_rendering/07_simple_camera/app/main.rb
+def tick args
+ # variables you can play around with
+ args.state.world.w ||= 1280
+ args.state.world.h ||= 720
+
+ args.state.player.x ||= 0
+ args.state.player.y ||= 0
+ args.state.player.size ||= 32
+
+ args.state.enemy.x ||= 700
+ args.state.enemy.y ||= 700
+ args.state.enemy.size ||= 16
+
+ args.state.camera.x ||= 640
+ args.state.camera.y ||= 300
+ args.state.camera.scale ||= 1.0
+ args.state.camera.show_empty_space ||= :yes
+
+ # instructions
+ args.outputs.primitives << { x: 0, y: 80.from_top, w: 360, h: 80, r: 0, g: 0, b: 0, a: 128 }.solid!
+ args.outputs.primitives << { x: 10, y: 10.from_top, text: "arrow keys to move around", r: 255, g: 255, b: 255}.label!
+ args.outputs.primitives << { x: 10, y: 30.from_top, text: "+/- to change zoom of camera", r: 255, g: 255, b: 255}.label!
+ args.outputs.primitives << { x: 10, y: 50.from_top, text: "tab to change camera edge behavior", r: 255, g: 255, b: 255}.label!
+
+ # render scene
+ args.outputs[:scene].w = args.state.world.w
+ args.outputs[:scene].h = args.state.world.h
+
+ args.outputs[:scene].solids << { x: 0, y: 0, w: args.state.world.w, h: args.state.world.h, r: 20, g: 60, b: 80 }
+ args.outputs[:scene].solids << { x: args.state.player.x, y: args.state.player.y,
+ w: args.state.player.size, h: args.state.player.size, r: 80, g: 155, b: 80 }
+ args.outputs[:scene].solids << { x: args.state.enemy.x, y: args.state.enemy.y,
+ w: args.state.enemy.size, h: args.state.enemy.size, r: 155, g: 80, b: 80 }
+
+ # render camera
+ scene_position = calc_scene_position args
+ args.outputs.sprites << { x: scene_position.x,
+ y: scene_position.y,
+ w: scene_position.w,
+ h: scene_position.h,
+ path: :scene }
+
+ # move player
+ if args.inputs.directional_angle
+ args.state.player.x += args.inputs.directional_angle.vector_x * 5
+ args.state.player.y += args.inputs.directional_angle.vector_y * 5
+ args.state.player.x = args.state.player.x.clamp(0, args.state.world.w - args.state.player.size)
+ args.state.player.y = args.state.player.y.clamp(0, args.state.world.h - args.state.player.size)
+ end
+
+ # +/- to zoom in and out
+ if args.inputs.keyboard.plus && args.state.tick_count.zmod?(3)
+ args.state.camera.scale += 0.05
+ elsif args.inputs.keyboard.hyphen && args.state.tick_count.zmod?(3)
+ args.state.camera.scale -= 0.05
+ elsif args.inputs.keyboard.key_down.tab
+ if args.state.camera.show_empty_space == :yes
+ args.state.camera.show_empty_space = :no
+ else
+ args.state.camera.show_empty_space = :yes
+ end
+ end
+
+ args.state.camera.scale = args.state.camera.scale.greater(0.1)
+end
+
+def calc_scene_position args
+ result = { x: args.state.camera.x - (args.state.player.x * args.state.camera.scale),
+ y: args.state.camera.y - (args.state.player.y * args.state.camera.scale),
+ w: args.state.world.w * args.state.camera.scale,
+ h: args.state.world.h * args.state.camera.scale,
+ scale: args.state.camera.scale }
+
+ return result if args.state.camera.show_empty_space == :yes
+
+ if result.w < args.grid.w
+ result.merge!(x: (args.grid.w - result.w).half)
+ elsif (args.state.player.x * result.scale) < args.grid.w.half
+ result.merge!(x: 10)
+ elsif (result.x + result.w) < args.grid.w
+ result.merge!(x: - result.w + (args.grid.w - 10))
+ end
+
+ if result.h < args.grid.h
+ result.merge!(y: (args.grid.h - result.h).half)
+ elsif (result.y) > 10
+ result.merge!(y: 10)
+ elsif (result.y + result.h) < args.grid.h
+ result.merge!(y: - result.h + (args.grid.h - 10))
+ end
+
+ result
+end
+
+</code></pre>
+<h3 id='----advanced-rendering---splitscreen-camera---main-rb'>Advanced Rendering - Splitscreen Camera - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_rendering/08_splitscreen_camera/app/main.rb
class CameraMovement
attr_accessor :state, :inputs, :outputs, :grid
@@ -12972,8 +13447,8 @@ def tick args
end
</code></pre>
-<h3 id='----advanced-rendering---z-targeting-camera---main.rb'>Advanced Rendering - Z Targeting Camera - main.rb</h3>
-<pre><code class="language-ruby"># ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb
+<h3 id='----advanced-rendering---z-targeting-camera---main-rb'>Advanced Rendering - Z Targeting Camera - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_rendering/09_z_targeting_camera/app/main.rb
class Game
attr_gtk
@@ -13082,7 +13557,60 @@ end
$gtk.reset
</code></pre>
-<h3 id='----tweening-lerping-easing-functions---easing-functions---main.rb'>Tweening Lerping Easing Functions - Easing Functions - main.rb</h3>
+<h3 id='----advanced-rendering---blend-modes---main-rb'>Advanced Rendering - Blend Modes - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/07_advanced_rendering/10_blend_modes/app/main.rb
+$gtk.reset
+
+def draw_blendmode args, mode
+ w = 160
+ h = w
+ args.state.x += (1280-w) / (args.state.blendmodes.length + 1)
+ x = args.state.x
+ y = (720 - h) / 2
+ s = 'sprites/blue-feathered.png'
+ args.outputs.sprites << { blendmode_enum: mode.value, x: x, y: y, w: w, h: h, path: s }
+ args.outputs.labels << [x + (w/2), y, mode.name.to_s, 1, 1, 255, 255, 255]
+end
+
+def tick args
+
+ # Different blend modes do different things, depending on what they
+ # blend against (in this case, the pixels of the background color).
+ args.state.bg_element ||= 1
+ args.state.bg_color ||= 255
+ args.state.bg_color_direction ||= 1
+ bg_r = (args.state.bg_element == 1) ? args.state.bg_color : 0
+ bg_g = (args.state.bg_element == 2) ? args.state.bg_color : 0
+ bg_b = (args.state.bg_element == 3) ? args.state.bg_color : 0
+ args.state.bg_color += args.state.bg_color_direction
+ if (args.state.bg_color_direction > 0) && (args.state.bg_color >= 255)
+ args.state.bg_color_direction = -1
+ args.state.bg_color = 255
+ elsif (args.state.bg_color_direction < 0) && (args.state.bg_color <= 0)
+ args.state.bg_color_direction = 1
+ args.state.bg_color = 0
+ args.state.bg_element += 1
+ if args.state.bg_element >= 4
+ args.state.bg_element = 1
+ end
+ end
+
+ args.outputs.background_color = [ bg_r, bg_g, bg_b, 255 ]
+
+ args.state.blendmodes ||= [
+ { name: :none, value: 0 },
+ { name: :blend, value: 1 },
+ { name: :add, value: 2 },
+ { name: :mod, value: 3 },
+ { name: :mul, value: 4 }
+ ]
+
+ args.state.x = 0 # reset this, draw_blendmode will increment it.
+ args.state.blendmodes.each { |blendmode| draw_blendmode args, blendmode }
+end
+
+</code></pre>
+<h3 id='----tweening-lerping-easing-functions---easing-functions---main-rb'>Tweening Lerping Easing Functions - Easing Functions - main.rb</h3>
<pre><code class="language-ruby"># ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb
def tick args
# STOP! Watch the following presentation first!!!!
@@ -13218,7 +13746,7 @@ module Easing
end
</code></pre>
-<h3 id='----tweening-lerping-easing-functions---cubic-bezier---main.rb'>Tweening Lerping Easing Functions - Cubic Bezier - main.rb</h3>
+<h3 id='----tweening-lerping-easing-functions---cubic-bezier---main-rb'>Tweening Lerping Easing Functions - Cubic Bezier - main.rb</h3>
<pre><code class="language-ruby"># ./samples/08_tweening_lerping_easing_functions/02_cubic_bezier/app/main.rb
def tick args
args.outputs.background_color = [33, 33, 33]
@@ -13283,7 +13811,7 @@ def pow n, to
end
</code></pre>
-<h3 id='----tweening-lerping-easing-functions---easing-using-spline---main.rb'>Tweening Lerping Easing Functions - Easing Using Spline - main.rb</h3>
+<h3 id='----tweening-lerping-easing-functions---easing-using-spline---main-rb'>Tweening Lerping Easing Functions - Easing Using Spline - main.rb</h3>
<pre><code class="language-ruby"># ./samples/08_tweening_lerping_easing_functions/03_easing_using_spline/app/main.rb
def tick args
args.state.duration = 10.seconds
@@ -13305,7 +13833,7 @@ def tick args
end
</code></pre>
-<h3 id='----tweening-lerping-easing-functions---parametric-enemy-movement---main.rb'>Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb</h3>
+<h3 id='----tweening-lerping-easing-functions---parametric-enemy-movement---main-rb'>Tweening Lerping Easing Functions - Parametric Enemy Movement - main.rb</h3>
<pre><code class="language-ruby"># ./samples/08_tweening_lerping_easing_functions/04_parametric_enemy_movement/app/main.rb
def new_star args
{ x: 1280.randomize(:ratio),
@@ -13522,7 +14050,7 @@ def tick args
end
</code></pre>
-<h3 id='----performance---sprites-as-hash---main.rb'>Performance - Sprites As Hash - main.rb</h3>
+<h3 id='----performance---sprites-as-hash---main-rb'>Performance - Sprites As Hash - main.rb</h3>
<pre><code class="language-ruby"># ./samples/09_performance/01_sprites_as_hash/app/main.rb
# Sprites represented as Hashes using the queue ~args.outputs.sprites~
@@ -13565,7 +14093,11 @@ def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
- puts "* INFO - Please specify the number of sprites to render."
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Hashes"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13590,7 +14122,7 @@ def reset_with count: count
end
</code></pre>
-<h3 id='----performance---sprites-as-entities---main.rb'>Performance - Sprites As Entities - main.rb</h3>
+<h3 id='----performance---sprites-as-entities---main-rb'>Performance - Sprites As Entities - main.rb</h3>
<pre><code class="language-ruby"># ./samples/09_performance/02_sprites_as_entities/app/main.rb
# Sprites represented as Entities using the queue ~args.outputs.sprites~
# yields nicer access apis over Hashes, but require a bit more code upfront.
@@ -13633,7 +14165,11 @@ def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
- puts "* INFO - Please specify the number of sprites to render."
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Open Entities"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13658,7 +14194,7 @@ def reset_with count: count
end
</code></pre>
-<h3 id='----performance---sprites-as-strict-entities---main.rb'>Performance - Sprites As Strict Entities - main.rb</h3>
+<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
# 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
@@ -13705,7 +14241,11 @@ def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
- puts "* INFO - Please specify the number of sprites to render."
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Strict Entities"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13730,7 +14270,7 @@ def reset_with count: count
end
</code></pre>
-<h3 id='----performance---sprites-as-classes---main.rb'>Performance - Sprites As Classes - main.rb</h3>
+<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
# Sprites represented as Classes using the queue ~args.outputs.sprites~.
# gives you full control of property declaration and method invocation.
@@ -13760,6 +14300,11 @@ end
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Classes"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13784,7 +14329,7 @@ def reset_with count: count
end
</code></pre>
-<h3 id='----performance---static-sprites-as-classes---main.rb'>Performance - Static Sprites As Classes - main.rb</h3>
+<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
# Sprites represented as Classes using the queue ~args.outputs.static_sprites~.
# bypasses the queue behavior of ~args.outputs.sprites~. All instances are held
@@ -13815,19 +14360,24 @@ end
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Static Sprites, Classes"
+ 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| Star.new args.grid }
+ args.outputs.static_sprites << args.state.stars
end
# update
args.state.stars.each(&:move)
# render
- args.outputs.sprites << args.state.stars
args.outputs.background_color = [0, 0, 0]
args.outputs.primitives << args.gtk.current_framerate_primitives
end
@@ -13839,7 +14389,7 @@ def reset_with count: count
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>
+<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
# 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.
@@ -13883,10 +14433,21 @@ class Star
# path,
# angle,
# alpha, red_saturation, green_saturation, blue_saturation
+ # tile_x, tile_y, tile_w, tile_h,
# flip_horizontally, flip_vertically,
- # tile_x, tile_y, tile_w, tile_h
# angle_anchor_x, angle_anchor_y,
# source_x, source_y, source_w, source_h
+
+ # The argument order for ffi_draw.draw_sprite_4 is:
+ # x, y, w, h,
+ # path,
+ # angle,
+ # alpha, red_saturation, green_saturation, blue_saturation
+ # tile_x, tile_y, tile_w, tile_h,
+ # flip_horizontally, flip_vertically,
+ # angle_anchor_x, angle_anchor_y,
+ # source_x, source_y, source_w, source_h,
+ # blendmode_enum
end
end
@@ -13894,6 +14455,11 @@ end
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Static Sprites, Classes, Draw Override"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13915,7 +14481,7 @@ def reset_with count: count
end
</code></pre>
-<h3 id='----performance---collision-limits---main.rb'>Performance - Collision Limits - main.rb</h3>
+<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
=begin
@@ -13974,7 +14540,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----advanced-debugging---trace-debugging---main.rb'>Advanced Debugging - Trace Debugging - main.rb</h3>
+<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
attr_gtk
@@ -14031,7 +14597,7 @@ def tick args
end
</code></pre>
-<h3 id='----advanced-debugging---trace-debugging-classes---main.rb'>Advanced Debugging - Trace Debugging Classes - main.rb</h3>
+<h3 id='----advanced-debugging---trace-debugging-classes---main-rb'>Advanced Debugging - Trace Debugging Classes - main.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/02_trace_debugging_classes/app/main.rb
class Foobar
def initialize
@@ -14057,7 +14623,54 @@ def tick args
end
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---exception_raising_tests.rb'>Advanced Debugging - Unit Tests - exception_raising_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---benchmark_api_tests-rb'>Advanced Debugging - Unit Tests - benchmark_api_tests.rb</h3>
+<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/benchmark_api_tests.rb
+def test_benchmark_api args, assert
+ result = args.gtk.benchmark iterations: 100,
+ only_one: -> () {
+ r = 0
+ (1..100).each do |i|
+ r += 1
+ end
+ }
+
+ assert.equal! result.first_place.name, :only_one
+
+ result = args.gtk.benchmark iterations: 100,
+ iterations_100: -> () {
+ r = 0
+ (1..100).each do |i|
+ r += 1
+ end
+ },
+ iterations_50: -> () {
+ r = 0
+ (1..50).each do |i|
+ r += 1
+ end
+ }
+
+ assert.equal! result.first_place.name, :iterations_50
+
+ result = args.gtk.benchmark iterations: 1,
+ iterations_100: -> () {
+ r = 0
+ (1..100).each do |i|
+ r += 1
+ end
+ },
+ iterations_50: -> () {
+ r = 0
+ (1..50).each do |i|
+ r += 1
+ end
+ }
+
+ assert.equal! result.too_small_to_measure, true
+end
+
+</code></pre>
+<h3 id='----advanced-debugging---unit-tests---exception_raising_tests-rb'>Advanced Debugging - Unit Tests - exception_raising_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb
begin :shared
class ExceptionalClass
@@ -14080,7 +14693,7 @@ $gtk.reset 100
$gtk.log_level = :off
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---fn_tests.rb'>Advanced Debugging - Unit Tests - fn_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---fn_tests-rb'>Advanced Debugging - Unit Tests - fn_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/fn_tests.rb
def infinity
1 / 0
@@ -14264,13 +14877,13 @@ def test_array_hash args, assert
end
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---gen_docs.rb'>Advanced Debugging - Unit Tests - gen_docs.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---gen_docs-rb'>Advanced Debugging - Unit Tests - gen_docs.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/gen_docs.rb
# ./dragonruby mygame --eval samples/99_zz_gtk_unit_tests/gen_docs.rb --no-tick
Kernel.export_docs!
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---geometry_tests.rb'>Advanced Debugging - Unit Tests - geometry_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---geometry_tests-rb'>Advanced Debugging - Unit Tests - geometry_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/geometry_tests.rb
begin :shared
def primitive_representations x, y, w, h
@@ -14388,7 +15001,7 @@ $gtk.reset 100
$gtk.log_level = :off
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---http_tests.rb'>Advanced Debugging - Unit Tests - http_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---http_tests-rb'>Advanced Debugging - Unit Tests - http_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/http_tests.rb
def try_assert_or_schedule args, assert
if $result[:complete]
@@ -14414,7 +15027,7 @@ $gtk.reset 100
$gtk.log_level = :off
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---nil_coercion_tests.rb'>Advanced Debugging - Unit Tests - nil_coercion_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---nil_coercion_tests-rb'>Advanced Debugging - Unit Tests - nil_coercion_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/nil_coercion_tests.rb
# numbers
def test_open_entity_add_number args, assert
@@ -14510,7 +15123,7 @@ def test_open_entity_nil_bug args, assert
end
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---object_to_primitive_tests.rb'>Advanced Debugging - Unit Tests - object_to_primitive_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---object_to_primitive_tests-rb'>Advanced Debugging - Unit Tests - object_to_primitive_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/object_to_primitive_tests.rb
class PlayerSpriteForTest
end
@@ -14530,7 +15143,7 @@ $gtk.reset 100
$gtk.log_level = :off
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---parsing_tests.rb'>Advanced Debugging - Unit Tests - parsing_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---parsing_tests-rb'>Advanced Debugging - Unit Tests - parsing_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/parsing_tests.rb
def test_parse_json args, assert
result = args.gtk.parse_json '{ "name": "John Doe", "aliases": ["JD"] }'
@@ -14561,7 +15174,141 @@ $gtk.reset 100
$gtk.log_level = :off
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---require_tests.rb'>Advanced Debugging - Unit Tests - require_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---pretty_format_tests-rb'>Advanced Debugging - Unit Tests - pretty_format_tests.rb</h3>
+<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/pretty_format_tests.rb
+def H opts
+ opts
+end
+
+def A *opts
+ opts
+end
+
+def assert_format args, assert, hash, expected
+ actual = args.fn.pretty_format hash
+ assert.are_equal! actual, expected
+end
+
+def test_pretty_print args, assert
+ # =============================
+ # hash with single value
+ # =============================
+ input = (H first_name: "John")
+ expected = <<-S
+{:first_name "John"}
+S
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # hash with two values
+ # =============================
+ input = (H first_name: "John", last_name: "Smith")
+ expected = <<-S
+{:first_name "John"
+ :last_name "Smith"}
+S
+
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # hash with inner hash
+ # =============================
+ input = (H first_name: "John",
+ last_name: "Smith",
+ middle_initial: "I",
+ so: (H first_name: "Pocahontas",
+ last_name: "Tsenacommacah"),
+ friends: (A (H first_name: "Side", last_name: "Kick"),
+ (H first_name: "Tim", last_name: "Wizard")))
+ expected = <<-S
+{:first_name "John"
+ :last_name "Smith"
+ :middle_initial "I"
+ :so {:first_name "Pocahontas"
+ :last_name "Tsenacommacah"}
+ :friends [{:first_name "Side"
+ :last_name "Kick"}
+ {:first_name "Tim"
+ :last_name "Wizard"}]}
+S
+
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # array with one value
+ # =============================
+ input = (A 1)
+ expected = <<-S
+[1]
+S
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # array with multiple values
+ # =============================
+ input = (A 1, 2, 3)
+ expected = <<-S
+[1
+ 2
+ 3]
+S
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # array with multiple values hashes
+ # =============================
+ input = (A (H first_name: "Side", last_name: "Kick"),
+ (H first_name: "Tim", last_name: "Wizard"))
+ expected = <<-S
+[{:first_name "Side"
+ :last_name "Kick"}
+ {:first_name "Tim"
+ :last_name "Wizard"}]
+S
+
+ (assert_format args, assert, input, expected)
+end
+
+def test_nested_nested args, assert
+ # =============================
+ # nested array in nested hash
+ # =============================
+ input = (H type: :root,
+ text: "Root",
+ children: (A (H level: 1,
+ text: "Level 1",
+ children: (A (H level: 2,
+ text: "Level 2",
+ children: [])))))
+
+ expected = <<-S
+{:type :root
+ :text "Root"
+ :children [{:level 1
+ :text "Level 1"
+ :children [{:level 2
+ :text "Level 2"
+ :children []}]}]}
+
+S
+
+ (assert_format args, assert, input, expected)
+end
+
+def test_scene args, assert
+ script = <<-S
+* Scene 1
+** Narrator
+They say happy endings don't exist.
+** Narrator
+They say true love is a lie.
+S
+ input = parse_org args, script
+ puts (args.fn.pretty_format input)
+end
+
+</code></pre>
+<h3 id='----advanced-debugging---unit-tests---require_tests-rb'>Advanced Debugging - Unit Tests - require_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/require_tests.rb
def write_src path, src
$gtk.write_file path, src
@@ -14603,7 +15350,7 @@ def test_require args, assert
end
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---serialize_deserialize_tests.rb'>Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---serialize_deserialize_tests-rb'>Advanced Debugging - Unit Tests - serialize_deserialize_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/serialize_deserialize_tests.rb
def test_serialize args, assert
GTK::Entity.__reset_id__!
@@ -14722,7 +15469,7 @@ def test_by_reference_state_strict_entities args, assert
end
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---state_serialization_experimental_tests.rb'>Advanced Debugging - Unit Tests - state_serialization_experimental_tests.rb</h3>
+<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
MAX_CODE_GEN_LENGTH = 50
@@ -14832,7 +15579,7 @@ $gtk.reset 100
$gtk.log_level = :off
</code></pre>
-<h3 id='----advanced-debugging---unit-tests---suggest_autocompletion_tests.rb'>Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb</h3>
+<h3 id='----advanced-debugging---unit-tests---suggest_autocompletion_tests-rb'>Advanced Debugging - Unit Tests - suggest_autocompletion_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/10_advanced_debugging/03_unit_tests/suggest_autocompletion_tests.rb
def default_suggest_autocompletion args
{
@@ -14874,7 +15621,7 @@ S
end
</code></pre>
-<h3 id='----http---retrieve-images---main.rb'>Http - Retrieve Images - main.rb</h3>
+<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
def tick args
args.outputs.background_color = [0, 0, 0]
@@ -14931,7 +15678,7 @@ def tick args
end
</code></pre>
-<h3 id='----http---web-server---main.rb'>Http - Web Server - main.rb</h3>
+<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
def tick args
args.state.port ||= 3000
@@ -14962,7 +15709,7 @@ def tick args
end
</code></pre>
-<h3 id='----c-extensions---basics---main.rb'>C Extensions - Basics - main.rb</h3>
+<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")
include FFI::CExt
@@ -14976,7 +15723,7 @@ end
</code></pre>
-<h3 id='----c-extensions---intermediate---main.rb'>C Extensions - Intermediate - main.rb</h3>
+<h3 id='----c-extensions---intermediate---main-rb'>C Extensions - Intermediate - main.rb</h3>
<pre><code class="language-ruby"># ./samples/12_c_extensions/02_intermediate/app/main.rb
$gtk.ffi_misc.gtk_dlopen("ext")
include FFI::RE
@@ -14999,7 +15746,7 @@ def tick args
end
</code></pre>
-<h3 id='----c-extensions---native-pixel-arrays---main.rb'>C Extensions - Native Pixel Arrays - main.rb</h3>
+<h3 id='----c-extensions---native-pixel-arrays---main-rb'>C Extensions - Native Pixel Arrays - main.rb</h3>
<pre><code class="language-ruby"># ./samples/12_c_extensions/03_native_pixel_arrays/app/main.rb
$gtk.ffi_misc.gtk_dlopen("ext")
include FFI::CExt
@@ -15025,7 +15772,7 @@ end
</code></pre>
-<h3 id='----path-finding-algorithms---breadth-first-search---main.rb'>Path Finding Algorithms - Breadth First Search - main.rb</h3>
+<h3 id='----path-finding-algorithms---breadth-first-search---main-rb'>Path Finding Algorithms - Breadth First Search - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
# A visual demonstration of a breadth first search
# Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html
@@ -15721,7 +16468,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---detailed-breadth-first-search---main.rb'>Path Finding Algorithms - Detailed Breadth First Search - main.rb</h3>
+<h3 id='----path-finding-algorithms---detailed-breadth-first-search---main-rb'>Path Finding Algorithms - Detailed Breadth First Search - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
# A visual demonstration of a breadth first search
# Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html
@@ -16371,7 +17118,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---breadcrumbs---main.rb'>Path Finding Algorithms - Breadcrumbs - main.rb</h3>
+<h3 id='----path-finding-algorithms---breadcrumbs---main-rb'>Path Finding Algorithms - Breadcrumbs - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/03_breadcrumbs/app/main.rb
class Breadcrumbs
attr_gtk
@@ -16920,7 +17667,7 @@ end
# end
</code></pre>
-<h3 id='----path-finding-algorithms---early-exit---main.rb'>Path Finding Algorithms - Early Exit - main.rb</h3>
+<h3 id='----path-finding-algorithms---early-exit---main-rb'>Path Finding Algorithms - Early Exit - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/04_early_exit/app/main.rb
# Comparison of a breadth first search with and without early exit
# Inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html
@@ -17555,7 +18302,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---dijkstra---main.rb'>Path Finding Algorithms - Dijkstra - main.rb</h3>
+<h3 id='----path-finding-algorithms---dijkstra---main-rb'>Path Finding Algorithms - Dijkstra - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/05_dijkstra/app/main.rb
# Demonstrates how Dijkstra's Algorithm allows movement costs to be considered
@@ -18403,7 +19150,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---heuristic---main.rb'>Path Finding Algorithms - Heuristic - main.rb</h3>
+<h3 id='----path-finding-algorithms---heuristic---main-rb'>Path Finding Algorithms - Heuristic - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/06_heuristic/app/main.rb
# This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html
@@ -19387,7 +20134,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---heuristic-with-walls---main.rb'>Path Finding Algorithms - Heuristic With Walls - main.rb</h3>
+<h3 id='----path-finding-algorithms---heuristic-with-walls---main-rb'>Path Finding Algorithms - Heuristic With Walls - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/07_heuristic_with_walls/app/main.rb
# This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html
# The effectiveness of the Heuristic search algorithm is shown through this demonstration.
@@ -20404,7 +21151,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---a-star---main.rb'>Path Finding Algorithms - A Star - main.rb</h3>
+<h3 id='----path-finding-algorithms---a-star---main-rb'>Path Finding Algorithms - A Star - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/08_a_star/app/main.rb
# This program is inspired by https://www.redblobgames.com/pathfinding/a-star/introduction.html
@@ -21437,7 +22184,7 @@ def reset
end
</code></pre>
-<h3 id='----path-finding-algorithms---tower-defense---main.rb'>Path Finding Algorithms - Tower Defense - main.rb</h3>
+<h3 id='----path-finding-algorithms---tower-defense---main-rb'>Path Finding Algorithms - Tower Defense - main.rb</h3>
<pre><code class="language-ruby"># ./samples/13_path_finding_algorithms/09_tower_defense/app/main.rb
# An example of some major components in a tower defence game
# The pathing of the tanks is determined by A* algorithm -- try editing the walls
@@ -21742,7 +22489,7 @@ def a_star_color
end
</code></pre>
-<h3 id='----3d---3d-cube---main.rb'>3d - 3d Cube - main.rb</h3>
+<h3 id='----3d---3d-cube---main-rb'>3d - 3d Cube - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_3d/01_3d_cube/app/main.rb
STARTX = 0.0
STARTY = 0.0
@@ -21796,7 +22543,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----3d---wireframe---main.rb'>3d - Wireframe - main.rb</h3>
+<h3 id='----3d---wireframe---main-rb'>3d - Wireframe - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_3d/02_wireframe/app/main.rb
def tick args
args.state.model ||= Object3D.new('data/shuttle.off')
@@ -21949,11 +22696,11 @@ class Vertex
end
end
</code></pre>
-<h3 id='----3d---wireframe---data---what-is-this.txt'>3d - Wireframe - Data - what-is-this.txt</h3>
+<h3 id='----3d---wireframe---data---what-is-this-txt'>3d - Wireframe - Data - what-is-this.txt</h3>
<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='----arcade---bullet-hell---main.rb'>Arcade - Bullet Hell - main.rb</h3>
+<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
args.state.base_columns ||= 10.times.map { |n| 50 * n + 1280 / 2 - 5 * 50 + 5 }
@@ -22146,7 +22893,7 @@ def update_enemy_positions args
end
</code></pre>
-<h3 id='----arcade---dueling-starships---main.rb'>Arcade - Dueling Starships - main.rb</h3>
+<h3 id='----arcade---dueling-starships---main-rb'>Arcade - Dueling Starships - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/dueling_starships/app/main.rb
class DuelingSpaceships
attr_accessor :state, :inputs, :outputs, :grid
@@ -22515,14 +23262,14 @@ def tick args
end
</code></pre>
-<h3 id='----arcade/flappy-dragon/credits.txt'>arcade/flappy dragon/credits.txt</h3>
+<h3 id='----arcade/flappy-dragon/credits-txt'>arcade/flappy dragon/credits.txt</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/flappy_dragon/CREDITS.txt
code: Amir Rajan, https://twitter.com/amirrajan
graphics and audio: Nick Culbertson, https://twitter.com/MobyPixel
</code></pre>
-<h3 id='----arcade/flappy-dragon/main.rb'>arcade/flappy dragon/main.rb</h3>
+<h3 id='----arcade/flappy-dragon/main-rb'>arcade/flappy dragon/main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/flappy_dragon/app/main.rb
class FlappyDragon
attr_accessor :grid, :inputs, :state, :outputs
@@ -22886,7 +23633,7 @@ def tick args
end
</code></pre>
-<h3 id='----arcade---pong---main.rb'>Arcade - Pong - main.rb</h3>
+<h3 id='----arcade---pong---main-rb'>Arcade - Pong - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/pong/app/main.rb
def tick args
defaults args
@@ -23049,7 +23796,7 @@ begin :assets
end
</code></pre>
-<h3 id='----arcade---snakemoji---main.rb'>Arcade - Snakemoji - main.rb</h3>
+<h3 id='----arcade---snakemoji---main-rb'>Arcade - Snakemoji - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/snakemoji/app/main.rb
# coding: utf-8
################################
@@ -23218,7 +23965,7 @@ def defaults 🎮
end
</code></pre>
-<h3 id='----arcade---solar-system---main.rb'>Arcade - Solar System - main.rb</h3>
+<h3 id='----arcade---solar-system---main-rb'>Arcade - Solar System - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/solar_system/app/main.rb
# Focused tutorial video: https://s3.amazonaws.com/s3.dragonruby.org/dragonruby-nddnug-workshop.mp4
# Workshop/Presentation which provides motivation for creating a game engine: https://www.youtube.com/watch?v=S3CFce1arC8
@@ -23330,7 +24077,7 @@ def r
end
</code></pre>
-<h3 id='----arcade---sound-golf---main.rb'>Arcade - Sound Golf - main.rb</h3>
+<h3 id='----arcade---sound-golf---main-rb'>Arcade - Sound Golf - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/sound_golf/app/main.rb
=begin
@@ -23524,7 +24271,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----arcade---twinstick---main.rb'>Arcade - Twinstick - main.rb</h3>
+<h3 id='----arcade---twinstick---main-rb'>Arcade - Twinstick - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_arcade/twinstick/app/main.rb
def tick args
args.state.player ||= {x: 600, y: 320, w: 80, h: 80, path: 'sprites/circle-white.png', vx: 0, vy: 0, health: 10, cooldown: 0, score: 0}
@@ -23678,7 +24425,7 @@ def shoot_directional_vector args
[dx, dy]
end
</code></pre>
-<h3 id='----crafting---craft-game-starting-point---main.rb'>Crafting - Craft Game Starting Point - main.rb</h3>
+<h3 id='----crafting---craft-game-starting-point---main-rb'>Crafting - Craft Game Starting Point - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_crafting/craft_game_starting_point/app/main.rb
# ==================================================
# A NOTE TO JAM CRAFT PARTICIPANTS:
@@ -24105,7 +24852,439 @@ end
$gtk.reset
</code></pre>
-<h3 id='----dev-tools---add-buttons-to-console---main.rb'>Dev Tools - Add Buttons To Console - main.rb</h3>
+<h3 id='----crafting---farming-game-starting-point---main-rb'>Crafting - Farming Game Starting Point - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_crafting/farming_game_starting_point/app/main.rb
+def tick args
+ args.state.tile_size = 80
+ args.state.player_speed = 4
+ args.state.player ||= tile(args, 7, 3, 0, 128, 180)
+ generate_map args
+ #press j to plant a green onion
+ if args.inputs.keyboard.j
+ #change this part you can change what you want to plant
+ args.state.walls << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y)/args.state.tile_size), 255, 255, 255)
+ args.state.plants << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y+80)/args.state.tile_size), 0, 160, 0)
+ end
+ # Adds walls, background, and player to args.outputs.solids so they appear on screen
+ args.outputs.solids << [0,0,1280,720, 237,189,101]
+ args.outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']
+ args.outputs.solids << args.state.walls
+ args.outputs.solids << args.state.player
+ args.outputs.solids << args.state.plants
+ args.outputs.labels << [320, 640, "press J to plant", 3, 1, 255, 0, 0, 200]
+
+ move_player args, -1, 0 if args.inputs.keyboard.left # x position decreases by 1 if left key is pressed
+ move_player args, 1, 0 if args.inputs.keyboard.right # x position increases by 1 if right key is pressed
+ move_player args, 0, 1 if args.inputs.keyboard.up # y position increases by 1 if up is pressed
+ move_player args, 0, -1 if args.inputs.keyboard.down # y position decreases by 1 if down is pressed
+end
+
+# Sets position, size, and color of the tile
+def tile args, x, y, *color
+ [x * args.state.tile_size, # sets definition for array using method parameters
+ y * args.state.tile_size, # multiplying by tile_size sets x and y to correct position using pixel values
+ args.state.tile_size,
+ args.state.tile_size,
+ *color]
+end
+
+# Creates map by adding tiles to the wall, as well as a goal (that the player needs to reach)
+def generate_map args
+ return if args.state.area
+
+ # Creates the area of the map. There are 9 rows running horizontally across the screen
+ # and 16 columns running vertically on the screen. Any spot with a "1" is not
+ # open for the player to move into (and is green), and any spot with a "0" is available
+ # for the player to move in.
+ args.state.area = [
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],
+ ].reverse # reverses the order of the area collection
+
+ # By reversing the order, the way that the area appears above is how it appears
+ # on the screen in the game. If we did not reverse, the map would appear inverted.
+
+ #The wall starts off with no tiles.
+ args.state.walls = []
+ args.state.plants = []
+
+ # If v is 1, a green tile is added to args.state.walls.
+ # If v is 2, a black tile is created as the goal.
+ args.state.area.map_2d do |y, x, v|
+ if v == 1
+ args.state.walls << tile(args, x, y, 255, 160, 156) # green tile
+ end
+ end
+end
+
+# Allows the player to move their box around the screen
+def move_player args, *vector
+ box = args.state.player.shift_rect(vector) # box is able to move at an angle
+
+ # If the player's box hits a wall, it is not able to move further in that direction
+ return if args.state.walls
+ .any_intersect_rect?(box)
+
+ # Player's box is able to move at angles (not just the four general directions) fast
+ args.state.player =
+ args.state.player
+ .shift_rect(vector.x * args.state.player_speed, # if we don't multiply by speed, then
+ vector.y * args.state.player_speed) # the box will move extremely slow
+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:
+# You can put some quick verification tests here, any method
+# that starts with the `test_` will be run when you save this file.
+
+# Here is an example test and game
+
+# To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick
+
+class MySuperHappyFunGame
+ attr_gtk
+
+ def tick
+ outputs.solids << [100, 100, 300, 300]
+ end
+end
+
+def test_universe args, assert
+ game = MySuperHappyFunGame.new
+ game.args = args
+ game.tick
+ assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick"
+ assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending"
+ puts "test_universe completed successfully"
+end
+
+puts "running tests"
+$gtk.reset 100
+$gtk.log_level = :off
+$gtk.tests.start
+
+</code></pre>
+<h3 id='----dev-tools---add-buttons-to-console---main-rb'>Dev Tools - Add Buttons To Console - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_dev_tools/add_buttons_to_console/app/main.rb
# You can customize the buttons that show up in the Console.
class GTK::Console::Menu
@@ -24167,7 +25346,7 @@ def tick args
end
</code></pre>
-<h3 id='----dev-tools---animation-creator-starting-point---main.rb'>Dev Tools - Animation Creator Starting Point - main.rb</h3>
+<h3 id='----dev-tools---animation-creator-starting-point---main-rb'>Dev Tools - Animation Creator Starting Point - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_dev_tools/animation_creator_starting_point/app/main.rb
class OneBitLowrezPaint
attr_gtk
@@ -24272,12 +25451,12 @@ class OneBitLowrezPaint
label = { x: b.x + state.buttons_frame_selection.size.half,
y: b.y,
text: "#{i + 1}", r: 180, g: 180, b: 180,
- size_enum: -4, alignment_enum: 1 }.label
+ size_enum: -4, alignment_enum: 1 }.label!
- selection_border = b.merge(r: 40, g: 40, b: 40).border
+ selection_border = b.merge(r: 40, g: 40, b: 40).border!
if i == state.animation_frames_selected_index
- selection_border = b.merge(r: 40, g: 230, b: 200).border
+ selection_border = b.merge(r: 40, g: 230, b: 200).border!
end
[selection_border, label]
@@ -24616,7 +25795,7 @@ end
# $gtk.reset
</code></pre>
-<h3 id='----dev-tools---tile-editor-starting-point---main.rb'>Dev Tools - Tile Editor Starting Point - main.rb</h3>
+<h3 id='----dev-tools---tile-editor-starting-point---main-rb'>Dev Tools - Tile Editor Starting Point - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb
=begin
@@ -25011,7 +26190,525 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----lowrez---nokia-3310---main.rb'>Lowrez - Nokia 3310 - main.rb</h3>
+<h3 id='----dungeon-crawl---classics-jam---main-rb'>Dungeon Crawl - Classics Jam - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_dungeon_crawl/classics_jam/app/main.rb
+class Game
+ attr_gtk
+
+ def tick
+ defaults
+ render
+ input
+ calc
+ end
+
+ def defaults
+ player.x ||= 640
+ player.y ||= 360
+ player.w ||= 16
+ player.h ||= 16
+ player.attacked_at ||= -1
+ player.angle ||= 0
+ player.future_player ||= future_player_position 0, 0
+ player.projectiles ||= []
+ player.damage ||= 0
+ state.level ||= create_level level_one_template
+ end
+
+ def render
+ outputs.sprites << level.walls.map do |w|
+ w.merge(path: 'sprites/square/gray.png')
+ end
+
+ outputs.sprites << level.spawn_locations.map do |s|
+ s.merge(path: 'sprites/square/blue.png')
+ end
+
+ outputs.sprites << player.projectiles.map do |p|
+ p.merge(path: 'sprites/square/blue.png')
+ end
+
+ outputs.sprites << level.enemies.map do |e|
+ e.merge(path: 'sprites/square/red.png')
+ end
+
+ outputs.sprites << player.merge(path: 'sprites/circle/green.png', angle: player.angle)
+
+ outputs.labels << { x: 30, y: 30.from_top, text: "damage: #{player.damage || 0}" }
+ end
+
+ def input
+ player.angle = inputs.directional_angle || player.angle
+ if inputs.controller_one.key_down.a || inputs.keyboard.key_down.space
+ player.attacked_at = state.tick_count
+ end
+ end
+
+ def calc
+ calc_player
+ calc_projectiles
+ calc_enemies
+ calc_spawn_locations
+ end
+
+ def calc_player
+ if player.attacked_at == state.tick_count
+ player.projectiles << { at: state.tick_count,
+ x: player.x,
+ y: player.y,
+ angle: player.angle,
+ w: 4,
+ h: 4 }.center_inside_rect(player)
+ end
+
+ if player.attacked_at.elapsed_time > 5
+ future_player = future_player_position inputs.left_right * 2, inputs.up_down * 2
+ future_player_collision = future_collision player, future_player, level.walls
+ player.x = future_player_collision.x if !future_player_collision.dx_collision
+ player.y = future_player_collision.y if !future_player_collision.dy_collision
+ end
+ end
+
+ def calc_projectile_collisions entities
+ entities.each do |e|
+ e.damage ||= 0
+ player.projectiles.each do |p|
+ if !p.collided && (p.intersect_rect? e)
+ p.collided = true
+ e.damage += 1
+ end
+ end
+ end
+ end
+
+ def calc_projectiles
+ player.projectiles.map! do |p|
+ dx, dy = p.angle.vector 10
+ p.merge(x: p.x + dx, y: p.y + dy)
+ end
+
+ calc_projectile_collisions level.walls + level.enemies + level.spawn_locations
+ player.projectiles.reject! { |p| p.at.elapsed_time > 10000 }
+ player.projectiles.reject! { |p| p.collided }
+ level.enemies.reject! { |e| e.damage > e.hp }
+ level.spawn_locations.reject! { |s| s.damage > s.hp }
+ end
+
+ def calc_enemies
+ level.enemies.map! do |e|
+ dx = 0
+ dx = 1 if e.x < player.x
+ dx = -1 if e.x > player.x
+ dy = 0
+ dy = 1 if e.y < player.y
+ dy = -1 if e.y > player.y
+ future_e = future_entity_position dx, dy, e
+ future_e_collision = future_collision e, future_e, level.enemies + level.walls
+ e.next_x = e.x
+ e.next_y = e.y
+ e.next_x = future_e_collision.x if !future_e_collision.dx_collision
+ e.next_y = future_e_collision.y if !future_e_collision.dy_collision
+ e
+ end
+
+ level.enemies.map! do |e|
+ e.x = e.next_x
+ e.y = e.next_y
+ e
+ end
+
+ level.enemies.each do |e|
+ player.damage += 1 if e.intersect_rect? player
+ end
+ end
+
+ def calc_spawn_locations
+ level.spawn_locations.map! do |s|
+ s.merge(countdown: s.countdown - 1)
+ end
+ level.spawn_locations
+ .find_all { |s| s.countdown.neg? }
+ .each do |s|
+ s.countdown = s.rate
+ s.merge(countdown: s.rate)
+ new_enemy = create_enemy s
+ if !(level.enemies.find { |e| e.intersect_rect? new_enemy })
+ level.enemies << new_enemy
+ end
+ end
+ end
+
+ def create_enemy spawn_location
+ to_cell(spawn_location.ordinal_x, spawn_location.ordinal_y).merge hp: 2
+ end
+
+ def create_level level_template
+ {
+ walls: level_template.walls.map { |w| to_cell(w.ordinal_x, w.ordinal_y).merge(w) },
+ enemies: [],
+ spawn_locations: level_template.spawn_locations.map { |s| to_cell(s.ordinal_x, s.ordinal_y).merge(s) }
+ }
+ end
+
+ def level_one_template
+ {
+ walls: [{ ordinal_x: 25, ordinal_y: 20},
+ { ordinal_x: 25, ordinal_y: 21},
+ { ordinal_x: 25, ordinal_y: 22},
+ { ordinal_x: 25, ordinal_y: 23}],
+ spawn_locations: [{ ordinal_x: 10, ordinal_y: 10, rate: 120, countdown: 0, hp: 5 }]
+ }
+ end
+
+ def player
+ state.player ||= {}
+ end
+
+ def level
+ state.level ||= {}
+ end
+
+ def future_collision entity, future_entity, others
+ dx_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dx) }
+ dy_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dy) }
+
+ {
+ dx_collision: dx_collision,
+ x: future_entity.dx.x,
+ dy_collision: dy_collision,
+ y: future_entity.dy.y
+ }
+ end
+
+ def future_entity_position dx, dy, entity
+ {
+ dx: entity.merge(x: entity.x + dx),
+ dy: entity.merge(y: entity.y + dy),
+ both: entity.merge(x: entity.x + dx, y: entity.y + dy)
+ }
+ end
+
+ def future_player_position dx, dy
+ future_entity_position dx, dy, player
+ end
+
+ def to_cell ordinal_x, ordinal_y
+ { x: ordinal_x * 16, y: ordinal_y * 16, w: 16, h: 16 }
+ end
+end
+
+def tick args
+ $game ||= Game.new
+ $game.args = args
+ $game.tick
+end
+
+$gtk.reset
+$game = nil
+
+</code></pre>
+<h3 id='----fighting---special-move-inputs---main-rb'>Fighting - Special Move Inputs - main.rb</h3>
+<pre><code class="language-ruby"># ./samples/99_genre_fighting/01_special_move_inputs/app/main.rb
+def tick args
+ #tick_instructions args, "Use LEFT and RIGHT arrow keys to move and SPACE to jump."
+ defaults args
+ render args
+ input args
+ calc args
+end
+
+# sets default values and creates empty collections
+# initialization only happens in the first frame
+def defaults args
+ fiddle args
+
+ args.state.tick_count = args.state.tick_count
+ args.state.bridge_top = 128
+ args.state.player.x ||= 0 # initializes player's properties
+ args.state.player.y ||= args.state.bridge_top
+ args.state.player.w ||= 64
+ args.state.player.h ||= 64
+ args.state.player.dy ||= 0
+ args.state.player.dx ||= 0
+ args.state.player.r ||= 0
+ args.state.game_over_at ||= 0
+ args.state.animation_time ||=0
+
+ args.state.timeleft ||=0
+ args.state.timeright ||=0
+ args.state.lastpush ||=0
+
+ args.state.inputlist ||= ["j","k","l"]
+end
+
+# sets enemy, player, hammer values
+def fiddle args
+ args.state.gravity = -0.5
+ args.state.player_jump_power = 10 # sets player values
+ args.state.player_jump_power_duration = 5
+ args.state.player_max_run_speed = 20
+ args.state.player_speed_slowdown_rate = 0.9
+ args.state.player_acceleration = 0.9
+end
+
+# outputs objects onto the screen
+def render args
+ if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)
+ args.state.player.dx = 0
+ end
+
+ #move list
+ (args.layout.rect_group row: 0, col_from_right: 8, drow: 0.3,
+ merge: { vertical_alignment_enum: 0, size_enum: -2 },
+ group: [
+ { text: "move: WASD" },
+ { text: "jump: Space" },
+ { text: "attack forwards: J (while on ground" },
+ { text: "attack upwards: K (while on groud)" },
+ { text: "attack backwards: J (while on ground and holding A)" },
+ { text: "attack downwards: K (while in air)" },
+ { text: "dash attack: J, K in quick succession." },
+ { text: "shield: hold J, K at the same time." },
+ { text: "dash backwards: A, A in quick succession." },
+ ]).into args.outputs.labels
+
+ # registered moves
+ args.outputs.labels << { x: 0.to_layout_col,
+ y: 0.to_layout_row,
+ text: "input history",
+ size_enum: -2,
+ vertical_alignment_enum: 0 }
+
+ (args.state.inputlist.take(5)).map do |s|
+ { text: s, size_enum: -2, vertical_alignment_enum: 0 }
+ end.yield_self do |group|
+ (args.layout.rect_group row: 0.3, col: 0, drow: 0.3, group: group).into args.outputs.labels
+ end
+
+
+ #sprites
+ player = [args.state.player.x, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/square/white.png",
+ args.state.player.r]
+
+ playershield = [args.state.player.x - 20, args.state.player.y - 10,
+ args.state.player.w + 20, args.state.player.h + 20,
+ "sprites/square/blue.png",
+ args.state.player.r,
+ 0]
+
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png",
+ args.state.player.r,
+ 0]
+
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png",
+ args.state.player.r+90,
+ 0]
+
+ if ((args.state.tick_count - args.state.lastpush) <= 15)
+ if (args.state.inputlist[0] == "<<")
+ player = [args.state.player.x, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/square/yellow.png", args.state.player.r]
+ end
+
+ if (args.state.inputlist[0] == "shield")
+ player = [args.state.player.x, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/square/indigo.png", args.state.player.r]
+
+ playershield = [args.state.player.x - 10, args.state.player.y - 10,
+ args.state.player.w + 20, args.state.player.h + 20,
+ "sprites/square/blue.png", args.state.player.r, 50]
+ end
+
+ if (args.state.inputlist[0] == "back-attack")
+ playerjab = [args.state.player.x - 20, args.state.player.y,
+ args.state.player.w - 10, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r, 255]
+ end
+
+ if (args.state.inputlist[0] == "forward-attack")
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r, 255]
+ end
+
+ if (args.state.inputlist[0] == "up-attack")
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]
+ end
+
+ if (args.state.inputlist[0] == "dair")
+ playerupper = [args.state.player.x, args.state.player.y - 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]
+ end
+
+ if (args.state.inputlist[0] == "dash-attack")
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/violet.png", args.state.player.r + 90, 255]
+
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/violet.png", args.state.player.r, 255]
+ end
+ end
+
+ args.outputs.sprites << playerjab
+ args.outputs.sprites << playerupper
+ args.outputs.sprites << player
+ args.outputs.sprites << playershield
+
+ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge
+ [i * 64, args.state.bridge_top - 64, 64, 64]
+ end
+end
+
+# Performs calculations to move objects on the screen
+def calc args
+ # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.
+ args.state.player.x += args.state.player.dx
+ args.state.player.y += args.state.player.dy
+
+ # Since acceleration is the change in velocity, the change in y (dy) increases every frame
+ args.state.player.dy += args.state.gravity
+
+ # player's y position is either current y position or y position of top of
+ # bridge, whichever has a greater value
+ # ensures that the player never goes below the bridge
+ args.state.player.y = args.state.player.y.greater(args.state.bridge_top)
+
+ # player's x position is either the current x position or 0, whichever has a greater value
+ # ensures that the player doesn't go too far left (out of the screen's scope)
+ args.state.player.x = args.state.player.x.greater(0)
+
+ # player is not falling if it is located on the top of the bridge
+ args.state.player.falling = false if args.state.player.y == args.state.bridge_top
+ #args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player
+end
+
+# Resets the player by changing its properties back to the values they had at initialization
+def reset_player args
+ args.state.player.x = 0
+ args.state.player.y = args.state.bridge_top
+ args.state.player.dy = 0
+ args.state.player.dx = 0
+ args.state.enemy.hammers.clear # empties hammer collection
+ args.state.enemy.hammer_queue.clear # empties hammer_queue
+ args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)
+end
+
+# Processes input from the user to move the player
+def input args
+ if args.state.inputlist.length > 5
+ args.state.inputlist.pop
+ end
+
+ should_process_special_move = (args.inputs.keyboard.key_down.j) ||
+ (args.inputs.keyboard.key_down.k) ||
+ (args.inputs.keyboard.key_down.a) ||
+ (args.inputs.keyboard.key_down.d) ||
+ (args.inputs.controller_one.key_down.y) ||
+ (args.inputs.controller_one.key_down.x) ||
+ (args.inputs.controller_one.key_down.left) ||
+ (args.inputs.controller_one.key_down.right)
+
+ if (should_process_special_move)
+ if (args.inputs.keyboard.key_down.j && args.inputs.keyboard.key_down.k) ||
+ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.y)
+ args.state.inputlist.unshift("shield")
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&
+ (args.state.inputlist[0] == "forward-attack") && ((args.state.tick_count - args.state.lastpush) <= 15)
+ args.state.inputlist.unshift("dash-attack")
+ args.state.player.dx = 20
+ elsif (args.inputs.keyboard.key_down.j && args.inputs.keyboard.a) ||
+ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.left)
+ args.state.inputlist.unshift("back-attack")
+ elsif ( args.inputs.controller_one.key_down.x || args.inputs.keyboard.key_down.j)
+ args.state.inputlist.unshift("forward-attack")
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&
+ (args.state.player.y > 128)
+ args.state.inputlist.unshift("dair")
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y)
+ args.state.inputlist.unshift("up-attack")
+ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a) &&
+ (args.state.inputlist[0] == "<") &&
+ ((args.state.tick_count - args.state.lastpush) <= 10)
+ args.state.inputlist.unshift("<<")
+ args.state.player.dx = -15
+ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a)
+ args.state.inputlist.unshift("<")
+ args.state.timeleft = args.state.tick_count
+ elsif (args.inputs.controller_one.key_down.right || args.inputs.keyboard.key_down.d)
+ args.state.inputlist.unshift(">")
+ end
+
+ args.state.lastpush = args.state.tick_count
+ end
+
+ if args.inputs.keyboard.space || args.inputs.controller_one.r2 # if the user presses the space bar
+ args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame
+
+ # if the time that has passed since the jump is less than the player's jump duration and
+ # the player is not falling
+ if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling
+ args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump
+ end
+ end
+
+ # if the space bar is in the "up" state (or not being pressed down)
+ if args.inputs.keyboard.key_up.space || args.inputs.controller_one.key_up.r2
+ args.state.player.jumped_at = nil # jumped_at is empty
+ args.state.player.falling = true # the player is falling
+ end
+
+ if args.inputs.left # if left key is pressed
+ if args.state.player.dx < -5
+ args.state.player.dx = args.state.player.dx
+ else
+ args.state.player.dx = -5
+ end
+
+ elsif args.inputs.right # if right key is pressed
+ if args.state.player.dx > 5
+ args.state.player.dx = args.state.player.dx
+ else
+ args.state.player.dx = 5
+ end
+ else
+ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down
+ end
+
+ if ((args.state.player.dx).abs > 5) #&& ((args.state.tick_count - args.state.lastpush) <= 10)
+ args.state.player.dx *= 0.95
+ end
+end
+
+def tick_instructions args, text, y = 715
+ return if args.state.key_event_occurred
+ if args.inputs.mouse.click ||
+ args.inputs.keyboard.directional_vector ||
+ args.inputs.keyboard.key_down.enter ||
+ args.inputs.keyboard.key_down.space ||
+ args.inputs.keyboard.key_down.escape
+ args.state.key_event_occurred = true
+ end
+
+ args.outputs.debug << [0, y - 50, 1280, 60].solid
+ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
+ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+end
+
+</code></pre>
+<h3 id='----lowrez---nokia-3310---main-rb'>Lowrez - Nokia 3310 - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_lowrez/nokia_3310/app/main.rb
require 'app/nokia.rb'
@@ -25620,7 +27317,7 @@ def render_debug args
text: text,
size_enum: -1.5,
r: 255, g: 255, b: 255
- }.label
+ }.label!
end
args.outputs.debug << {
@@ -25630,7 +27327,7 @@ def render_debug args
size_enum: -0.5,
alignment_enum: 1,
r: 255, g: 255, b: 255
- }.label
+ }.label!
end
def snake_demo args
@@ -25640,7 +27337,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----lowrez---nokia-3310---nokia.rb'>Lowrez - Nokia 3310 - nokia.rb</h3>
+<h3 id='----lowrez---nokia-3310---nokia-rb'>Lowrez - Nokia 3310 - nokia.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_lowrez/nokia_3310/app/nokia.rb
# Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-)
# Head over to main.rb and study the code there.
@@ -25880,7 +27577,7 @@ module GTK
g: 240,
b: 216,
a: 100
- }.line
+ }.line!
end
(NOKIA_WIDTH + 1).map_with_index do |i|
@@ -25893,7 +27590,7 @@ module GTK
g: 240,
b: 216,
a: 100
- }.line
+ }.line!
end
@args.state.overlay_rendered = true
@@ -25903,7 +27600,7 @@ module GTK
end
</code></pre>
-<h3 id='----lowrez---resolution-64x64---lowrez.rb'>Lowrez - Resolution 64x64 - lowrez.rb</h3>
+<h3 id='----lowrez---resolution-64x64---lowrez-rb'>Lowrez - Resolution 64x64 - lowrez.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_lowrez/resolution_64x64/app/lowrez.rb
# Emulation of a 64x64 canvas. Don't change this file unless you know what you're doing :-)
# Head over to main.rb and study the code there.
@@ -26077,7 +27774,7 @@ module GTK
end
</code></pre>
-<h3 id='----lowrez---resolution-64x64---main.rb'>Lowrez - Resolution 64x64 - main.rb</h3>
+<h3 id='----lowrez---resolution-64x64---main-rb'>Lowrez - Resolution 64x64 - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_lowrez/resolution_64x64/app/main.rb
require 'app/lowrez.rb'
@@ -26641,7 +28338,7 @@ def render_debug args
g: 128,
b: 128,
a: 80
- }.line
+ }.line!
args.outputs.static_debug << {
x: LOWREZ_X_OFFSET + (i * 10),
@@ -26652,7 +28349,7 @@ def render_debug args
g: 128,
b: 128,
a: 80
- }.line
+ }.line!
end
end
@@ -26679,7 +28376,7 @@ def render_debug args
y: 720 - (i * 20),
text: text,
size_enum: -1.5
- }.label
+ }.label!
end
args.outputs.debug << {
@@ -26688,13 +28385,13 @@ def render_debug args
text: "INFO: dev mode is currently enabled. Comment out the invocation of ~render_debug~ within the ~tick~ method to hide the debug layer.",
size_enum: -0.5,
alignment_enum: 1
- }.label
+ }.label!
end
$gtk.reset
</code></pre>
-<h3 id='----platformer---clepto-frog---main.rb'>Platformer - Clepto Frog - main.rb</h3>
+<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'
@@ -27562,7 +29259,7 @@ def tick_instructions args, text, y = 715
end
</code></pre>
-<h3 id='----platformer---clepto-frog---map.rb'>Platformer - Clepto Frog - map.rb</h3>
+<h3 id='----platformer---clepto-frog---map-rb'>Platformer - Clepto Frog - map.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/clepto_frog/app/map.rb
$collisions = [
[326, 463, 64, 64],
@@ -28591,14 +30288,14 @@ $mugs = [
]
</code></pre>
-<h3 id='----platformer---gorillas-basic---credits.txt'>Platformer - Gorillas Basic - credits.txt</h3>
+<h3 id='----platformer---gorillas-basic---credits-txt'>Platformer - Gorillas Basic - credits.txt</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/gorillas_basic/CREDITS.txt
code: Amir Rajan, https://twitter.com/amirrajan
graphics: Nick Culbertson, https://twitter.com/MobyPixel
</code></pre>
-<h3 id='----platformer---gorillas-basic---main.rb'>Platformer - Gorillas Basic - main.rb</h3>
+<h3 id='----platformer---gorillas-basic---main-rb'>Platformer - Gorillas Basic - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/gorillas_basic/app/main.rb
class YouSoBasicGorillas
attr_accessor :outputs, :grid, :state, :inputs
@@ -28975,7 +30672,7 @@ def tick args
end
</code></pre>
-<h3 id='----platformer---gorillas-basic---tests.rb'>Platformer - Gorillas Basic - tests.rb</h3>
+<h3 id='----platformer---gorillas-basic---tests-rb'>Platformer - Gorillas Basic - tests.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/gorillas_basic/app/tests.rb
$gtk.reset 100
$gtk.supress_framerate_warning = true
@@ -28983,7 +30680,7 @@ $gtk.require 'app/tests/building_generation_tests.rb'
$gtk.tests.start
</code></pre>
-<h3 id='----platformer---gorillas-basic---tests---building_generation_tests.rb'>Platformer - Gorillas Basic - Tests - building_generation_tests.rb</h3>
+<h3 id='----platformer---gorillas-basic---tests---building_generation_tests-rb'>Platformer - Gorillas Basic - Tests - building_generation_tests.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/gorillas_basic/app/tests/building_generation_tests.rb
def test_solids args, assert
game = YouSoBasicGorillas.new
@@ -29002,7 +30699,7 @@ def test_solids args, assert
end
</code></pre>
-<h3 id='----platformer---the-little-probe---main.rb'>Platformer - The Little Probe - main.rb</h3>
+<h3 id='----platformer---the-little-probe---main-rb'>Platformer - The Little Probe - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/the_little_probe/app/main.rb
class FallingCircle
attr_gtk
@@ -29893,7 +31590,7 @@ def reset
end
</code></pre>
-<h3 id='----platformer---the-little-probe---data---level.txt'>Platformer - The Little Probe - Data - level.txt</h3>
+<h3 id='----platformer---the-little-probe---data---level-txt'>Platformer - The Little Probe - Data - level.txt</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/the_little_probe/data/level.txt
640,8840,1180,8840
-60,10220,0,9960
@@ -31377,7 +33074,7 @@ end
1910,11280,2200,11180
923.0029599285435,11398.99893503157,1264.002959928544,11351.99893503157
</code></pre>
-<h3 id='----platformer---the-little-probe---data---level_lava.txt'>Platformer - The Little Probe - Data - level_lava.txt</h3>
+<h3 id='----platformer---the-little-probe---data---level_lava-txt'>Platformer - The Little Probe - Data - level_lava.txt</h3>
<pre><code class="language-ruby"># ./samples/99_genre_platformer/the_little_probe/data/level_lava.txt
100,10740,500,10780
500,10780,960,10760
@@ -31615,7 +33312,7 @@ end
2200,11130,2360,11090
1840,11230,2200,11130
</code></pre>
-<h3 id='----rpg-narrative---choose-your-own-adventure---decision.rb'>Rpg Narrative - Choose Your Own Adventure - decision.rb</h3>
+<h3 id='----rpg-narrative---choose-your-own-adventure---decision-rb'>Rpg Narrative - Choose Your Own Adventure - decision.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/decision.rb
# Hey there! Welcome to Four Decisions. Here is how you
# create your decision tree. Remove =being and =end from the text to
@@ -31656,7 +33353,7 @@ def game
end
</code></pre>
-<h3 id='----rpg-narrative---choose-your-own-adventure---main.rb'>Rpg Narrative - Choose Your Own Adventure - main.rb</h3>
+<h3 id='----rpg-narrative---choose-your-own-adventure---main-rb'>Rpg Narrative - Choose Your Own Adventure - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/choose_your_own_adventure/app/main.rb
=begin
@@ -31792,7 +33489,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---lowrez_simulator.rb'>Rpg Narrative - Return Of Serenity - lowrez_simulator.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---lowrez_simulator-rb'>Rpg Narrative - Return Of Serenity - lowrez_simulator.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/lowrez_simulator.rb
###################################################################################
# YOU CAN PLAY AROUND WITH THE CODE BELOW, BUT USE CAUTION AS THIS IS WHAT EMULATES
@@ -31887,7 +33584,7 @@ def render_gridlines_if_needed args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---main.rb'>Rpg Narrative - Return Of Serenity - main.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---main-rb'>Rpg Narrative - Return Of Serenity - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/main.rb
require 'app/require.rb'
@@ -32364,7 +34061,7 @@ def player_xs args, x, y
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---require.rb'>Rpg Narrative - Return Of Serenity - require.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---require-rb'>Rpg Narrative - Return Of Serenity - require.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/require.rb
require 'app/lowrez_simulator.rb'
require 'app/storyline_day_one.rb'
@@ -32379,7 +34076,7 @@ require 'app/storyline_final_decision.rb'
require 'app/storyline.rb'
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline.rb'>Rpg Narrative - Return Of Serenity - storyline.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline-rb'>Rpg Narrative - Return Of Serenity - storyline.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline.rb
def hotspot_top
[4, 61, 56, 3]
@@ -32529,7 +34226,7 @@ def reload_current_scene
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_anka.rb'>Rpg Narrative - Return Of Serenity - storyline_anka.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_anka-rb'>Rpg Narrative - Return Of Serenity - storyline_anka.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_anka.rb
def anka_inside_room args
{
@@ -32660,7 +34357,7 @@ def replied_to_anka_back_home args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_blinking_light.rb'>Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_blinking_light-rb'>Rpg Narrative - Return Of Serenity - storyline_blinking_light.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_blinking_light.rb
def the_blinking_light args
{
@@ -32739,7 +34436,7 @@ def blinking_light_inside_mainframe args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_day_one.rb'>Rpg Narrative - Return Of Serenity - storyline_day_one.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_day_one-rb'>Rpg Narrative - Return Of Serenity - storyline_day_one.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_day_one.rb
def day_one_beginning args
{
@@ -32949,7 +34646,7 @@ def explaining_the_special_power_inside_computer args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_final_decision.rb'>Rpg Narrative - Return Of Serenity - storyline_final_decision.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_final_decision-rb'>Rpg Narrative - Return Of Serenity - storyline_final_decision.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_decision.rb
def final_decision_side_of_home args
{
@@ -33089,7 +34786,7 @@ def final_decision_ship_status_shared args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_final_message.rb'>Rpg Narrative - Return Of Serenity - storyline_final_message.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_final_message-rb'>Rpg Narrative - Return Of Serenity - storyline_final_message.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_final_message.rb
def final_message_sad args
{
@@ -33309,7 +35006,7 @@ def final_message_summary args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_serenity_alive.rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_serenity_alive-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_alive.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_alive.rb
def serenity_alive_side_of_home args
{
@@ -33532,7 +35229,7 @@ def serenity_alive_current_message args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_serenity_bio.rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_serenity_bio-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_bio.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_bio.rb
def serenity_bio_infront_of_home args
{
@@ -33687,7 +35384,7 @@ def bad_dream_last_reply args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_serenity_introduction.rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_serenity_introduction-rb'>Rpg Narrative - Return Of Serenity - storyline_serenity_introduction.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_serenity_introduction.rb
# decision_graph "Message from Sasha",
# "I should reply.",
@@ -33786,7 +35483,7 @@ def replied_to_introduction_side_of_home args
end
</code></pre>
-<h3 id='----rpg-narrative---return-of-serenity---storyline_speed_of_light.rb'>Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb</h3>
+<h3 id='----rpg-narrative---return-of-serenity---storyline_speed_of_light-rb'>Rpg Narrative - Return Of Serenity - storyline_speed_of_light.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_narrative/return_of_serenity/app/storyline_speed_of_light.rb
def speed_of_light_front_of_home args
{
@@ -33894,7 +35591,7 @@ def speed_of_light_end_of_day args
end
</code></pre>
-<h3 id='----rpg-roguelike---roguelike-starting-point---constants.rb'>Rpg Roguelike - Roguelike Starting Point - constants.rb</h3>
+<h3 id='----rpg-roguelike---roguelike-starting-point---constants-rb'>Rpg Roguelike - Roguelike Starting Point - constants.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/constants.rb
SHOW_LEGEND = true
SOURCE_TILE_SIZE = 16
@@ -33906,7 +35603,7 @@ TILE_B = 0
TILE_A = 255
</code></pre>
-<h3 id='----rpg-roguelike---roguelike-starting-point---legend.rb'>Rpg Roguelike - Roguelike Starting Point - legend.rb</h3>
+<h3 id='----rpg-roguelike---roguelike-starting-point---legend-rb'>Rpg Roguelike - Roguelike Starting Point - legend.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/legend.rb
def tick_legend args
return unless SHOW_LEGEND
@@ -33975,7 +35672,7 @@ def tick_legend args
end
</code></pre>
-<h3 id='----rpg-roguelike---roguelike-starting-point---main.rb'>Rpg Roguelike - Roguelike Starting Point - main.rb</h3>
+<h3 id='----rpg-roguelike---roguelike-starting-point---main-rb'>Rpg Roguelike - Roguelike Starting Point - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/main.rb
require 'app/constants.rb'
require 'app/sprite_lookup.rb'
@@ -34076,7 +35773,7 @@ def tile_in_game x, y, tile_key
end
</code></pre>
-<h3 id='----rpg-roguelike---roguelike-starting-point---sprite_lookup.rb'>Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb</h3>
+<h3 id='----rpg-roguelike---roguelike-starting-point---sprite_lookup-rb'>Rpg Roguelike - Roguelike Starting Point - sprite_lookup.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_roguelike/01_roguelike_starting_point/app/sprite_lookup.rb
def sprite_lookup
{
@@ -34204,7 +35901,7 @@ end
$gtk.args.state.reserved.sprite_lookup = sprite_lookup
</code></pre>
-<h3 id='----rpg-roguelike---roguelike-line-of-sight---main.rb'>Rpg Roguelike - Roguelike Line Of Sight - main.rb</h3>
+<h3 id='----rpg-roguelike---roguelike-line-of-sight---main-rb'>Rpg Roguelike - Roguelike Line Of Sight - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_roguelike/02_roguelike_line_of_sight/app/main.rb
=begin
@@ -34647,7 +36344,7 @@ def tick args
end
</code></pre>
-<h3 id='----rpg-tactical---hexagonal-grid---main.rb'>Rpg Tactical - Hexagonal Grid - main.rb</h3>
+<h3 id='----rpg-tactical---hexagonal-grid---main-rb'>Rpg Tactical - Hexagonal Grid - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_tactical/hexagonal_grid/app/main.rb
class HexagonTileGame
attr_gtk
@@ -34719,7 +36416,7 @@ end
$gtk.reset
</code></pre>
-<h3 id='----rpg-tactical---isometric-grid---main.rb'>Rpg Tactical - Isometric Grid - main.rb</h3>
+<h3 id='----rpg-tactical---isometric-grid---main-rb'>Rpg Tactical - Isometric Grid - main.rb</h3>
<pre><code class="language-ruby"># ./samples/99_genre_rpg_tactical/isometric_grid/app/main.rb
class Isometric
attr_accessor :grid, :inputs, :state, :outputs
@@ -34985,7 +36682,7 @@ def tick args
end
</code></pre>
-<h3 id='----rpg-topdown---topdown-starting-point---main.rb'>Rpg Topdown - Topdown Starting Point - main.rb</h3>
+<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
@@ -35101,7 +36798,7 @@ end
<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>.
</p>
-<h3 id='----args.rb'>args.rb</h3>
+<h3 id='----args-rb'>args.rb</h3>
<pre><code class="language-ruby"># ./dragon/args.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -35115,58 +36812,21 @@ module GTK
class Args
include ArgsDeprecated
include Serialize
-
- # Contains information related to input devices and input events.
- #
- # @return [Inputs]
attr_accessor :inputs
-
- # Contains the means to interact with output devices such as the screen.
- #
- # @return [Outputs]
attr_accessor :outputs
-
- # Contains the means to interact with the audio mixer.
- #
- # @return [Hash]
attr_accessor :audio
-
- # Contains display size information to assist in positioning things on the screen.
- #
- # @return [Grid]
attr_accessor :grid
-
- # Provides access to game play recording facilities within Game Toolkit.
- #
- # @return [Recording]
attr_accessor :recording
-
- # Gives you access to geometry related functions.
- #
- # @return [Geometry]
attr_accessor :geometry
-
attr_accessor :fn
-
- # This is where you'll put state associated with your video game.
- #
- # @return [OpenEntity]
attr_accessor :state
-
- # Gives you access to the top level DragonRuby runtime.
- #
- # @return [Runtime]
+ attr_accessor :temp_state
attr_accessor :runtime
alias_method :gtk, :runtime
-
attr_accessor :passes
-
attr_accessor :wizards
-
attr_accessor :layout
-
attr_accessor :easing
-
attr_accessor :string
def initialize runtime, recording
@@ -35175,6 +36835,7 @@ module GTK
@audio = {}
@passes = []
@state = OpenEntity.new
+ @temp_state = OpenEntity.new
@state.tick_count = -1
@runtime = runtime
@recording = recording
@@ -35204,11 +36865,12 @@ module GTK
def serialize
{
- state: state.as_hash,
- inputs: inputs.serialize,
- passes: passes.serialize,
- outputs: outputs.serialize,
- grid: grid.serialize
+ state: state.as_hash,
+ temp_state: temp_state.as_hash,
+ inputs: inputs.serialize,
+ passes: passes.serialize,
+ outputs: outputs.serialize,
+ grid: grid.serialize
}
end
@@ -35344,7 +37006,7 @@ module GTK
end
</code></pre>
-<h3 id='----assert.rb'>assert.rb</h3>
+<h3 id='----assert-rb'>assert.rb</h3>
<pre><code class="language-ruby"># ./dragon/assert.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -35372,10 +37034,10 @@ To add an assertion open up this class and write:
class Assert
def custom_assertion actual, expected, message = nil
- # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
+ # this tells Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
@assertion_performed = true
- # perform your custom logic here and rais an exception to denote a failure.
+ # perform your custom logic here and raise an exception to denote a failure.
raise "Some Error. #{message}."
end
@@ -35385,14 +37047,14 @@ end
attr :assertion_performed
=begin
-Us this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
+Use this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
=end
def ok!
@assertion_performed = true
end
=begin
-Assert if a value is a thruthy value. All assert method take an optional final parameter that is the message to display to the user.
+Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.
@example
@@ -35446,7 +37108,7 @@ end
@assertion_performed = true
if actual != expected
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
- message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}\n#{message}"
raise message
end
nil
@@ -35456,7 +37118,7 @@ end
@assertion_performed = true
if actual == expected
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
- message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}\n#{message}"
raise message
end
nil
@@ -35486,7 +37148,7 @@ end
end
</code></pre>
-<h3 id='----attr_gtk.rb'>attr_gtk.rb</h3>
+<h3 id='----attr_gtk-rb'>attr_gtk.rb</h3>
<pre><code class="language-ruby"># ./dragon/attr_gtk.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -35509,6 +37171,10 @@ module AttrGTK
args.state
end
+ def temp_state
+ args.temp_state
+ end
+
def inputs
args.inputs
end
@@ -35536,10 +37202,18 @@ module AttrGTK
def layout
args.layout
end
+
+ def new_entity entity_type, init_hash = nil, &block
+ args.state.new_entity entity_type, init_hash, &block
+ end
+
+ def new_entity_strict entity_type, init_hash = nil, &block
+ args.state.new_entity_strict entity_type, init_hash, &block
+ end
end
</code></pre>
-<h3 id='----attr_sprite.rb'>attr_sprite.rb</h3>
+<h3 id='----attr_sprite-rb'>attr_sprite.rb</h3>
<pre><code class="language-ruby"># ./dragon/attr_sprite.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -35580,7 +37254,7 @@ module AttrSprite
attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x,
:tile_y, :tile_w, :tile_h, :flip_horizontally,
:flip_vertically, :angle_anchor_x, :angle_anchor_y, :id,
- :source_x, :source_y, :source_w, :source_h
+ :source_x, :source_y, :source_w, :source_h, :blendmode_enum
def primitive_marker
:sprite
@@ -35600,7 +37274,7 @@ module AttrSprite
end
</code></pre>
-<h3 id='----console.rb'>console.rb</h3>
+<h3 id='----console-rb'>console.rb</h3>
<pre><code class="language-ruby"># ./dragon/console.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -35623,7 +37297,7 @@ module GTK
:font_style, :menu
def initialize
- @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)
+ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)
@menu = Menu.new self
@disabled = false
@log_offset = 0
@@ -35643,6 +37317,8 @@ module GTK
@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]
@animation_duration = 1.seconds
@shown_at = -1
load_history
@@ -35917,6 +37593,8 @@ S
if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa'
$gtk.request_quit
+ elsif cmd.start_with? ':'
+ send ((cmd.gsub '-', '_').gsub ':', '')
else
puts "-> #{cmd}"
begin
@@ -35925,13 +37603,19 @@ S
if $results.nil?
puts "=> nil"
elsif $results == :console_silent_eval
+ # do nothing since the console is silent
else
puts "=> #{$results}"
end
@last_command_errored = false
rescue Exception => e
try_search_docs e
- puts "* EXCEPTION: #{e}"
+ # if an exception is thrown and the bactrace includes something helpful, then show it
+ if (e.backtrace || []).first && (e.backtrace.first.include? "(eval)")
+ puts "* EXCEPTION: #{e}"
+ else
+ puts "* EXCEPTION: #{e}\n#{e.__backtrace_to_org__}"
+ end
end
end
end
@@ -36158,6 +37842,11 @@ S
end
render_log_offset args
+
+ args.outputs.reserved << { x: 10.from_right, y: @bottom + 10,
+ text: "Press CTRL+g or ESCAPE to clear the prompt.",
+ vertical_alignment_enum: 0,
+ alignment_enum: 2, r: 80, g: 80, b: 80 }.label!
end
def render_log_offset args
@@ -36180,7 +37869,7 @@ S
end
def include_subdued_markers? text
- include_any_words? text, subdued_markers
+ (text.start_with? "* INFO: ") && (include_any_words? text, subdued_markers)
end
def include_any_words? text, words
@@ -36326,8 +38015,32 @@ S
(log_entry.start_with? "**** ")
end
+ def code? log_entry
+ (just_symbol? log_entry) || (codeblock_marker? log_entry)
+ end
+
+ def just_symbol? log_entry
+ scrubbed = log_entry.gsub("*", "").strip
+ (scrubbed.start_with? ":") && (!scrubbed.include? " ") && (!scrubbed.include? "=>")
+ end
+
+ def code_comment? log_entry
+ return true if log_entry.strip.start_with?("# ")
+ return false
+ end
+
+ def codeblock_marker? log_entry
+ return true if log_entry.strip.start_with?("#+begin_src")
+ return true if log_entry.strip.start_with?("#+end_src")
+ return false
+ end
+
def color_for_log_entry(log_entry)
- if include_row_marker? log_entry
+ if code? log_entry
+ @code_color
+ elsif code_comment? log_entry
+ @comment_color
+ elsif include_row_marker? log_entry
@text_color
elsif include_error_marker? log_entry
@error_color
@@ -36374,7 +38087,7 @@ S
end
</code></pre>
-<h3 id='----console_color.rb'>console_color.rb</h3>
+<h3 id='----console_color-rb'>console_color.rb</h3>
<pre><code class="language-ruby"># ./dragon/console_color.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -36400,6 +38113,10 @@ module GTK
@color
end
+ def to_s
+ "GTK::Console::Color #{to_h}"
+ end
+
def to_h
{ r: @color[0], g: @color[1], b: @color[2], a: @color[3] }
end
@@ -36408,7 +38125,7 @@ module GTK
end
</code></pre>
-<h3 id='----console_font_style.rb'>console_font_style.rb</h3>
+<h3 id='----console_font_style-rb'>console_font_style.rb</h3>
<pre><code class="language-ruby"># ./dragon/console_font_style.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -36445,14 +38162,14 @@ module GTK
size_enum: size_enum,
alignment_enum: alignment_enum,
**color.to_h,
- }.label
+ }.label!
end
end
end
end
</code></pre>
-<h3 id='----console_menu.rb'>console_menu.rb</h3>
+<h3 id='----console_menu-rb'>console_menu.rb</h3>
<pre><code class="language-ruby"># ./dragon/console_menu.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -36507,7 +38224,7 @@ module GTK
def itch_wizard_clicked
@console.scroll_to_bottom
- $wizards.itch.start
+ $wizards.itch.restart
end
def docs_clicked
@@ -36532,6 +38249,7 @@ module GTK
@buttons = [
(button id: :record, row: 0, col: 9, text: "record gameplay", method: :record_clicked),
(button id: :replay, row: 0, col: 10, text: "start replay", method: :replay_clicked),
+ *custom_buttons
]
elsif @menu_shown == :hidden
@buttons = [
@@ -36590,8 +38308,8 @@ module GTK
method: method
}.let do |entity|
primitives = []
- primitives << entity[:rect].merge(a: 164).solid
- primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border
+ primitives << entity[:rect].solid!(a: 164)
+ primitives << entity[:rect].border!(r: 255, g: 255, b: 255)
primitives << text.wrapped_lines(5)
.map_with_index do |l, i|
[
@@ -36615,7 +38333,7 @@ module GTK
end
</code></pre>
-<h3 id='----console_prompt.rb'>console_prompt.rb</h3>
+<h3 id='----console_prompt-rb'>console_prompt.rb</h3>
<pre><code class="language-ruby"># ./dragon/console_prompt.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -36793,17 +38511,17 @@ S
"#{" " * (string_width.length - c.length) } #{c} |"
end.join
- # remove seperators between empty values
+ # remove separators between empty values
formated_row = formated_row.gsub(" | ", " ")
puts formated_row
end
- def pretty_print_row_seperator string_width, cell_width, column_width, columns
+ def pretty_print_row_separator string_width, cell_width, column_width, columns
# this is a joint: +--------
column_joint = "+#{"-" * cell_width}"
- # multiple joints create a row seperator: +----+----+
+ # multiple joints create a row separator: +----+----+
puts (column_joint * columns) + "+"
end
@@ -36812,12 +38530,12 @@ S
args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5,
y: y + 5,
x2: x + @cursor_position_px + 0.5,
- y2: y + @font_style.letter_size.y + 5)
+ y2: y + @font_style.letter_size.y + 4)
args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1,
y: y + 5,
x2: x + @cursor_position_px + 1,
- y2: y + @font_style.letter_size.y + 5)
+ y2: y + @font_style.letter_size.y + 4)
# debugging rectangle for string
# args.outputs.reserved << (@cursor_color.to_h.merge x: x,
@@ -36892,7 +38610,7 @@ S
end
</code></pre>
-<h3 id='----controller.rb'>controller.rb</h3>
+<h3 id='----controller-rb'>controller.rb</h3>
<pre><code class="language-ruby"># ./dragon/controller.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37018,7 +38736,7 @@ end
</code></pre>
-<h3 id='----controller/config.rb'>controller/config.rb</h3>
+<h3 id='----controller/config-rb'>controller/config.rb</h3>
<pre><code class="language-ruby"># ./dragon/controller/config.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37421,7 +39139,7 @@ module GTK
end
</code></pre>
-<h3 id='----controller/keys.rb'>controller/keys.rb</h3>
+<h3 id='----controller/keys-rb'>controller/keys.rb</h3>
<pre><code class="language-ruby"># ./dragon/controller/keys.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37439,7 +39157,7 @@ module GTK
:l1, :r1,
:l2, :r2,
:l3, :r3,
- :start, :select,
+ :start, :select, :home,
:directional_up, :directional_down, :directional_left, :directional_right
].freeze
@@ -37447,6 +39165,22 @@ module GTK
attr label
end
+ def back
+ @select
+ end
+
+ def back= value
+ @select = value
+ end
+
+ def guide
+ @home
+ end
+
+ def guide= value
+ @home = value
+ end
+
# Activate a key.
#
# @return [void]
@@ -37476,7 +39210,7 @@ module GTK
end
</code></pre>
-<h3 id='----directional_input_helper_methods.rb'>directional_input_helper_methods.rb</h3>
+<h3 id='----directional_input_helper_methods-rb'>directional_input_helper_methods.rb</h3>
<pre><code class="language-ruby"># ./dragon/directional_input_helper_methods.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37493,7 +39227,7 @@ module GTK
error_message = <<-S
* ERROR
-The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy:
+The GTK::DirectionalKeys module should only be included in objects that respond to the following api hierarchy:
- (#{ directional_methods.join("|") })
- key_held.(#{ directional_methods.join("|") })
@@ -37550,6 +39284,12 @@ S
end
end
+ def directional_angle
+ return nil unless directional_vector
+
+ Math.atan2(up_down, left_right).to_degrees
+ end
+
def method_missing m, *args
# combine the key with ctrl_
if m.to_s.start_with?("ctrl_")
@@ -37572,7 +39312,7 @@ S
end
</code></pre>
-<h3 id='----easing.rb'>easing.rb</h3>
+<h3 id='----easing-rb'>easing.rb</h3>
<pre><code class="language-ruby"># ./dragon/easing.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37672,7 +39412,7 @@ end
Easing = GTK::Easing
</code></pre>
-<h3 id='----entity.rb'>entity.rb</h3>
+<h3 id='----entity-rb'>entity.rb</h3>
<pre><code class="language-ruby"># ./dragon/entity.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37767,7 +39507,7 @@ S
end
</code></pre>
-<h3 id='----geometry.rb'>geometry.rb</h3>
+<h3 id='----geometry-rb'>geometry.rb</h3>
<pre><code class="language-ruby"># ./dragon/geometry.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -37776,6 +39516,22 @@ 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
+ px = point.x
+ py = point.y
+ cx = 0
+ cy = 0
+ if around
+ cx = around.x
+ cy = around.y
+ end
+
+ point.merge(x: ((px - cx) * c - (py - cy) * s) + cx,
+ y: ((px - cx) * s + (py - cy) * c) + cy)
+ end
+
# Returns f(t) for a cubic Bezier curve.
def self.cubic_bezier t, a, b, c, d
s = 1 - t
@@ -37857,7 +39613,7 @@ module GTK
rescue Exception => e
raise e, <<-S
* ERROR:
-center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+center_inside_rect for self #{self} and other_rect #{other_rect}.\n#{e}.
S
end
@@ -37874,7 +39630,7 @@ S
rescue Exception => e
raise e, <<-S
* ERROR:
-center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+center_inside_rect_x for self #{self} and other_rect #{other_rect}.\n#{e}.
S
end
@@ -37891,7 +39647,7 @@ S
rescue Exception => e
raise e, <<-S
* ERROR:
-center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+center_inside_rect_y for self #{self} and other_rect #{other_rect}.\n#{e}.
S
end
@@ -37900,7 +39656,7 @@ S
end
- # Returns a primitive that is anchored/repositioned based off its retangle.
+ # Returns a primitive that is anchored/repositioned based off its rectangle.
# @gtk
def anchor_rect anchor_x, anchor_y
current_w = self.w
@@ -38036,10 +39792,10 @@ S
# @gtk
def self.intersect_rect? rect_one, rect_two, tolerance = 0.1
- return false if rect_one.right - tolerance < rect_two.left + tolerance
- return false if rect_one.left + tolerance > rect_two.right - tolerance
- return false if rect_one.top - tolerance < rect_two.bottom + tolerance
- return false if rect_one.bottom + tolerance > rect_two.top - tolerance
+ return false if ((rect_one.x + rect_one.w) - tolerance) < (rect_two.x + tolerance)
+ return false if (rect_one.x + tolerance) > ((rect_two.x + rect_two.w) - tolerance)
+ return false if ((rect_one.y + rect_one.h) - tolerance) < (rect_two.y + tolerance)
+ return false if (rect_one.y + tolerance) > ((rect_two.y + rect_two.h) - tolerance)
return true
rescue Exception => e
context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]
@@ -38067,6 +39823,7 @@ S
- rect_one: #{rect_one}
- rect_two: #{rect_two}
#{context_help}
+\n#{e}
S
end
@@ -38077,14 +39834,14 @@ S
y = y.shift_down(size * anchor_y)
[x, y, size, size]
rescue Exception => e
- raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}."
+ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"
end
# @gtk
def self.distance point_one, point_two
Math.sqrt((point_two.x - point_one.x)**2 + (point_two.y - point_one.y)**2)
rescue Exception => e
- raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."
+ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}.\n#{e}"
end
# @gtk
@@ -38093,31 +39850,34 @@ S
d_x = end_point.x - start_point.x
Math::PI.+(Math.atan2(d_y, d_x)).to_degrees
rescue Exception => e
- raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}."
+ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"
end
# @gtk
def self.angle_to start_point, end_point
angle_from end_point, start_point
rescue Exception => e
- raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}."
+ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"
end
# @gtk
def self.point_inside_circle? point, circle_center_point, radius
(point.x - circle_center_point.x) ** 2 + (point.y - circle_center_point.y) ** 2 < radius ** 2
rescue Exception => e
- raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}"
+ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}.\n#{e}"
end
# @gtk
def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0
+ return nil if !inner_rect
+ return nil if !outer_rect
+
inner_rect.x + tolerance >= outer_rect.x - tolerance &&
- inner_rect.right - tolerance <= outer_rect.right + tolerance &&
+ (inner_rect.x + inner_rect.w) - tolerance <= (outer_rect.x + outer_rect.w) + tolerance &&
inner_rect.y + tolerance >= outer_rect.y - tolerance &&
- inner_rect.top - tolerance <= outer_rect.top + tolerance
+ (inner_rect.y + inner_rect.h) - tolerance <= (outer_rect.y + outer_rect.h) + tolerance
rescue Exception => e
- raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."
+ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}.\n#{e}"
end
# @gtk
@@ -38152,7 +39912,7 @@ S
return rect
end
rescue Exception => e
- raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}."
+ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"
end
# @gtk
@@ -38166,13 +39926,27 @@ S
anchor_x: anchor_x,
anchor_y: anchor_y
rescue Exception => e
- raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]."
+ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)].\n#{e}"
+ end
+
+ def self.rect_to_line rect
+ l = rect.to_hash.line
+ l.merge(x2: l.x + l.w - 1,
+ y2: l.y + l.h)
+ end
+
+ def self.rect_center_point rect
+ { x: rect.x + rect.w.half, y: rect.y + rect.h.half }
+ end
+
+ def rect_center_point
+ Geometry.rect_center_point self
end
end # module Geometry
end # module GTK
</code></pre>
-<h3 id='----grid.rb'>grid.rb</h3>
+<h3 id='----grid-rb'>grid.rb</h3>
<pre><code class="language-ruby"># ./dragon/grid.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -38361,11 +40135,19 @@ module GTK
def bottom_right
[@right, @bottom].point
end
+
+ def x
+ 0
+ end
+
+ def y
+ 0
+ end
end
end
</code></pre>
-<h3 id='----inputs.rb'>inputs.rb</h3>
+<h3 id='----inputs-rb'>inputs.rb</h3>
<pre><code class="language-ruby"># ./dragon/inputs.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -38560,6 +40342,30 @@ module GTK
}
end
+ def self.method_to_key_hash
+ return @method_to_key_hash if @method_to_key_hash
+ @method_to_key_hash = {}
+ string_representation_overrides ||= {
+ backspace: '\b'
+ }
+ char_to_method_hash.each do |k, v|
+ v.each do |vi|
+ t = { char_or_raw_key: k }
+
+ if k.is_a? Numeric
+ t[:raw_key] = k
+ t[:string_representation] = "raw_key == #{k}"
+ else
+ t[:char] = k
+ t[:string_representation] = "\"#{k.strip}\""
+ end
+
+ @method_to_key_hash[vi] = t
+ end
+ end
+ @method_to_key_hash
+ end
+
def self.char_to_method char, int = nil
methods = char_to_method_hash[char] || char_to_method_hash[int]
methods ? methods.dup : [char.to_sym || int]
@@ -38674,24 +40480,32 @@ S
end
def method_missing m, *args
- begin
- define_singleton_method(m) do
- r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)
- clear_key m
- return r
- end
+ if KeyboardKeys.method_to_key_hash[m.without_ending_bang]
+ begin
+ define_singleton_method(m) do
+ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)
+ clear_key m
+ return r
+ end
- return self.send m
- rescue Exception => e
- log_important "#{e}"
+ return self.send m
+ rescue Exception => e
+ log_important "#{e}"
+ end
end
+ did_you_mean = KeyboardKeys.method_to_key_hash.find_all do |k, v|
+ k.to_s[0..1] == m.to_s[0..1]
+ end.map {|k, v| ":#{k} (#{v[:string_representation]})" }
+ did_you_mean_string = ""
+ did_you_mean_string = ". Did you mean #{did_you_mean.join ", "}?"
+
raise <<-S
* ERROR:
-There is no member on the keyboard called #{m}. Here is a to_s representation of what's available:
-
-#{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}
+#{KeyboardKeys.method_to_key_hash.map { |k, v| "** :#{k} #{v.string_representation}" }.join("\n")}
+There is no key on the keyboard called :#{m}#{did_you_mean_string}.
+Full list of available keys =:points_up:=.
S
end
@@ -39075,6 +40889,10 @@ module GTK
(controller_one && controller_one.directional_vector)
end
+ def directional_angle
+ keyboard.directional_angle || (controller_one && controller_one.directional_angle)
+ end
+
# Returns a signal indicating right (`1`), left (`-1`), or neither ('0').
#
# @return [Integer]
@@ -39142,21 +40960,14 @@ module GTK
end
</code></pre>
-<h3 id='----ios_wizard.rb'>ios_wizard.rb</h3>
+<h3 id='----ios_wizard-rb'>ios_wizard.rb</h3>
<pre><code class="language-ruby"># ./dragon/ios_wizard.rb
+# Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński
# Copyright 2019 DragonRuby LLC
# MIT License
# ios_wizard.rb has been released under MIT (*only this file*).
-class WizardException < Exception
- attr_accessor :console_primitives
-
- def initialize *console_primitives
- @console_primitives = console_primitives
- end
-end
-
-class IOSWizard
+class IOSWizard < Wizard
def initialize
@doctor_executed_at = 0
end
@@ -39169,23 +40980,45 @@ class IOSWizard
@steps ||= []
end
- def steps_development_build
+ def prerequisite_steps
[
:check_for_xcode,
:check_for_brew,
:check_for_certs,
- :check_for_device,
- :check_for_dev_profile,
+ ]
+ end
+
+ def app_metadata_retrieval_steps
+ [
:determine_team_identifier,
:determine_app_name,
:determine_app_id,
- :blow_away_temp,
+ ]
+ end
+
+ def steps_development_build
+ [
+ *prerequisite_steps,
+
+ :check_for_device,
+ :check_for_dev_profile,
+
+ *app_metadata_retrieval_steps,
+
+ :clear_tmp_directory,
:stage_app,
+
:development_write_info_plist,
+
:write_entitlements_plist,
:compile_icons,
- :create_payload_directory,
+ :clear_payload_directory,
+
+ :create_payload_directory_dev,
+
+ :create_payload,
:code_sign_payload,
+
:create_ipa,
:deploy
]
@@ -39193,20 +41026,27 @@ class IOSWizard
def steps_production_build
[
- :check_for_xcode,
- :check_for_brew,
- :check_for_certs,
+ *prerequisite_steps,
+
:check_for_distribution_profile,
- :determine_team_identifier,
- :determine_app_name,
- :determine_app_id,
- :blow_away_temp,
+ :determine_app_version,
+
+ *app_metadata_retrieval_steps,
+
+ :clear_tmp_directory,
:stage_app,
+
:production_write_info_plist,
+
:write_entitlements_plist,
:compile_icons,
- :create_payload_directory,
+ :clear_payload_directory,
+
+ :create_payload_directory_prod,
+
+ :create_payload,
:code_sign_payload,
+
:create_ipa,
:print_publish_help
]
@@ -39242,6 +41082,8 @@ class IOSWizard
@steps = steps_development_build
@steps = steps_production_build if @production_build
@certificate_name = nil
+ @app_version = opts[:version]
+ @app_version = "1.0" if @opts[:env] == :dev && !@app_version
init_wizard_status
log_info "Starting iOS Wizard so we can deploy to your device."
@start_at = Kernel.global_tick_count
@@ -39263,8 +41105,10 @@ class IOSWizard
log "=" * $console.console_text_width
else
log_error e.to_s
+ log e.__backtrace_to_org__
end
+ init_wizard_status
$console.set_command "$wizards.ios.start env: :#{@opts[:env]}"
end
@@ -39371,13 +41215,66 @@ class IOSWizard
return "profiles/development.mobileprovision"
end
+ def ios_metadata_template
+ <<-S
+# 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=
+S
+ end
+
+ def ios_metadata
+ contents = $gtk.read_file 'metadata/ios_metadata.txt'
+
+ if !contents
+ $gtk.write_file 'metadata/ios_metadata.txt', ios_metadata_template
+ contents = $gtk.read_file 'metadata/ios_metadata.txt'
+ end
+
+ kvps = contents.each_line
+ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }
+ .map do |l|
+ key, value = l.split("=")
+ [key.strip.to_sym, value.strip]
+ end.flatten
+ Hash[*kvps]
+ end
+
+ def game_metadata
+ contents = $gtk.read_file 'metadata/game_metadata.txt'
+
+ kvps = contents.each_line
+ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }
+ .map do |l|
+ key, value = l.split("=")
+ [key.strip.to_sym, value.strip]
+ end.flatten
+ Hash[*kvps]
+ end
+
+ 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.",
+ "Instructions for where the values should come from are within metadata/ios_metadata.txt."
+ )
+ end
+
def determine_team_identifier
- @team_name = (team_identifier_from_provisioning_profile @opts[:env])
- log_info "Team Identifer is: #{@team_name}"
+ @team_id = (ios_metadata.teamid || "")
+ raise_ios_metadata_required if @team_id.strip.length == 0
+ log_info "Team Identifer is: #{@team_id}"
end
def determine_app_name
- @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data]
+ @app_name = (ios_metadata.appname || "")
+ raise_ios_metadata_required if @app_name.strip.length == 0
log_info "App name is: #{@app_name}."
end
@@ -39401,36 +41298,9 @@ class IOSWizard
$gtk.parse_xml scrubbed
end
- def app_id_from_provisioning_profile environment
- application_identifier_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]
- (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|
- if node[:children] && node[:children][0] && node[:children][0][:data] == "application-identifier"
- application_identifier_index = i
- break
- end
- end
-
- app_id_with_team_identifier = (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][application_identifier_index + 1][:children].first[:data]
- team_identifer = team_identifier_from_provisioning_profile environment
- app_id_with_team_identifier.gsub "#{team_identifer}.", ""
- end
-
- def team_identifier_from_provisioning_profile environment
- team_identifer_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]
-
- (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|
- if node[:children] && node[:children][0] && node[:children][0][:data] == "com.apple.developer.team-identifier"
- team_identifer_index = i
- break
- end
- end
-
- (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data]
- end
-
def determine_app_id
- @app_id = app_id_from_provisioning_profile @opts[:env]
-
+ @app_id = ios_metadata.appid
+ raise_ios_metadata_required if @app_id.strip.length == 0
log_info "App Identifier is set to : #{@app_id}"
end
@@ -39449,7 +41319,7 @@ class IOSWizard
end
end
- def blow_away_temp
+ def clear_tmp_directory
sh "rm -rf #{tmp_directory}"
end
@@ -39590,7 +41460,8 @@ XML
log_info "Creating Entitlements.plist"
- $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip
+ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip
+ $gtk.write_file_root "tmp/ios/Entitlements.txt", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip
sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\""
sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\""
@@ -39628,15 +41499,15 @@ XML
<key>CFBundleExecutable</key>
<string>:app_name</string>
<key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
+ <string>:app_version</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.6</string>
+ <string>:app_version</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>5.6</string>
+ <string>:app_version</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
@@ -39785,13 +41656,13 @@ XML
<key>CFBundleIdentifier</key>
<string>:app_id</string>
<key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
+ <string>:app_version</string>
<key>CFBundleName</key>
<string>:app_name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
@@ -39799,7 +41670,7 @@ XML
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
@@ -39885,6 +41756,7 @@ XML
info_plist_string.gsub!(":app_id", @app_id)
$gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
+ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip
@info_plist_written = true
end
@@ -39938,13 +41810,13 @@ XML
<key>CFBundleIdentifier</key>
<string>:app_id</string>
<key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
+ <string>:app_version</string>
<key>CFBundleName</key>
<string>:app_name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
@@ -39952,7 +41824,7 @@ XML
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
@@ -40036,8 +41908,10 @@ XML
info_plist_string.gsub!(":app_name", @app_name)
info_plist_string.gsub!(":app_id", @app_id)
+ info_plist_string.gsub!(":app_version", @app_version)
$gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
+ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip
@info_plist_written = true
end
@@ -40059,28 +41933,53 @@ XML
"#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}"
end
- def write_ip_address
+ def embed_mobileprovision
+ sh %Q[cp #{@provisioning_profile_path} "#{app_path}/embedded.mobileprovision"]
+ sh %Q[/usr/bin/plutil -convert binary1 "#{app_path}/Info.plist"]
+ end
+
+ def clear_payload_directory
+ sh %Q[rm "#{@app_name}".ipa]
+ sh %Q[rm -rf "#{app_path}/app"]
+ sh %Q[rm -rf "#{app_path}/sounds"]
+ sh %Q[rm -rf "#{app_path}/sprites"]
+ sh %Q[rm -rf "#{app_path}/data"]
+ sh %Q[rm -rf "#{app_path}/fonts"]
+ end
+
+ def stage_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/"]
+ sh %Q[cp -r "#{root_folder}/data/" "#{app_path}/data/"]
+ sh %Q[cp -r "#{root_folder}/fonts/" "#{app_path}/fonts/"]
+ end
+
+ def create_payload
+ sh %Q[mkdir -p #{tmp_directory}/ipa_root/Payload]
+ sh %Q[cp -r "#{app_path}" "#{tmp_directory}/ipa_root/Payload"]
+ sh %Q[chmod -R 755 "#{tmp_directory}/ipa_root/Payload"]
+ end
+
+ def create_payload_directory_dev
+ # write dev machine's ip address for hotloading
$gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip
+
+ embed_mobileprovision
+ clear_payload_directory
+ stage_app
end
- def create_payload_directory
- sh "cp #{@provisioning_profile_path} \"#{app_path}/embedded.mobileprovision\""
- sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""
- write_ip_address
- sh "rm \"#{@app_name}\".ipa"
- sh "rm -rf \"#{app_path}/app\""
- sh "rm -rf \"#{app_path}/sounds\""
- sh "rm -rf \"#{app_path}/sprites\""
- sh "rm -rf \"#{app_path}/data\""
- sh "rm -rf \"#{app_path}/fonts\""
- sh "cp -r \"#{root_folder}/app/\" \"#{app_path}/app/\""
- sh "cp -r \"#{root_folder}/sounds/\" \"#{app_path}/sounds/\""
- sh "cp -r \"#{root_folder}/sprites/\" \"#{app_path}/sprites/\""
- sh "cp -r \"#{root_folder}/data/\" \"#{app_path}/data/\""
- sh "cp -r \"#{root_folder}/fonts/\" \"#{app_path}/fonts/\""
- sh "mkdir -p #{tmp_directory}/ipa_root/Payload"
- sh "cp -r \"#{app_path}\" \"#{tmp_directory}/ipa_root/Payload\""
- sh "chmod -R 755 \"#{tmp_directory}/ipa_root/Payload\""
+ def create_payload_directory_prod
+ # production builds does not hotload ip address
+ sh %Q[rm "#{root_folder}/app/server_ip_address.txt"]
+
+ embed_mobileprovision
+ stage_app
+
+ # production build marker
+ sh %Q[mkdir -p "#{app_path}/metadata/"]
+ sh %Q[touch metadata/DRAGONRUBY_PRODUCTION_BUILD]
end
def create_ipa
@@ -40113,10 +42012,22 @@ SCRIPT
end
def print_publish_help
- log_info "Go to https://appstoreconnect.apple.com/apps and create an App if you haven't already done so."
- log_info "Go to https://appleid.apple.com and create a 'Application Specific Password'."
- log_info "To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."
- log_info "Your app is located at ./tmp/ios/#{@app_name}.ipa"
+ has_transporter = (sh "ls /Applications/Transporter.app").include? "Contents"
+ if !has_transporter
+ $gtk.openurl "https://apps.apple.com/us/app/transporter/id1450874784?mt=12"
+ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}, version: \"#{@opts[:version]}\""
+ raise WizardException.new(
+ "* To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."
+ )
+ else
+ sh "mkdir ./tmp/ios/intermediary_artifacts"
+ sh "mv \"#{tmp_directory}/#{@app_name}.app\" #{tmp_directory}/intermediary_artifacts/"
+ sh "mv \"#{tmp_directory}/do_zip.sh\" #{tmp_directory}/intermediary_artifacts"
+ sh "mv \"#{tmp_directory}/Entitlements.plist\" #{tmp_directory}/intermediary_artifacts"
+ sh "mv \"#{tmp_directory}/ipa_root\" #{tmp_directory}/intermediary_artifacts/"
+ sh "open /Applications/Transporter.app"
+ sh "open ./tmp/ios/"
+ end
end
def compile_icons
@@ -40137,47 +42048,43 @@ S
sh "cp -r \"#{root_folder}/native/\" \"#{app_path}/native/\""
sh "CODESIGN_ALLOCATE=\"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate\" /usr/bin/codesign -f -s \"#{@certificate_name}\" --entitlements #{tmp_directory}/Entitlements.plist \"#{tmp_directory}/#{@app_name}.app/native/ios-device/ext.dylib\""
end
+
+ def set_version version
+ @app_version = version
+ start env: @opts[:env], version: version
+ end
+
+ def app_version
+ log_info "Attempting to retrieve App Version from metadata/ios_metadata.txt."
+ ios_version_number = (ios_metadata.version || "").strip
+ if ios_version_number.length == 0
+ log_info "Not found. Attempting to retrieve App Version from metadata/game_metadata.txt."
+ ios_version_number = (game_metadata.version || "").strip
+ end
+ ios_version_number
+ end
+
+ def determine_app_version
+ @app_version = app_version
+ return if @app_version
+ end
end
</code></pre>
-<h3 id='----itch_wizard.rb'>itch_wizard.rb</h3>
+<h3 id='----itch_wizard-rb'>itch_wizard.rb</h3>
<pre><code class="language-ruby"># ./dragon/itch_wizard.rb
# Copyright 2019 DragonRuby LLC
# MIT License
# itch_wizard.rb has been released under MIT (*only this file*).
-class ItchWizard
+class ItchWizard < Wizard
def steps
[
:check_metadata,
- :deploy
+ :deploy,
]
end
- def metadata_file_path
- "metadata/game_metadata.txt"
- end
-
- def get_metadata
- metadata = $gtk.read_file metadata_file_path
-
- if !metadata
- write_blank_metadata
- metadata = $gtk.read_file metadata_file_path
- end
-
- dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
-
- {
- dev_id: dev_id.strip,
- dev_title: dev_title.strip,
- game_id: game_id.strip,
- game_title: game_title.strip,
- version: version.strip,
- icon: icon.strip
- }
- end
-
def write_blank_metadata
$gtk.write_file metadata_file_path, <<-S.strip
#devid=myname
@@ -40195,7 +42102,7 @@ S
write_blank_metadata
end
- if metadata_text.each_line.to_a.length != 6
+ if metadata_text.strip.each_line.to_a.length < 6
write_blank_metadata
end
@@ -40207,70 +42114,67 @@ S
if metadata[:dev_id].start_with?("#") || !@dev_id
log "* PROMPT: Please provide your username for Itch."
- $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\""
+ $console.set_command "$wizards.itch.set_dev_id \"#{metadata[:dev_id]}\""
return :need_dev_id
end
if metadata[:dev_title].start_with?("#") || !@dev_title
log "* PROMPT: Please provide developer's/company's name that you want displayed."
- $console.set_command "$wizards.itch.set_dev_title \"Your Name\""
+ $console.set_command "$wizards.itch.set_dev_title \"#{metadata[:dev_title]}\""
return :need_dev_title
end
if metadata[:game_id].start_with?("#") || !@game_id
log "* PROMPT: Please provide the id for you game. This is the id you specified when you set up a new game page on Itch."
- $console.set_command "$wizards.itch.set_game_id \"your-game-id\""
+ $console.set_command "$wizards.itch.set_game_id \"#{metadata[:game_id]}\""
return :need_game_id
end
if metadata[:game_title].start_with?("#") || !@game_title
log "* PROMPT: Please provide the display name for your game. (This can include spaces)"
- $console.set_command "$wizards.itch.set_game_title \"Your Game\""
+ $console.set_command "$wizards.itch.set_game_title \"#{metadata[:game_title]}\""
return :need_game_title
end
if metadata[:version].start_with?("#") || !@version
log "* PROMPT: Please provide the version for your game."
- $console.set_command "$wizards.itch.set_version \"1.0\""
+ $console.set_command "$wizards.itch.set_version \"#{metadata[:version]}\""
return :need_version
end
if metadata[:icon].start_with?("#") || !@icon
log "* PROMPT: Please provide icon path for your game."
- $console.set_command "$wizards.itch.set_icon \"icon.png\""
+ $console.set_command "$wizards.itch.set_icon \"#{metadata[:icon]}\""
return :need_icon
end
+ puts "here!! success!!!"
+
return :success
end
def set_dev_id value
@dev_id = value
- write_metadata
start
end
def set_dev_title value
@dev_title = value
- write_metadata
start
end
def set_game_id value
@game_id = value
- write_metadata
start
end
def set_game_title value
@game_title = value
- write_metadata
start
end
def set_version value
@version = value
- write_metadata
start
end
@@ -40313,7 +42217,7 @@ S
end
if @icon
- text += "icon=metadata/#{@icon}\n"
+ text += "icon=#{@icon}\n"
else
text += "#icon=metadata/icon.png\n"
end
@@ -40331,10 +42235,25 @@ S
def deploy
log_info "* Running dragonruby-publish: #{package_command}"
- results = $gtk.exec package_command
+ $gtk.openurl "http://itch.io/dashboard" if $gtk.platform == "Mac OS X"
+ if $gtk.platform? :mac
+ $gtk.exec "rm -rf ./builds"
+ end
+ results = $gtk.exec "#{package_command} --only-package"
+ puts File.expand_path("./builds")
+
log "#+begin_src"
log results
log "#+end_src"
+
+ if $gtk.platform? :mac
+ $gtk.exec "open ./builds/"
+ elsif $gtk.platform? :windows
+ $gtk.exec "powershell \"ii .\""
+ end
+
+ $gtk.openurl "https://itch.io/dashboard"
+
:success
end
@@ -40345,7 +42264,7 @@ S
steps.each do |m|
begin
log_info "Running Itch Wizard Step: ~$wizards.itch.#{m}~"
- result = (send m) || :success if @wizard_status[m][:result] != :success
+ result = (send m) || :success
@wizard_status[m][:result] = result
if result != :success
log_info "Exiting wizard. :#{result}"
@@ -40412,7 +42331,7 @@ S
end
</code></pre>
-<h3 id='----layout.rb'>layout.rb</h3>
+<h3 id='----layout-rb'>layout.rb</h3>
<pre><code class="language-ruby"># ./dragon/layout.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -40692,10 +42611,18 @@ module GTK
device.grid_area.row_count
end
+ def row_max_index
+ row_count - 1
+ end
+
def col_count
device.grid_area.col_count
end
+ def col_max_index
+ col_count - 1
+ end
+
def gutter_height
device.grid_area.gutter
end
@@ -40718,18 +42645,124 @@ module GTK
def rect_defaults
{
- row: nil,
- col: nil,
- h: 1,
- w: 1,
- dx: 0,
- dy: 0,
- rect: :control_rect
+ row: nil,
+ col: nil,
+ h: 1,
+ w: 1,
+ dx: 0,
+ dx_ratio: 1,
+ dy: 0,
+ dy_ratio: 1,
+ dh_ratio: 1,
+ dw_ratio: 1,
+ merge: nil,
+ rect: :control_rect
}
end
- def rect opts
+ def row n
+ (rect row: n, col: 0, w: 0, h: 0).x
+ end
+
+ def row_from_bottom n
+ (rect row: row_count - n, col: 0, w: 0, h: 0).x
+ end
+
+ def col n
+ (rect row: 0, col: n, w: 0, h: 0).y
+ end
+
+ def col_from_right n
+ (rect row: 0, col: col_max_index - n, w: 0, h: 0).y
+ end
+
+ def w n
+ (rect row: 0, col: 0, w: n, h: 1).w
+ end
+
+ def h n
+ (rect row: 0, col: 0, w: 1, h: n).h
+ end
+
+ def rect_group opts
+ group = opts.group
+ r = opts.row || 0
+ r = row_max_index - opts.row_from_bottom if opts.row_from_bottom
+ c = opts.col || 0
+ c = col_max_index - opts.col_from_right if opts.col_from_right
+ drow = opts.drow || 0
+ dcol = opts.dcol || 0
+ w = opts.w || 0
+ h = opts.h || 0
+ merge = opts[:merge]
+
+ running_row = r
+ running_col = c
+
+ running_col = calc_col_offset(opts.col_offset) if opts.col_offset
+ running_row = calc_row_offset(opts.row_offset) if opts.row_offset
+
+ group.map do |i|
+ group_layout_opts = i.layout || {}
+ group_layout_opts = group_layout_opts.merge row: running_row,
+ col: running_col,
+ merge: merge,
+ w: w, h: h
+ result = (rect group_layout_opts).merge i
+
+ if (i.is_a? Hash) && (i.primitive_marker == :label)
+ if i.alignment_enum == 1
+ result.x += result.w.half
+ elsif i.alignment_enum == 2
+ result.x += result.w
+ end
+ end
+
+ running_row += drow
+ running_col += dcol
+ result
+ end
+ end
+
+ def calc_row_offset opts = {}
+ count = opts[:count] || opts[:length] || 0
+ h = opts.h || 1
+ (row_count - (count * h)) / 2.0
+ end
+
+ def calc_col_offset opts = {}
+ count = opts[:count] || opts[:length] || 0
+ w = opts.w || 1
+ (col_count - (count * w)) / 2.0
+ end
+
+ def point opts = {}
+ opts.w = 1
+ opts.h = 1
+ opts.row ||= 0
+ opts.col ||= 0
+ r = rect opts
+ r.x += r.w * opts.col_anchor if opts.col_anchor
+ r.y += r.h * opts.row_anchor if opts.row_anchor
+ r
+ end
+
+ def rect *all_opts
+ if all_opts.length == 1
+ opts = all_opts.first
+ else
+ opts = {}
+ all_opts.each do |o|
+ opts.merge! o
+ end
+ end
+
+ opts.row = row_max_index - opts.row_from_bottom if opts.row_from_bottom
+ opts.col = col_max_index - opts.col_from_right if opts.col_from_right
opts = rect_defaults.merge opts
+ opts.row ||= 0
+ opts.col ||= 0
+
result = send opts[:rect]
if opts[:row] && opts[:col] && opts[:w] && opts[:h]
col = rect_col opts[:col], opts[:w]
@@ -40737,7 +42770,9 @@ module GTK
result = control_rect.merge x: col.x,
y: row.y,
w: col.w,
- h: row.h
+ h: row.h,
+ center_x: col.center_x,
+ center_y: row.center_y
elsif opts[:row] && !opts[:col]
result = rect_row opts[:row], opts[:h]
elsif !opts[:row] && opts[:col]
@@ -40775,13 +42810,21 @@ module GTK
result[:h] += device.grid_area.gutter * 2
end
- result[:x] += opts[:dx] if opts[:dx]
- result[:y] += opts[:dy] if opts[:dy]
- result[:w] += opts[:dw] if opts[:dw]
- result[:h] += opts[:dh] if opts[:dh]
+ result[:x] += opts[:dx] if opts[:dx]
+ result[:x] *= opts[:dx_ratio] if opts[:dx_ratio]
+ result[:y] += opts[:dy] if opts[:dy]
+ result[:y] *= opts[:dy_ratio] if opts[:dy_ratio]
+ result[:w] += opts[:dw] if opts[:dw]
+ result[:w] *= opts[:dw_ratio] if opts[:dw_ratio]
+ result[:h] += opts[:dh] if opts[:dh]
+ result[:h] *= opts[:dh_ratio] if opts[:dh_ratio]
+ result.merge! opts[:merge] if opts[:merge]
result[:row] = opts[:row]
result[:col] = opts[:col]
+ result[:h] = result[:h].clamp 0
+ result[:w] = result[:w].clamp 0
+
if $gtk.args.grid.name == :center
result[:x] -= 640
result[:y] -= 360
@@ -40816,7 +42859,7 @@ module GTK
row_y = device.h - row_y - row_h
- result = control_rect.merge y: row_y, h: row_h
+ result = control_rect.merge y: row_y, h: row_h, center_y: (row_y + row_h.half)
@rect_cache[:row][index][h] = result
@rect_cache[:row][index][h]
end
@@ -40839,7 +42882,7 @@ module GTK
col_w = col_w.to_i
col_w -= 1 if col_w.odd?
- result = control_rect.merge x: col_x, w: col_w
+ result = control_rect.merge x: col_x, w: col_w, center_x: (col_x + col_w.half)
@rect_cache[:col][index][w] = result
@rect_cache[:col][index][w]
end
@@ -40890,6 +42933,26 @@ module GTK
@device
end
+ def debug_primitives opts = {}
+ @primitives ||= col_count.map_with_index do |col|
+ row_count.map_with_index do |row|
+ cell = rect row: row, col: col
+ center = Geometry.rect_center_point cell
+ [
+ cell.merge(opts).border,
+ cell.merge(opts)
+ .label!(x: center.x,
+ y: center.y,
+ text: "#{row},#{col}",
+ size_enum: -3,
+ vertical_alignment_enum: 1,
+ alignment_enum: 1)
+ ]
+ end
+ end
+ @primitives
+ end
+
def serialize
{
device: @device.serialize,
@@ -40903,11 +42966,18 @@ module GTK
def to_s
serialize.to_s
end
+
+ def reset
+ @primitives = nil
+ @rect_cache ||= {}
+ @rect_cache.clear
+ end
+
end
end
</code></pre>
-<h3 id='----log.rb'>log.rb</h3>
+<h3 id='----log-rb'>log.rb</h3>
<pre><code class="language-ruby"># ./dragon/log.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -41040,6 +43110,11 @@ module GTK
self.puts message
end
+ def self.reset
+ @once = {}
+ nil
+ end
+
def self.puts_once *ids, message
id = "#{ids}"
@once ||= {}
@@ -41175,7 +43250,52 @@ class Object
end
</code></pre>
-<h3 id='----numeric.rb'>numeric.rb</h3>
+<h3 id='----metadata-rb'>metadata.rb</h3>
+<pre><code class="language-ruby"># ./dragon/metadata.rb
+# Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński
+# Copyright 2021 DragonRuby LLC
+# MIT License
+# metadata.rb has been released under MIT (*only this file*).
+
+module Metadata
+ def metadata_file_path
+ "metadata/game_metadata.txt"
+ end
+
+ def get_metadata
+ metadata = $gtk.read_file metadata_file_path
+
+ if !metadata
+ write_blank_metadata
+ metadata = $gtk.read_file metadata_file_path
+ end
+
+ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
+
+ {
+ dev_id: dev_id.strip,
+ dev_title: dev_title.strip,
+ game_id: game_id.strip,
+ game_title: game_title.strip,
+ version: version.strip,
+ icon: icon.strip
+ }
+ end
+
+ def write_blank_metadata
+ $gtk.write_file metadata_file_path, <<-S.strip
+#devid=myname
+#devtitle=My Name
+#gameid=mygame
+#gametitle=My Game
+#version=0.1
+#icon=metadata/icon.png
+S
+ end
+end
+
+</code></pre>
+<h3 id='----numeric-rb'>numeric.rb</h3>
<pre><code class="language-ruby"># ./dragon/numeric.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -41192,6 +43312,35 @@ class Numeric
alias_method :lte, :<=
alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__
+ def to_layout_row opts = {}
+ $layout.rect(row: self,
+ col: opts.col || 0,
+ w: opts.w || 0,
+ h: opts.h || 0).y
+ end
+
+ def to_layout_col opts = {}
+ $layout.rect(row: 0,
+ col: self,
+ w: opts.w || 0,
+ h: opts.h || 0).x
+ end
+
+ def to_layout_w
+ $layout.rect(row: 0, col: 0, w: self, h: 1).w
+ end
+
+ def to_layout_h
+ $layout.rect(row: 0, col: 0, w: 1, h: self).h
+ end
+
+ def to_layout_row_from_bottom opts = {}
+ ($layout.row_max_index - self).to_layout_row opts
+ end
+
+ def to_layout_col_from_right opts = {}
+ ($layout.col_max_index - self).to_layout_col opts
+ end
# Converts a numeric value representing seconds into frames.
#
@@ -41207,10 +43356,26 @@ class Numeric
self / 2.0
end
+ def third
+ self / 3.0
+ end
+
+ def quarter
+ self / 4.0
+ end
+
def to_byte
clamp(0, 255).to_i
end
+ def clamp *opts
+ min = (opts.at 0)
+ max = (opts.at 1)
+ return min if min && self < min
+ return max if max && self > max
+ return self
+ end
+
def clamp_wrap min, max
max, min = min, max if min > max
return self if self >= min && self <= max
@@ -41435,7 +43600,7 @@ S
self * Math::PI.fdiv(180)
end
- # Converts a number representing an angle in radians to degress.
+ # Converts a number representing an angle in radians to degrees.
#
# @gtk
def to_degrees
@@ -41452,21 +43617,21 @@ S
GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y)
end
- # Returns a normal vector for a number that represents an angle in degress.
+ # Returns a normal vector for a number that represents an angle in degrees.
#
# @gtk
def vector max_value = 1
[vector_x(max_value), vector_y(max_value)]
end
- # Returns the y component of a normal vector for a number that represents an angle in degress.
+ # Returns the y component of a normal vector for a number that represents an angle in degrees.
#
# @gtk
def vector_y max_value = 1
max_value * Math.sin(self.to_radians)
end
- # Returns the x component of a normal vector for a number that represents an angle in degress.
+ # Returns the x component of a normal vector for a number that represents an angle in degrees.
#
# @gtk
def vector_x max_value = 1
@@ -41493,6 +43658,18 @@ S
(self % n) == 0
end
+ def multiply n
+ self * n
+ end
+
+ def fmult n
+ self * n.to_f
+ end
+
+ def imult n
+ (self * n).to_i
+ end
+
def mult n
self * n
end
@@ -41614,12 +43791,6 @@ S
return gt other
end
- def == other
- return true if __original_eq_eq__ other
- return __original_eq_eq__ other.entity_id if other.is_a? OpenEntity
- return false
- end
-
# @gtk
def map
unless block_given?
@@ -41706,29 +43877,29 @@ S
end
def - other
- return nil unless other
- super
+ return self unless other
+ self - other
rescue Exception => e
__raise_arithmetic_exception__ other, :-, e
end
def + other
- return nil unless other
- super
+ return self unless other
+ self + other
rescue Exception => e
__raise_arithmetic_exception__ other, :+, e
end
def * other
- return nil unless other
- super
+ return self unless other
+ self * other
rescue Exception => e
__raise_arithmetic_exception__ other, :*, e
end
def / other
- return nil unless other
- super
+ return self unless other
+ self / other
rescue Exception => e
__raise_arithmetic_exception__ other, :/, e
end
@@ -41758,6 +43929,10 @@ S
def self.clamp n, min, max
n.clamp min, max
end
+
+ def mid? l, r
+ (between? l, r) || (between? r, l)
+ end
end
class Fixnum
@@ -41784,39 +43959,33 @@ class Fixnum
end
def + other
- return nil unless other
- super
+ return self unless other
+ self + other
rescue Exception => e
__raise_arithmetic_exception__ other, :+, e
end
def * other
- return nil unless other
- super
+ return self unless other
+ self * other
rescue Exception => e
__raise_arithmetic_exception__ other, :*, e
end
def / other
- return nil unless other
- super
+ return self unless other
+ self / other
rescue Exception => e
__raise_arithmetic_exception__ other, :/, e
end
def - other
- return nil unless other
- super
+ return self unless other
+ self - other
rescue Exception => e
__raise_arithmetic_exception__ other, :-, e
end
- def == other
- return true if __original_eq_eq__ other
- return __original_eq_eq__ other.entity_id if other.is_a? GTK::OpenEntity
- return false
- 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`.
#
@@ -41873,28 +44042,28 @@ class Float
alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__
def - other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :-, e
end
def + other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :+, e
end
def * other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :*, e
end
def / other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :/, e
@@ -41941,10 +44110,14 @@ class Integer
def nan?
false
end
+
+ def center other
+ (self - other).abs.fdiv(2)
+ end
end
</code></pre>
-<h3 id='----remote_hotload_client.rb'>remote_hotload_client.rb</h3>
+<h3 id='----remote_hotload_client-rb'>remote_hotload_client.rb</h3>
<pre><code class="language-ruby"># ./dragon/remote_hotload_client.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -41995,7 +44168,7 @@ module GTK
def local_state
@local_state ||= OpenEntity.new
@local_state.hotload_client ||= @local_state.new_entity(:hotload_client,
- notes: "This enitity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",
+ notes: "This entity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",
changes: { },
changes_queue: [],
reloaded_files_times: [])
@@ -42141,7 +44314,7 @@ module GTK
end
</code></pre>
-<h3 id='----runtime/autocomplete.rb'>runtime/autocomplete.rb</h3>
+<h3 id='----runtime/autocomplete-rb'>runtime/autocomplete.rb</h3>
<pre><code class="language-ruby"># ./dragon/runtime/autocomplete.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -42169,7 +44342,7 @@ module GTK
sub_index = index - previous_line[:sum]
word = (cursor_line[:line][0..sub_index - 1]).strip
token = (word.split " ")[-1]
- dots = (token.split ".")
+ dots = (token.split ".").flat_map { |s| s.split "[" }.flat_map { |s| s.split "]" }.flat_map { |s| s.split "(" }.flat_map { |s| s.split ")" }
dot = dots[-1]
end
@@ -42190,6 +44363,10 @@ module GTK
ignores ||= []
ignores = [ignores].flatten
keys = keys.map { |k| k.to_s }
+ keys = keys.reject { |k| k.include? '"' }
+ .reject { |k| k.start_with? "'" }
+ .reject { |k| k.include? "," }
+ .reject { |k| k.start_with? "#" }
others = ["def", "end"] +
[ :entity_keys_by_ref,
:entity_name,
@@ -42247,6 +44424,10 @@ module GTK
return autocomplete_filter_methods lookup_result.call if lookup_result
+ if dot[0].upcase == dot[0] && (Object.const_defined? dot.to_sym)
+ return (Object.const_get dot.to_sym).autocomplete_methods
+ end
+
start_collecting = false
dots_after_state = dots.find_all do |s|
if s == "state"
@@ -42262,10 +44443,16 @@ module GTK
target = target.as_hash[k.to_sym] if target.respond_to? :as_hash
end
- return autocomplete_filter_methods target.as_hash.keys
+ if target.respond_to? :as_hash
+ return autocomplete_filter_methods target.as_hash.keys
+ else
+ return autocomplete_filter_methods target.autocomplete_methods
+ end
end
+ text = text.each_line.reject { |l| l.strip.start_with? "#" }.join "\n"
+ text = text.each_line.map { |l| l.split("#").first }.join "\n"
text.gsub!("[", " ")
text.gsub!("]", " ")
text.gsub!("(", " ")
@@ -42281,153 +44468,155 @@ module GTK
end # end GTK
</code></pre>
-<h3 id='----runtime/draw.rb'>runtime/draw.rb</h3>
-<pre><code class="language-ruby"># ./dragon/runtime/draw.rb
+<h3 id='----runtime/benchmark-rb'>runtime/benchmark.rb</h3>
+<pre><code class="language-ruby"># ./dragon/runtime/benchmark.rb
# Copyright 2019 DragonRuby LLC
# MIT License
-# draw.rb has been released under MIT (*only this file*).
+# benchmark.rb has been released under MIT (*only this file*).
module GTK
class Runtime
- module Draw
- def primitives pass
- if $top_level.respond_to? :primitives_override
- return $top_level.tick_render @args, pass
- end
-
- # Don't change this draw order unless you understand
- # the implications.
-
- # pass.solids.each { |s| draw_solid s }
- # while loops are faster than each with block
+ module Benchmark
+ def benchmark_single iterations, name, proc
+ log <<-S
+** Invoking :#{name}...
+S
+ time_start = Time.now
idx = 0
- length = pass.solids.length
- while idx < pass.solids.length
- draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster
+ r = nil
+ while idx < iterations
+ r = proc.call
idx += 1
end
- # pass.static_solids.each { |s| draw_solid s }
- idx = 0
- length = pass.static_solids.length
- while idx < length
- draw_solid (pass.static_solids.at idx)
- idx += 1
- end
+ result = (Time.now - time_start).round 3
- # pass.sprites.each { |s| draw_sprite s }
- idx = 0
- length = pass.sprites.length
- while idx < length
- draw_sprite (pass.sprites.at idx)
- idx += 1
- end
+ { name: name,
+ time: result,
+ time_ms: (result * 1000).to_i }
+ end
- # pass.static_sprites.each { |s| draw_sprite s }
- idx = 0
- length = pass.static_sprites.length
- while idx < length
- draw_sprite (pass.static_sprites.at idx)
- idx += 1
- end
+ def benchmark opts = {}
+ iterations = opts.iterations
- # pass.primitives.each { |p| draw_primitive p }
- idx = 0
- length = pass.primitives.length
- while idx < length
- draw_primitive (pass.primitives.at idx)
- idx += 1
- end
+ log <<-S
+* BENCHMARK: Started
+** Caller: #{(caller || []).first}
+** Iterations: #{iterations}
+S
+ procs = opts.find_all { |k, v| v.respond_to? :call }
+
+ times = procs.map do |(name, proc)|
+ benchmark_single iterations, name, proc
+ end.sort_by { |r| r.time }
+
+ first_place = times.first
+ second_place = times.second || first_place
+
+ times = times.map do |candidate|
+ average_time = first_place.time
+ .add(candidate.time)
+ .abs
+ .fdiv(2)
+
+ difference_percentage = 0
+ if average_time == 0
+ difference_percentage = 0
+ else
+ difference_percentage = first_place.time
+ .subtract(candidate.time)
+ .abs
+ .fdiv(average_time)
+ .imult(100)
+ end
- # pass.static_primitives.each { |p| draw_primitive p }
- idx = 0
- length = pass.static_primitives.length
- while idx < length
- draw_primitive (pass.static_primitives.at idx)
- idx += 1
+ difference_time = ((first_place.time - candidate.time) * 1000).round
+ candidate.merge(difference_percentage: difference_percentage,
+ difference_time: difference_time)
end
- # pass.labels.each { |l| draw_label l }
- idx = 0
- length = pass.labels.length
- while idx < length
- draw_label (pass.labels.at idx)
- idx += 1
+ too_small_to_measure = false
+ if (first_place.time + second_place.time) == 0
+ too_small_to_measure = true
+ difference_percentage = 0
+ log <<-S
+* BENCHMARK: Average time for experiments were too small. Increase the number of iterations.
+S
+ else
+ difference_percentage = (((first_place.time - second_place.time).abs.fdiv((first_place.time + second_place.time).abs.fdiv(2))) * 100).round
end
- # pass.static_labels.each { |l| draw_label l }
- idx = 0
- length = pass.static_labels.length
- while idx < length
- draw_label (pass.static_labels.at idx)
- idx += 1
- end
+ difference_time = first_place.time.-(second_place.time).*(1000).abs.round
- # pass.lines.each { |l| draw_line l }
- idx = 0
- length = pass.lines.length
- while idx < length
- draw_line (pass.lines.at idx)
- idx += 1
- end
+ r = {
+ iterations: iterations,
+ first_place: first_place,
+ second_place: second_place,
+ difference_time: difference_time,
+ difference_percentage: difference_percentage,
+ times: times,
+ too_small_to_measure: too_small_to_measure
+ }
- # pass.static_lines.each { |l| draw_line l }
- idx = 0
- length = pass.static_lines.length
- while idx < pass.static_lines.length
- draw_line (pass.static_lines.at idx)
- idx += 1
- end
+ log_message = []
+ only_one_result = first_place.name == second_place.name
- # pass.borders.each { |b| draw_border b }
- idx = 0
- length = pass.borders.length
- while idx < length
- draw_border (pass.borders.at idx)
- idx += 1
+ if only_one_result
+ log <<-S
+* BENCHMARK: #{r.first_place.name} completed in #{r.first_place.time_ms}ms."
+S
+ else
+ log <<-S
+* BENCHMARK: #{r.message}
+** Fastest: #{r.first_place.name.inspect}
+** Second: #{r.second_place.name.inspect}
+** Margin: #{r.difference_percentage}% (#{r.difference_time.abs}ms) #{r.first_place.time_ms}ms vs #{r.second_place.time_ms}ms.
+** Times:
+#{r.times.map { |t| "*** #{t.name}: #{t.time_ms}ms (#{t.difference_percentage}% #{t.difference_time.abs}ms)." }.join("\n")}
+S
end
- # pass.static_borders.each { |b| draw_border b }
- idx = 0
- length = pass.static_borders.length
- while idx < length
- draw_border (pass.static_borders.at idx)
- idx += 1
- end
+ r
+ end
+ end
+ end
+end
- if !$gtk.production
- # pass.debug.each { |r| draw_primitive r }
- idx = 0
- length = pass.debug.length
- while idx < length
- draw_primitive (pass.debug.at idx)
- idx += 1
- end
+</code></pre>
+<h3 id='----runtime/draw-rb'>runtime/draw.rb</h3>
+<pre><code class="language-ruby"># ./dragon/runtime/draw.rb
+# Copyright 2019 DragonRuby LLC
+# MIT License
+# draw.rb has been released under MIT (*only this file*).
- # pass.static_debug.each { |r| draw_primitive r }
- idx = 0
- length = pass.static_debug.length
- while idx < length
- draw_primitive (pass.static_debug.at idx)
- idx += 1
- end
+module GTK
+ class Runtime
+ module Draw
+ def primitives pass
+ if $top_level.respond_to? :primitives_override
+ return $top_level.tick_render @args, pass
end
- # pass.reserved.each { |r| draw_primitive r }
- idx = 0
- length = pass.reserved.length
- while idx < length
- draw_primitive (pass.reserved.at idx)
- idx += 1
- end
+ fn.each_send pass.solids, self, :draw_solid
+ fn.each_send pass.static_solids, self, :draw_solid
+ fn.each_send pass.sprites, self, :draw_sprite
+ fn.each_send pass.static_sprites, self, :draw_sprite
+ fn.each_send pass.primitives, self, :draw_primitive
+ fn.each_send pass.static_primitives, self, :draw_primitive
+ fn.each_send pass.labels, self, :draw_label
+ fn.each_send pass.static_labels, self, :draw_label
+ fn.each_send pass.lines, self, :draw_line
+ fn.each_send pass.static_lines, self, :draw_line
+ fn.each_send pass.borders, self, :draw_border
+ fn.each_send pass.static_borders, self, :draw_border
- # pass.static_reserved.each { |r| draw_primitive r }
- idx = 0
- length = pass.static_reserved.length
- while idx < length
- draw_primitive (pass.static_reserved.at idx)
- idx += 1
+ if !$gtk.production
+ fn.each_send pass.debug, self, :draw_primitive
+ fn.each_send pass.static_debug, self, :draw_primitive
end
+
+ fn.each_send pass.reserved, self, :draw_primitive
+ fn.each_send pass.static_reserved, self, :draw_primitive
rescue Exception => e
pause!
pretty_print_exception_and_export! e
@@ -42438,7 +44627,9 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
- @ffi_draw.draw_solid s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a
+ @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)
end
rescue Exception => e
raise_conversion_for_rendering_failed s, e, :solid
@@ -42449,14 +44640,15 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
- @ffi_draw.draw_sprite_3 s.x, s.y, s.w, s.h,
- s.path.s_or_default,
+ @ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,
+ (s.path || '').to_s,
s.angle,
s.a, s.r, s.g, s.b,
s.tile_x, s.tile_y, s.tile_w, s.tile_h,
!!s.flip_horizontally, !!s.flip_vertically,
s.angle_anchor_x, s.angle_anchor_y,
- s.source_x, s.source_y, s.source_w, s.source_h
+ s.source_x, s.source_y, s.source_w, s.source_h,
+ (s.blendmode_enum || 1)
end
rescue Exception => e
raise_conversion_for_rendering_failed s, e, :sprite
@@ -42467,7 +44659,7 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
- @ffi_draw.draw_screenshot s.path.s_or_default,
+ @ffi_draw.draw_screenshot (s.path || '').to_s,
s.x, s.y, s.w, s.h,
s.angle,
s.a, s.r, s.g, s.b,
@@ -42485,10 +44677,13 @@ module GTK
if l.respond_to? :draw_override
l.draw_override @ffi_draw
else
- @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,
- l.size_enum, l.alignment_enum,
- l.r, l.g, l.b, l.a,
- l.font.s_or_default(nil)
+ @ffi_draw.draw_label_3 l.x, l.y,
+ (l.text || '').to_s,
+ l.size_enum, l.alignment_enum,
+ l.r, l.g, l.b, l.a,
+ l.font,
+ (l.vertical_alignment_enum || 2),
+ (l.blendmode_enum || 1)
end
rescue Exception => e
raise_conversion_for_rendering_failed l, e, :label
@@ -42499,7 +44694,21 @@ module GTK
if l.respond_to? :draw_override
l.draw_override @ffi_draw
else
- @ffi_draw.draw_line l.x, l.y, l.x2, l.y2, l.r, l.g, l.b, l.a
+ if l.x2
+ @ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,
+ l.r, l.g, l.b, l.a,
+ (l.blendmode_enum || 1)
+ else
+ w = l.w || 0
+ w = 1 if w == 0
+ h = l.h || 0
+ h = 1 if h == 0
+ @ffi_draw.draw_line_2 l.x, l.y,
+ l.x + w - 1,
+ l.y + h - 1,
+ l.r, l.g, l.b, l.a,
+ (l.blendmode_enum || 1)
+ end
end
rescue Exception => e
raise_conversion_for_rendering_failed l, e, :line
@@ -42510,7 +44719,9 @@ module GTK
if s.respond_to? :draw_override
s.draw_override @ffi_draw
else
- @ffi_draw.draw_border s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a
+ @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)
end
rescue Exception => e
raise_conversion_for_rendering_failed s, e, :border
@@ -42530,13 +44741,12 @@ module GTK
pause!
pretty_print_exception_and_export! e
end
-
end
end
end
</code></pre>
-<h3 id='----runtime/framerate.rb'>runtime/framerate.rb</h3>
+<h3 id='----runtime/framerate-rb'>runtime/framerate.rb</h3>
<pre><code class="language-ruby"># ./dragon/runtime/framerate.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -42623,7 +44833,7 @@ module GTK
end # end module GTK
</code></pre>
-<h3 id='----runtime/framerate_diagnostics.rb'>runtime/framerate_diagnostics.rb</h3>
+<h3 id='----runtime/framerate_diagnostics-rb'>runtime/framerate_diagnostics.rb</h3>
<pre><code class="language-ruby"># ./dragon/runtime/framerate_diagnostics.rb
# Copyright 2019 DragonRuby LLC
# MIT License
@@ -42742,7 +44952,7 @@ If this warning is getting annoying put the following in your tick method:
def framerate_diagnostics_primitives
[
- { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid,
+ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid!,
{
x: 5,
y: 5.from_top,
@@ -42751,7 +44961,7 @@ If this warning is getting annoying put the following in your tick method:
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 20.from_top,
@@ -42760,7 +44970,7 @@ If this warning is getting annoying put the following in your tick method:
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 35.from_top,
@@ -42769,7 +44979,7 @@ If this warning is getting annoying put the following in your tick method:
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 50.from_top,
@@ -42778,7 +44988,7 @@ If this warning is getting annoying put the following in your tick method:
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 65.from_top,
@@ -42787,7 +44997,7 @@ If this warning is getting annoying put the following in your tick method:
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
]
end
@@ -42796,7 +45006,7 @@ If this warning is getting annoying put the following in your tick method:
end
</code></pre>
-<h3 id='----runtime/hotload.rb'>runtime/hotload.rb</h3>
+<h3 id='----runtime/hotload-rb'>runtime/hotload.rb</h3>
<pre><code class="language-ruby"># ./dragon/runtime/hotload.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -42810,7 +45020,14 @@ module GTK
def hotload_init
@hotload_if_needed = 0
@mailbox_if_needed = 0
+
+ # schema for file_mtimes
+ # { FILE_PATH: { current: (Time as Fixnum),
+ # last: (Time as Fixnum) },
+ # FILE_PATH: { current: (Time as Fixnum),
+ # last: (Time as Fixnum) } }
@file_mtimes = { }
+
@suppress_mailbox = true
files_to_reload.each { |f| init_mtimes f }
init_mtimes 'app/mailbox.rb'
@@ -42848,6 +45065,7 @@ module GTK
'dragon/symbol.rb',
'dragon/numeric_deprecated.rb',
'dragon/numeric.rb',
+ 'dragon/hash_deprecated.rb',
'dragon/hash.rb',
'dragon/outputs_deprecated.rb',
'dragon/array_docs.rb',
@@ -42880,6 +45098,7 @@ module GTK
'dragon/trace.rb',
'dragon/readme_docs.rb',
'dragon/hotload_client.rb',
+ 'dragon/wizards.rb',
'dragon/ios_wizard.rb',
'dragon/itch_wizard.rb',
] + core_files_to_reload + @required_files
@@ -42898,10 +45117,8 @@ module GTK
end
def init_mtimes file
- current_key = "current_#{file}".to_sym
- last_key = "last_#{file}".to_sym
- @file_mtimes[current_key] ||= @ffi_file.mtime(file)
- @file_mtimes[last_key] ||= @ffi_file.mtime(file)
+ @file_mtimes[file] ||= { current: @ffi_file.mtime(file),
+ last: @ffi_file.mtime(file) }
end
def hotload_source_files
@@ -42933,32 +45150,43 @@ module GTK
end
def hotload_if_needed
+ return if Kernel.tick_count < 0
hotload_source_files
check_mailbox
end
def on_load_succeeded file
- @rcb_sender.files_reloaded << file
- @rcb_sender.reloaded_files << file
+ self.files_reloaded << file
+ self.reloaded_files << file
Trace.untrace_classes!
end
+ def reset_all_mtimes
+ @file_mtimes.each do |file, _|
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+ @file_mtimes[file].last = @file_mtimes[file].current
+ end
+
+ files_to_reload.each do |file, _|
+ @file_mtimes[file] ||= {}
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+ @file_mtimes[file].last = @file_mtimes[file].current
+ end
+ end
+
def reload_if_needed file, force = false
- current_key = "current_#{file}".to_sym
- last_key = "last_#{file}".to_sym
- @file_mtimes[current_key] ||= nil
- @file_mtimes[last_key] ||= nil
- @file_mtimes[current_key] = @ffi_file.mtime(file)
- return if !force && @file_mtimes[last_key] == @file_mtimes[current_key]
+ @file_mtimes[file] ||= { current: @ffi_file.mtime(file), last: @ffi_file.mtime(file) }
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+ return if !force && @file_mtimes[file].current == @file_mtimes[file].last
on_load_succeeded file if reload_ruby_file file
- @file_mtimes[last_key] = @file_mtimes[current_key]
+ @file_mtimes[file].last = @file_mtimes[file].current
end
end
end
end
</code></pre>
-<h3 id='----string.rb'>string.rb</h3>
+<h3 id='----string-rb'>string.rb</h3>
<pre><code class="language-ruby"># ./dragon/string.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -42991,6 +45219,30 @@ S
end
end
+ def char_byte
+ return nil if self.length == 0
+ c = self.each_char.first.bytes
+ c = c.first if c.is_a? Enumerable
+ c
+ end
+
+ def insert_character_at index, char
+ t = each_char.to_a
+ t = (t.insert index, char)
+ t.join
+ end
+
+ def excluding_character_at index
+ t = each_char.to_a
+ t.delete_at index
+ t.join
+ end
+
+ def excluding_last_character
+ return "" if self.length <= 1
+ return excluding_character_at(self.length - 1)
+ end
+
def end_with_bang?
self[-1] == "!"
end
@@ -43070,7 +45322,7 @@ S
end
</code></pre>
-<h3 id='----tests.rb'>tests.rb</h3>
+<h3 id='----tests-rb'>tests.rb</h3>
<pre><code class="language-ruby"># ./dragon/tests.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -43206,14 +45458,14 @@ S
log "#{self.failed.length} test(s) failed."
self.failed.each do |h|
log "**** Test name: :#{h[:m]}"
- log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"
+ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}\n#{h[:e].__backtrace_to_org__}"
end
end
end
end
</code></pre>
-<h3 id='----trace.rb'>trace.rb</h3>
+<h3 id='----trace-rb'>trace.rb</h3>
<pre><code class="language-ruby"># ./dragon/trace.rb
# coding: utf-8
# Copyright 2019 DragonRuby LLC
@@ -43401,12 +45653,46 @@ module GTK
end
</code></pre>
-<h3 id='----wizards.rb'>wizards.rb</h3>
+<h3 id='----wizards-rb'>wizards.rb</h3>
<pre><code class="language-ruby"># ./dragon/wizards.rb
# Copyright 2019 DragonRuby LLC
# MIT License
# wizards.rb has been released under MIT (*only this file*).
+class Wizard
+ def metadata_file_path
+ "metadata/game_metadata.txt"
+ end
+
+ def get_metadata
+ metadata = $gtk.read_file metadata_file_path
+
+ if !metadata
+ write_blank_metadata
+ metadata = $gtk.read_file metadata_file_path
+ end
+
+ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
+
+ {
+ dev_id: dev_id.strip.gsub("#", "").gsub("devid=", ""),
+ dev_title: dev_title.strip.gsub("#", "").gsub("devtitle=", ""),
+ game_id: game_id.strip.gsub("#", "").gsub("gameid=", ""),
+ game_title: game_title.strip.gsub("#", "").gsub("gametitle=", ""),
+ version: version.strip.gsub("#", "").gsub("version=", ""),
+ icon: icon.strip.gsub("#", "").gsub("icon=", "")
+ }
+ end
+end
+
+class WizardException < Exception
+ attr_accessor :console_primitives
+
+ def initialize *console_primitives
+ @console_primitives = console_primitives
+ end
+end
+
module GTK
class Wizards
attr_accessor :ios, :itch
diff --git a/docs/docs.txt b/docs/docs.txt
index 0b543de..c07fbcd 100644
--- a/docs/docs.txt
+++ b/docs/docs.txt
@@ -11,8 +11,6 @@ to get fancy you can provide a ~lambda~ to filter documentation:
docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }
#+end_src
-[[docs_search.gif]]
-
* Hello World
Welcome to DragonRuby Game Toolkit. Take the steps below to get started.
@@ -37,20 +35,25 @@ Reply with:
I am a Dragon Rider.
#+end_quote
-* Watch Some Intro Videos
+* Intro Videos
+
+Here are some videos to help you get the lay of the land.
-Each video is only 20 minutes and all of them will fit into a lunch
-break. So please watch them:
+** Quick Api Tour
1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]
-2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]
-3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]
-The second and third videos are not required if you are proficient
-with Ruby, but *definitely* watch the first one.
+** If You Are Completely New to Ruby and Programming
+
+1. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]
+2. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]
+3. You may also want to try this free course provided at [[http://dragonruby.school]].
-You may also want to try this free course provided at
-[[http://dragonruby.school]].
+** If You Have Game Dev Experience
+
+1. Building Tetris - Part 1: [[https://youtu.be/xZMwRSbC4rY]]
+2. Building Tetris - Part 2: [[https://youtu.be/C3LLzDUDgz4]]
+3. Low Res Game Jam Tutorial: [[https://youtu.be/pCI90ukKCME]]
* Getting Started Tutorial
@@ -392,7 +395,7 @@ Console type: ~$wizards.ios.start~ and you will be guided through the
deployment process.
To deploy to Android, you need to have an Android emulator/device, and
-a environment that is able to run Android SDK. ~dragonruby-publish~
+an environment that is able to run Android SDK. ~dragonruby-publish~
will create an APK for you. From there, you can sign the APK and
install it to your device. The signing and installation procedure
varies from OS to OS. Here's an example of what the command might look
@@ -411,7 +414,7 @@ The following tenants of DragonRuby are what set us apart from other
game engines. Given that Game Toolkit is a relatively new engine,
there are definitely features that are missing. So having a big check
list of "all the cool things" is not this engine's forte. This is
-compensated with a strong commitment to the following principals.
+compensated with a strong commitment to the following principles.
** Challenge The Status Quo
@@ -440,10 +443,10 @@ overwhelms beginners who are new to the engine or programming in general.
DragonRuby's philosophy is to provide multiple options across the "make it
fast" vs "make it right" spectrum, with incremental/intuitive
transitions between the options provided. A concrete example of this philosophy
-would be render primitives: the spectrum of options allows renderable constructs take
-the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with),
+would be render primitives: the spectrum of options allows renderable constructs that
+take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with),
hashes (a little more work, but gives you the ability to add additional properties),
-open and string entities (more work than hashes, but yields cleaner apis),
+open and strict entities (more work than hashes, but yields cleaner apis),
and finally - if you really need full power/flexibility in rendering - classes
(which take the most amount of code and programming knowledge to create).
@@ -570,7 +573,7 @@ The elevator pitch is:
DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels"
within the runtime allows us to target platforms no other Ruby can
target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo
-Switch, PS4, Xbox, and Scadia.
+Switch, PS4, Xbox, and Stadia.
**** What does Multilevel Cross-platform mean?
@@ -648,7 +651,7 @@ file called ~repl.rb~ and put it in ~mygame/app/repl.rb~:
- If you use the `repl` method, the code will be executed and the DragonRuby Console will automatically open so you can see the results (on Mac and Linux, the results will also be printed to the terminal).
-- All ~puts~ statements will also be saved to ~logs/log.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.
+- All ~puts~ statements will also be saved to ~logs/puts.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.
4. To ignore code in ~repl.rb~, instead of commenting it out, prefix ~repl~ with the letter ~x~ and it'll be ignored.
@@ -684,7 +687,7 @@ challenges in creating something that is compatible.
You can use DragonRuby's replay capabilities to troubleshoot:
1. DragonRuby is hot loaded which gives you a very fast feedback loop (if the game throws an exception, it's because of the code you just added).
-2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recoding by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.
+2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recording by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.
3. DragonRuby also ships with a unit testing facility. You can invoke the following command to run a test: ~./dragonruby . --eval some_ruby_file.rb --no-tick~.
4. Get into the habit of adding debugging facilities within the game itself. You can add drawing primitives to ~args.outputs.debug~ that will render on top of your game but will be ignored in a production release.
5. Debugging something that runs at 60fps is (imo) not that helpful. The exception you are seeing could have been because of a change that occurred many frames ago.
@@ -697,7 +700,7 @@ Let's check the official source for the answer to this question:
isrubydead.com: [[https://isrubydead.com/]].
On a more serious note, Ruby's _quantity_ levels aren't what they used
-to be. And that's totally fine. Every one chases the new and shiny.
+to be. And that's totally fine. Everyone chases the new and shiny.
What really matters is _quality/maturity_. Here is the latest (StackOverflow
Survey sorted by highest paid developers)[https://insights.stackoverflow.com/survey/2019#top-paying-technologies].
@@ -771,13 +774,11 @@ questions asked.
*** But still, you should offer a free version. So I can try it out and see if I like it.
-You can try our [web-based sandbox environment](). But it won't do the
-runtime justice. Or just come to our [Slack]() or [Discord]() channel
-and ask questions. We'd be happy to have a one on one video chat with
-you and show off all the cool stuff we're doing.
+You can try our web-based sandbox environment at [[http://fiddle.dragonruby.org]]. But it won't do the
+runtime justice. Or just come to our Discord Channel at [[http://discord.dragonruby.org]] and ask questions.
+We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.
-Seriously just buy it. Get a refund if you don't like it. We make it
-stupid easy to do so.
+Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so.
*** I still think you should do a free version. Think of all people who would give it a shot.
@@ -897,11 +898,15 @@ You can represent a sprite as a ~Hash~:
flip_vertically: false,
flip_horizontally: false,
angle_anchor_x: 0.5,
- angle_anchor_y: 1.0
+ angle_anchor_y: 1.0,
+ blendmode_enum: 1
}
end
#+end_src
+The ~blendmode_enum~ value can be set to ~0~ (no blending), ~1~ (alpha blending),
+~2~ (additive blending), ~3~ (modulo blending), ~4~ (multiply blending).
+
You can represent a sprite as an ~object~:
#+begin_src ruby
@@ -911,7 +916,7 @@ You can represent a sprite as an ~object~:
:source_x, :source_y, :source_w, :source_h,
:tile_x, :tile_y, :tile_w, :tile_h,
:flip_horizontally, :flip_vertically,
- :angle_anchor_x, :angle_anchor_y
+ :angle_anchor_x, :angle_anchor_y, :blendmode_enum
def primitive_marker
:sprite
@@ -997,16 +1002,17 @@ You can add additional metadata about your game within a label, which requires y
#+begin_src
def tick args
args.outputs.labels << {
- x: 200,
- y: 550,
- text: "dragonruby",
- size_enum: 2,
- alignment_enum: 1,
- r: 155,
- g: 50,
- b: 50,
- a: 255,
- font: "fonts/manaspc.ttf",
+ x: 200,
+ y: 550,
+ text: "dragonruby",
+ size_enum: 2,
+ alignment_enum: 1,
+ r: 155,
+ g: 50,
+ b: 50,
+ a: 255,
+ font: "fonts/manaspc.ttf",
+ vertical_alignment_enum: 0, # 0 is bottom, 1 is middle, 2 is top
# You can add any properties you like (this will be ignored/won't cause errors)
game_data_one: "Something",
game_data_two: {
@@ -1039,6 +1045,21 @@ You can get the render size of any string using ~args.gtk.calcstringbox~.
end
#+end_src
+** Rendering Labels With New Line Characters And Wrapping
+
+You can use a strategy like the following to create multiple labels from a String.
+
+#+begin_src ruby
+ def tick args
+ long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elitteger dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."
+ max_character_length = 30
+ long_strings_split = args.string.wrapped_lines long_string, max_character_length
+ args.outputs.labels << long_strings_split.map_with_index do |s, i|
+ { x: 10, y: 600 - (i * 20), text: s }
+ end
+ end
+#+end_src
+
** How To Play A Sound
Sounds that end ~.wav~ will play once:
@@ -1195,7 +1216,7 @@ Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keybo
*** ~.left_right~
Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.left~ and ~args.inputs.right~.
*** ~.up_down~
-Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.up~ and ~args.inputs.down~.
+Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.down~ and ~args.inputs.up~.
*** ~.text~ OR ~.history~
Returns a string that represents the last key that was pressed on the keyboard.
*** ~.mouse~
@@ -1229,17 +1250,17 @@ The properties ~args.inputs.mouse.(click|down|previous_click|up)~ each return ~n
that has an ~x~, ~y~ properties along with helper functions to determine collision: ~inside_rect?~, ~inside_circle~.
*** ~.controller_one~, ~.controller_two~
Represents controllers connected to the usb ports.
-**** ~.up
+**** ~.up~
Returns ~true~ if ~up~ is pressed or held on the directional or left analog.
-**** ~.down
+**** ~.down~
Returns ~true~ if ~down~ is pressed or held on the directional or left analog.
-**** ~.left
+**** ~.left~
Returns ~true~ if ~left~ is pressed or held on the directional or left analog.
-**** ~.right
+**** ~.right~
Returns ~true~ if ~right~ is pressed or held on the directional or left analog.
-**** ~.left_right
+**** ~.left_right~
Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.controller_(one|two).left~ and ~args.inputs.controller_(one|two).right~.
-**** ~.up_down
+**** ~.up_down~
Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.controller_(one|two).up~ and ~args.inputs.controller_(one|two).down~.
**** ~.(left_analog_x_raw|right_analog_x_raw)~
Returns the raw integer value for the analog's horizontal movement (~-32,000 to +32,000~).
@@ -1249,13 +1270,13 @@ Returns the raw integer value for the analog's vertical movement (~-32,000 to +3
Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved horizontally as a ratio of the maximum horizontal movement.
**** ~.left_analog_y_perc|right_analog_y_perc)~
Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved vertically as a ratio of the maximum vertical movement.
-**** ~.directional_up)~
+**** ~.directional_up~
Returns ~true~ if ~up~ is pressed or held on the directional.
-**** ~.directional_down)~
+**** ~.directional_down~
Returns ~true~ if ~down~ is pressed or held on the directional.
-**** ~.directional_left)~
+**** ~.directional_left~
Returns ~true~ if ~left~ is pressed or held on the directional.
-**** ~.directional_right)~
+**** ~.directional_right~
Returns ~true~ if ~right~ is pressed or held on the directional.
**** ~.(a|b|x|y|l1|r1|l2|r2|l3|r3|start|select)~
Returns ~true~ if the specific button is pressed or held.
@@ -1411,6 +1432,14 @@ Send a Primitive to this collection to render an unfilled rectangle to the scree
Send any Primitive to this collection which represents things you render to the screen for debugging purposes. Primitives in this collection will not be rendered in a production release of your game.
** ~args.geometry~
This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.
+
+Here are some general notes with regards to the arguments these geometric functions accept.
+
+1. ~Rectangles~ can be represented as an ~Array~ with four (or more) values ~[x, y, w, h]~, as a ~Hash~ ~{ x:, y:, w:, h: }~ or an object that responds to ~x~, ~y~, ~w~, and ~h~.
+2. ~Points~ can be represent as an ~Array~ with two (or more) values ~[x, y]~, as a ~Hash~ ~{ x:, y:}~ or an object that responds to ~x~, and ~y~.
+3. ~Lines~ can be represented as an ~Array~ with four (or more) values ~[x, y, x2, y2]~, as a ~Hash~ ~{ x:, y:, x2:, y2: }~ or an object that responds to ~x~, ~y~, ~x2~, and ~y2~.
+4. ~Angles~ are represented as degrees (not radians).
+
*** ~.inside_rect? rect_1, rect_2~
Returns ~true~ if ~rect_1~ is inside ~rect_2~.
*** ~.intersect_rect? rect_2, rect_2~
@@ -1975,7 +2004,7 @@ wide and 90 pixels tall.
** Rendering a solid using an Array with colors and alpha
-The value for the color and alpha is an number between ~0~ and ~255~. The
+The value for the color and alpha is a number between ~0~ and ~255~. The
alpha property is optional and will be set to ~255~ if not specified.
Creates a green solid rectangle with an opacity of 50%.
@@ -2011,7 +2040,7 @@ be provided in any order.
** Rendering a solid using a Class
You can also create a class with solid/border properties and render it as a primitive.
-ALL properties must on the class. *Additionally*, a method called ~primitive_marker~
+ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~
must be defined on the class.
Here is an example:
@@ -2070,6 +2099,106 @@ You have to use ~args.outputs.borders~:
#+end_src
+* DOCS: ~GTK::Outputs#sprites~
+
+Add primitives to this collection to render a sprite to the screen.
+
+** Rendering a sprite using an Array
+
+Creates a sprite of a white circle located at 100, 100. 160 pixels
+wide and 90 pixels tall.
+
+#+begin_src
+ def tick args
+ # X Y WIDTH HEIGHT PATH
+ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png]
+ end
+#+end_src
+
+** Rendering a sprite using an Array with colors and alpha
+
+The value for the color and alpha is a number between ~0~ and ~255~. The
+alpha property is optional and will be set to ~255~ if not specified.
+
+Creates a green circle sprite with an opacity of 50%.
+
+#+begin_src
+ def tick args
+ # X Y WIDTH HEIGHT PATH ANGLE ALPHA RED GREEN BLUE
+ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png", 0, 128, 0, 255, 0]
+ end
+#+end_src
+
+** Rendering a sprite using a Hash
+
+If you want a more readable invocation. You can use the following hash to create a sprite.
+Any parameters that are not specified will be given a default value. The keys of the hash can
+be provided in any order.
+
+#+begin_src
+ def tick args
+ args.outputs.sprites << {
+ x: 0,
+ y: 0,
+ w: 100,
+ h: 100,
+ path: "sprites/circle/white.png",
+ angle: 0,
+ a: 255,
+ r: 0,
+ g: 255,
+ b: 0
+ }
+ end
+#+end_src
+
+** Rendering a solid using a Class
+
+You can also create a class with solid/border properties and render it as a primitive.
+ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~
+must be defined on the class.
+
+Here is an example:
+
+#+begin_src
+ # Create type with ALL sprite properties AND primitive_marker
+ class Sprite
+ attr_accessor :x, :y, :w, :h, :path, :angle, :angle_anchor_x, :angle_anchor_y, :tile_x, :tile_y, :tile_w, :tile_h, :source_x, :source_y, :source_w, :source_h, :flip_horizontally, :flip_vertically, :a, :r, :g, :b
+
+ def primitive_marker
+ :sprite
+ end
+ end
+
+ # Inherit from type
+ class Circle < Sprite
+ # constructor
+ def initialize x, y, size, path
+ self.x = x
+ self.y = y
+ self.w = size
+ self.h = size
+ self.path = path
+ end
+ def serlialize
+ {x:self.x, y:self.y, w:self.w, h:self.h, path:self.path}
+ end
+
+ def inspect
+ serlialize.to_s
+ end
+
+ def to_s
+ serlialize.to_s
+ end
+ end
+ def tick args
+ # render circle sprite
+ args.outputs.sprites << Circle.new(10, 10, 32,"sprites/circle/white.png")
+ end
+#+end_src
+
+
* DOCS: ~GTK::Outputs#screenshots~
Add a hash to this collection to take a screenshot and save as png file.
@@ -2133,12 +2262,12 @@ The ~GTK::MousePoint~ has the following properties.
- ~x~: Integer representing the mouse's x.
- ~y~: Integer representing the mouse's y.
- ~point~: Array with the ~x~ and ~y~ values.
-- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
+- ~w~: Width of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+- ~h~: Height of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+- ~left~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+- ~right~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+- ~top~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+- ~bottom~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
- ~created_at~: The tick (~args.state.tick_count~) that this structure was created.
- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.
@@ -3580,7 +3709,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 0,
b: 200,
a: 255,
- font: "manaspc.ttf" }.label
+ font: "manaspc.ttf" }.label!
# Primitives can hold anything, and can be given a label in the following forms
args.outputs.primitives << [690 + 150, 330 - 80, "Custom font (.primitives Array)", 0, 1, 125, 0, 200, 255, "manaspc.ttf" ].label
@@ -3594,7 +3723,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 0,
b: 200,
a: 255,
- font: "manaspc.ttf" }.label
+ font: "manaspc.ttf" }.label!
end
def tick_instructions args, text, y = 715
@@ -3831,771 +3960,6 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
-*** Rendering Basics - Audio Mixer - main.rb
-#+begin_src ruby
- # ./samples/01_rendering_basics/06_audio_mixer/app/main.rb
- $gtk.reset
-
- $boxsize = 30
-
- def render_sources args
- mouse_in_panel = (args.state.selected != 0) && args.inputs.mouse.position.inside_rect?([900, 450, 340, 250])
- mouse_new_down = (args.state.mouse_held == 1)
-
- if (mouse_new_down && !mouse_in_panel)
- args.state.selected = 0 # will reset below if we hit something.
- end
-
- args.audio.keys.each { |k|
- s = args.audio[k]
-
- if (mouse_new_down) && !mouse_in_panel && args.inputs.mouse.position.inside_rect?([s[:screenx], s[:screeny], $boxsize, $boxsize])
- args.state.selected = k
- args.state.dragging_source = true
- end
-
- isselected = (k == args.state.selected)
-
- if isselected && args.state.dragging_source
- # you can hang anything on the audio hashes you want, so we store the
- # actual screen position so it doesn't scale weirdly vs your mouse.
- s[:screenx] = args.inputs.mouse.x - ($boxsize / 2)
- s[:screeny] = args.inputs.mouse.y - ($boxsize / 2)
-
- s[:screeny] = 50 if s[:screeny] < 50
- s[:screeny] = (719 - $boxsize) if s[:screeny] > (719 - $boxsize)
- s[:screenx] = 0 if s[:screenx] < 0
- s[:screenx] = (1279 - $boxsize) if s[:screenx] > (1279 - $boxsize)
-
- s[:x] = ((s[:screenx] / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
- s[:y] = ((s[:screeny] / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
- end
-
- color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]
- args.outputs.primitives << [s[:screenx], s[:screeny], $boxsize, $boxsize, *color].solid
- }
- end
-
- def render_panel args
- s = args.audio[args.state.selected]
- return if s.nil?
- mouse_down = (args.state.mouse_held > 0)
-
- args.outputs.primitives << [900, 450, 340, 250, 127, 127, 200, 255].solid
- args.outputs.primitives << [1075, 690, "Source ##{args.state.selected}", 3, 1, 255, 255, 255].label
- args.outputs.primitives << [910, 660, 1230, 660, 255, 255, 255].line
- args.outputs.primitives << [910, 650, "screen: (#{s[:screenx].to_i}, #{s[:screeny].to_i})", 0, 0, 255, 255, 255].label
- args.outputs.primitives << [910, 625, "position: (#{s[:x].round(5).to_s[0..6]}, #{s[:y].round(5).to_s[0..6]})", 0, 0, 255, 255, 255].label
-
- slider = [1022, 586, 200, 7]
- if mouse_down && args.inputs.mouse.position.inside_rect?(slider)
- s[:pitch] = ((args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)) * 2.0
- end
- slidercolor = (s[:pitch] / 2.0) * 255
- args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid
- args.outputs.primitives << [910, 600, "pitch: #{s[:pitch].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label
-
- slider = [1022, 561, 200, 7]
- if mouse_down && args.inputs.mouse.position.inside_rect?(slider)
- s[:gain] = (args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)
- end
- slidercolor = s[:gain] * 255
- args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid
- args.outputs.primitives << [910, 575, "gain: #{s[:gain].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label
-
- checkbox = [1022, 533, 10, 12]
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)
- s[:looping] = !s[:looping]
- end
- checkboxcolor = s[:looping] ? 255 : 0
- args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid
- args.outputs.primitives << [910, 550, "looping:", 0, 0, 255, 255, 255].label
-
- checkbox = [1022, 508, 10, 12]
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)
- s[:paused] = !s[:paused]
- end
- checkboxcolor = s[:paused] ? 255 : 0
- args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid
- args.outputs.primitives << [910, 525, "paused:", 0, 0, 255, 255, 255].label
-
- button = [910, 460, 320, 20]
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(button)
- args.audio.delete(args.state.selected)
- args.state.selected = 0
- end
- args.outputs.primitives << [*button, 255, 0, 0, 255].solid
- args.outputs.primitives << [button[0] + (button[2] / 2), button[1]+20, "DELETE SOURCE", 0, 1, 255, 255, 0].label
- end
-
- def spawn_new_sound args, num
- input = nil
- input = "sounds/#{num}.#{(num == 6) ? 'ogg' : 'wav'}"
-
- # Spawn randomly in an area that won't be covered by UI.
- screenx = (rand * 600.0) + 200.0
- screeny = (rand * 400.0) + 100.0
-
- args.state.next_sound_index += 1
-
- # you can hang anything on the audio hashes you want, so we store the
- # actual screen position in here for convenience.
- args.audio[args.state.next_sound_index] = {
- input: input,
- screenx: screenx,
- screeny: screeny,
- x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
- y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
- z: 0.0,
- gain: 1.0,
- pitch: 1.0,
- looping: true,
- paused: false
- }
-
- args.state.selected = args.state.next_sound_index
- end
-
- def render_launcher args
- total = 6
- x = (1280 - (total * $boxsize * 3)) / 2
- y = 10
- args.outputs.primitives << [0, 0, 1280, ((y*2) + $boxsize), 127, 127, 127, 255].solid
- for i in 1..total
- args.outputs.primitives << [x, y, $boxsize, $boxsize, 255, 255, 255, 255].solid
- args.outputs.primitives << [x+8, y+28, i.to_s, 3, 0, 0, 0, 255, 255].label
- if args.inputs.mouse.click && args.inputs.mouse.click.point.inside_rect?([x, y, $boxsize, $boxsize])
- spawn_new_sound args, i
- end
- x = x + ($boxsize * 3)
- end
- end
-
- def render_ui args
- render_launcher args
- render_panel args
- end
-
- def tick args
- args.state.mouse_held ||= 0
- args.state.dragging_source ||= false
- args.state.selected ||= 0
- args.state.next_sound_index ||= 0
-
- if args.inputs.mouse.up
- args.state.mouse_held = 0
- args.state.dragging_source = false
- elsif args.inputs.mouse.down || (args.state.mouse_held > 0)
- args.state.mouse_held += 1
- else
- end
-
- args.outputs.background_color = [ 0, 0, 0, 255 ]
- render_sources args
- render_ui args
- end
-
-#+end_src
-
-*** Rendering Basics - Sound Synthesis - main.rb
-#+begin_src ruby
- # ./samples/01_rendering_basics/07_sound_synthesis/app/main.rb
- begin # region: top level tick methods
- def tick args
- defaults args
- render args
- input args
- process_audio_queue args
- end
-
- def defaults args
- args.state.sine_waves ||= {}
- args.state.square_waves ||= {}
- args.state.saw_tooth_waves ||= {}
- args.state.triangle_waves ||= {}
- args.state.audio_queue ||= []
- args.state.buttons ||= [
- (frequency_buttons args),
- (sine_wave_note_buttons args),
- (bell_buttons args),
- (square_wave_note_buttons args),
- (saw_tooth_wave_note_buttons args),
- (triangle_wave_note_buttons args),
- ].flatten
- end
-
- def render args
- args.outputs.borders << args.state.buttons.map { |b| b[:border] }
- args.outputs.labels << args.state.buttons.map { |b| b[:label] }
- args.outputs.labels << args.layout
- .rect(row: 0, col: 11.5)
- .yield_self { |r| r.merge y: r.y + r.h }
- .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",
- alignment_enum: 1)
- end
-
-
- def input args
- args.state.buttons.each do |b|
- if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])
- parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "
- args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"
- send b[:method_to_call], args, b
- end
- end
-
- if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))
- args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'
- end
- end
-
- def process_audio_queue args
- to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }
- args.state.audio_queue -= to_queue
- to_queue.each { |a| args.audio[a[:id]] = a }
-
- args.audio.find_all { |k, v| v[:decay_rate] }
- .each { |k, v| v[:gain] -= v[:decay_rate] }
-
- sounds_to_stop = args.audio
- .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }
- .map { |k, v| k }
-
- sounds_to_stop.each { |k| args.audio.delete k }
- end
- end
-
- begin # region: button definitions, ui layout, callback functions
- def button args, opts
- button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
-
- button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
-
- label_offset_x = 5
- label_offset_y = 30
-
- button_def[:label] = button_def[:rect].merge text: opts[:text],
- size_enum: -2.5,
- x: button_def[:rect].x + label_offset_x,
- y: button_def[:rect].y + label_offset_y
-
- button_def
- end
-
- def play_sine_wave args, sender
- queue_sine_wave args,
- frequency: sender[:frequency],
- duration: 1.seconds,
- fade_out: true
- end
-
- def play_note args, sender
- method_to_call = :queue_sine_wave
- method_to_call = :queue_square_wave if sender[:type] == :square
- method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth
- method_to_call = :queue_triangle_wave if sender[:type] == :triangle
- method_to_call = :queue_bell if sender[:type] == :bell
-
- send method_to_call, args,
- frequency: (frequency_for note: sender[:note], octave: sender[:octave]),
- duration: 1.seconds,
- fade_out: true
- end
-
- def frequency_buttons args
- [
- (button args,
- row: 4.0, col: 0, text: "300hz",
- frequency: 300,
- method_to_call: :play_sine_wave),
- (button args,
- row: 5.0, col: 0, text: "400hz",
- frequency: 400,
- method_to_call: :play_sine_wave),
- (button args,
- row: 6.0, col: 0, text: "500hz",
- frequency: 500,
- method_to_call: :play_sine_wave),
- ]
- end
-
- def sine_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 2, text: "Sine C4",
- note: :c, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 2, text: "Sine D4",
- note: :d, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 2, text: "Sine E4",
- note: :e, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 2, text: "Sine F4",
- note: :f, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 2, text: "Sine G4",
- note: :g, octave: 4, type: :sine, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 2, text: "Sine A5",
- note: :a, octave: 5, type: :sine, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 2, text: "Sine B5",
- note: :b, octave: 5, type: :sine, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 2, text: "Sine C5",
- note: :c, octave: 5, type: :sine, method_to_call: :play_note),
- ]
- end
-
- def square_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 6, text: "Square C4",
- note: :c, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 6, text: "Square D4",
- note: :d, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 6, text: "Square E4",
- note: :e, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 6, text: "Square F4",
- note: :f, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 6, text: "Square G4",
- note: :g, octave: 4, type: :square, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 6, text: "Square A5",
- note: :a, octave: 5, type: :square, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 6, text: "Square B5",
- note: :b, octave: 5, type: :square, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 6, text: "Square C5",
- note: :c, octave: 5, type: :square, method_to_call: :play_note),
- ]
- end
- def saw_tooth_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 8, text: "Saw C4",
- note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 8, text: "Saw D4",
- note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 8, text: "Saw E4",
- note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 8, text: "Saw F4",
- note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 8, text: "Saw G4",
- note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 8, text: "Saw A5",
- note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 8, text: "Saw B5",
- note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 8, text: "Saw C5",
- note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),
- ]
- end
-
- def triangle_wave_note_buttons args
- [
- (button args,
- row: 1.5, col: 10, text: "Triangle C4",
- note: :c, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 10, text: "Triangle D4",
- note: :d, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 10, text: "Triangle E4",
- note: :e, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 10, text: "Triangle F4",
- note: :f, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 10, text: "Triangle G4",
- note: :g, octave: 4, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 10, text: "Triangle A5",
- note: :a, octave: 5, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 10, text: "Triangle B5",
- note: :b, octave: 5, type: :triangle, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 10, text: "Triangle C5",
- note: :c, octave: 5, type: :triangle, method_to_call: :play_note),
- ]
- end
-
- def bell_buttons args
- [
- (button args,
- row: 1.5, col: 4, text: "Bell C4",
- note: :c, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 2.5, col: 4, text: "Bell D4",
- note: :d, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 3.5, col: 4, text: "Bell E4",
- note: :e, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 4.5, col: 4, text: "Bell F4",
- note: :f, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 5.5, col: 4, text: "Bell G4",
- note: :g, octave: 4, type: :bell, method_to_call: :play_note),
- (button args,
- row: 6.5, col: 4, text: "Bell A5",
- note: :a, octave: 5, type: :bell, method_to_call: :play_note),
- (button args,
- row: 7.5, col: 4, text: "Bell B5",
- note: :b, octave: 5, type: :bell, method_to_call: :play_note),
- (button args,
- row: 8.5, col: 4, text: "Bell C5",
- note: :c, octave: 5, type: :bell, method_to_call: :play_note),
- ]
- end
- end
-
- begin # region: wave generation
- begin # sine wave
- def defaults_sine_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def sine_wave_for opts = {}
- opts = defaults_sine_wave_for.merge opts
- frequency = opts[:frequency]
- sample_rate = opts[:sample_rate]
- period_size = (sample_rate.fdiv frequency).ceil
- period_size.map_with_index do |i|
- Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)
- end.to_a
- end
-
- def defaults_queue_sine_wave
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
- end
-
- def queue_sine_wave args, opts = {}
- opts = defaults_queue_sine_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.sine_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: sine_wave
- end
- end
-
- begin # region: square wave
- def defaults_square_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def square_wave_for opts = {}
- opts = defaults_square_wave_for.merge opts
- sine_wave = sine_wave_for opts
- sine_wave.map do |v|
- if v >= 0
- 1.0
- else
- -1.0
- end
- end.to_a
- end
-
- def defaults_queue_square_wave
- { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
- end
-
- def queue_square_wave args, opts = {}
- opts = defaults_queue_square_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.square_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: square_wave
- end
- end
-
- begin # region: saw tooth wave
- def defaults_saw_tooth_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def saw_tooth_wave_for opts = {}
- opts = defaults_saw_tooth_wave_for.merge opts
- sine_wave = sine_wave_for opts
- period_size = sine_wave.length
- sine_wave.map_with_index do |v, i|
- (((i % period_size).fdiv period_size) * 2) - 1
- end
- end
-
- def defaults_queue_saw_tooth_wave
- { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
- end
-
- def queue_saw_tooth_wave args, opts = {}
- opts = defaults_queue_saw_tooth_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: saw_tooth_wave
- end
- end
-
- begin # region: triangle wave
- def defaults_triangle_wave_for
- { frequency: 440, sample_rate: 48000 }
- end
-
- def triangle_wave_for opts = {}
- opts = defaults_saw_tooth_wave_for.merge opts
- sine_wave = sine_wave_for opts
- period_size = sine_wave.length
- sine_wave.map_with_index do |v, i|
- ratio = (i.fdiv period_size)
- if ratio <= 0.5
- (ratio * 4) - 1
- else
- ratio -= 0.5
- 1 - (ratio * 4)
- end
- end
- end
-
- def defaults_queue_triangle_wave
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
- end
-
- def queue_triangle_wave args, opts = {}
- opts = defaults_queue_triangle_wave.merge opts
- frequency = opts[:frequency]
- sample_rate = 48000
-
- triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate
- args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate
-
- proc = lambda do
- generate_audio_data args.state.triangle_waves[frequency], sample_rate
- end
-
- audio_state = new_audio_state args, opts
- audio_state[:input] = [1, sample_rate, proc]
- queue_audio args, audio_state: audio_state, wave: triangle_wave
- end
- end
-
- begin # region: bell
- def defaults_queue_bell
- { frequency: 440, duration: 1.seconds, queue_in: 0 }
- end
-
- def queue_bell args, opts = {}
- (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }
- end
-
- def bell_harmonics
- [
- { frequency_ratio: 0.5, duration_ratio: 1.00 },
- { frequency_ratio: 1.0, duration_ratio: 0.80 },
- { frequency_ratio: 2.0, duration_ratio: 0.60 },
- { frequency_ratio: 3.0, duration_ratio: 0.40 },
- { frequency_ratio: 4.2, duration_ratio: 0.25 },
- { frequency_ratio: 5.4, duration_ratio: 0.20 },
- { frequency_ratio: 6.8, duration_ratio: 0.15 }
- ]
- end
-
- def defaults_bell_to_sine_waves
- { frequency: 440, duration: 1.seconds, queue_in: 0 }
- end
-
- def bell_to_sine_waves opts = {}
- opts = defaults_bell_to_sine_waves.merge opts
- bell_harmonics.map do |b|
- {
- frequency: opts[:frequency] * b[:frequency_ratio],
- duration: opts[:duration] * b[:duration_ratio],
- queue_in: opts[:queue_in],
- gain: (1.fdiv bell_harmonics.length),
- fade_out: true
- }
- end
- end
- end
-
- begin # audio entity construction
- def generate_audio_data sine_wave, sample_rate
- sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil
- copy_count = (sample_size.fdiv sine_wave.length).ceil
- sine_wave * copy_count
- end
-
- def defaults_new_audio_state
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
- end
-
- def new_audio_state args, opts = {}
- opts = defaults_new_audio_state.merge opts
- decay_rate = 0
- decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]
- frequency = opts[:frequency]
- sample_rate = 48000
-
- {
- id: (new_id! args),
- frequency: frequency,
- sample_rate: 48000,
- stop_at: args.tick_count + opts[:queue_in] + opts[:duration],
- gain: opts[:gain].to_f,
- queue_at: args.state.tick_count + opts[:queue_in],
- decay_rate: decay_rate,
- pitch: 1.0,
- looping: true,
- paused: false
- }
- end
-
- def queue_audio args, opts = {}
- graph_wave args, opts[:wave], opts[:audio_state][:frequency]
- args.state.audio_queue << opts[:audio_state]
- end
-
- def new_id! args
- args.state.audio_id ||= 0
- args.state.audio_id += 1
- end
-
- def graph_wave args, wave, frequency
- if args.state.tick_count != args.state.graphed_at
- args.outputs.static_lines.clear
- args.outputs.static_sprites.clear
- end
-
- wave = wave
-
- r, g, b = frequency.to_i % 85,
- frequency.to_i % 170,
- frequency.to_i % 255
-
- starting_rect = args.layout.rect(row: 5, col: 13)
- x_scale = 10
- y_scale = 100
- max_points = 25
-
- points = wave
- if wave.length > max_points
- resolution = wave.length.idiv max_points
- points = wave.find_all.with_index { |y, i| (i % resolution == 0) }
- end
-
- args.outputs.static_lines << points.map_with_index do |y, x|
- next_y = points[x + 1]
-
- if next_y
- {
- x: starting_rect.x + (x * x_scale),
- y: starting_rect.y + starting_rect.h.half + y_scale * y,
- x2: starting_rect.x + ((x + 1) * x_scale),
- y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,
- r: r,
- g: g,
- b: b
- }
- end
- end
-
- args.outputs.static_sprites << points.map_with_index do |y, x|
- {
- x: (starting_rect.x + (x * x_scale)) - 2,
- y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,
- w: 4,
- h: 4,
- path: 'sprites/square-white.png',
- r: r,
- g: g,
- b: b
- }
- end
-
- args.state.graphed_at = args.state.tick_count
- end
- end
-
- begin # region: musical note mapping
- def defaults_frequency_for
- { note: :a, octave: 5, sharp: false, flat: false }
- end
-
- def frequency_for opts = {}
- opts = defaults_frequency_for.merge opts
- octave_offset_multiplier = opts[:octave] - 5
- note = note_frequencies_octave_5[opts[:note]]
- if octave_offset_multiplier < 0
- note = note * 1 / (octave_offset_multiplier.abs + 1)
- elsif octave_offset_multiplier > 0
- note = note * (octave_offset_multiplier.abs + 1) / 1
- end
- note
- end
-
- def note_frequencies_octave_5
- {
- a: 440.0,
- a_sharp: 466.16, b_flat: 466.16,
- b: 493.88,
- c: 523.25,
- c_sharp: 554.37, d_flat: 587.33,
- d: 587.33,
- d_sharp: 622.25, e_flat: 659.25,
- e: 659.25,
- f: 698.25,
- f_sharp: 739.99, g_flat: 739.99,
- g: 783.99,
- g_sharp: 830.61, a_flat: 830.61
- }
- end
- end
- end
-
- $gtk.reset
-
-#+end_src
-
*** Input Basics - Keyboard - main.rb
#+begin_src ruby
# ./samples/02_input_basics/01_keyboard/app/main.rb
@@ -4626,9 +3990,9 @@ Follows is a source code listing for all files that have been open sourced. This
def tick args
tick_instructions args, "Sample app shows how keyboard events are registered and accessed.", 360
# Notice how small_font accounts for all the remaining parameters
- args.outputs.labels << [460, row_to_px(args, 0), "Current game time: #{args.state.tick_count}", small_font]
- args.outputs.labels << [460, row_to_px(args, 2), "Keyboard input: args.inputs.keyboard.key_up.h", small_font]
- args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 0), text: "Current game time: #{args.state.tick_count}", size_enum: -1 }
+ args.outputs.labels << { x: 460, y: row_to_px(args, 2), text: "Keyboard input: args.inputs.keyboard.key_up.h", size_enum: -1 }
+ args.outputs.labels << { x: 460, y: row_to_px(args, 3), text: "Press \"h\" on the keyboard.", size_enum: -1 }
# Input on a specifc key can be found through args.inputs.keyboard.key_up followed by the key
if args.inputs.keyboard.key_up.h
@@ -4639,27 +4003,19 @@ Follows is a source code listing for all files that have been open sourced. This
args.state.h_pressed_at ||= false
if args.state.h_pressed_at
- args.outputs.labels << [460, row_to_px(args, 4), "\"h\" was pressed at time: #{args.state.h_pressed_at}", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" was pressed at time: #{args.state.h_pressed_at}", size_enum: -1 }
else
- args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" has never been pressed.", size_enum: -1 }
end
tick_help_text args
end
- def small_font
- # This method provides some values for the construction of labels
- # Specifically, Size, Alignment, & RGBA
- # This makes it so that custom parameters don't have to be repeatedly typed.
- # Additionally "small_font" provides programmers with more information than some numbers
- [-2, 0, 0, 0, 0, 255]
- end
-
- def row_to_px args, row_number
+ def row_to_px args, row_number, y_offset = 20
# This takes a row_number and converts it to pixels DragonRuby understands.
# Row 0 starts 5 units below the top of the grid
# Each row afterward is 20 units lower
- args.grid.top.shift_down(5).shift_down(20 * row_number)
+ args.grid.top - 5 - (y_offset * row_number)
end
# Don't worry about understanding the code within this method just yet.
@@ -4689,17 +4045,17 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
- args.outputs.labels << [10, row_to_px(args, 6), "Advanced Help:", small_font]
+ args.outputs.labels << { x: 10, y: row_to_px(args, 6), text: "This is the api for the keys you've pressed:", size_enum: -1, r: 180 }
if !args.state.help_available
args.outputs.labels << [10, row_to_px(args, 7), "Press a key and I'll show code to access the key and what value will be returned if you used the code.", small_font]
return
end
- args.outputs.labels << [10 , row_to_px(args, 7), "args.inputs.keyboard", small_font]
- args.outputs.labels << [330, row_to_px(args, 7), "args.inputs.keyboard.key_down", small_font]
- args.outputs.labels << [650, row_to_px(args, 7), "args.inputs.keyboard.key_held", small_font]
- args.outputs.labels << [990, row_to_px(args, 7), "args.inputs.keyboard.key_up", small_font]
+ args.outputs.labels << { x: 10 , y: row_to_px(args, 7), text: "args.inputs.keyboard", size_enum: -2 }
+ args.outputs.labels << { x: 330, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_down", size_enum: -2 }
+ args.outputs.labels << { x: 650, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_held", size_enum: -2 }
+ args.outputs.labels << { x: 990, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_up", size_enum: -2 }
fill_history args, :key_value_history, :down_or_held, nil
fill_history args, :key_down_value_history, :down, :key_down
@@ -4745,12 +4101,8 @@ Follows is a source code listing for all files that have been open sourced. This
end
idx += 2
[
- [x, row_to_px(args, idx - 2),
- " .#{k} is #{current_value || "nil"}",
- small_font],
- [x, row_to_px(args, idx - 1),
- " was #{v}",
- small_font]
+ { x: x, y: row_to_px(args, idx + 0, 16), text: " .#{k} is #{current_value || "nil"}", size_enum: -2 },
+ { x: x, y: row_to_px(args, idx + 1, 16), text: " was #{v}", size_enum: -2 }
]
end
end
@@ -4765,10 +4117,48 @@ Follows is a source code listing for all files that have been open sourced. This
args.state.key_event_occurred = true
end
- args.outputs.debug << [0, y - 50, 1280, 60].solid
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+ args.outputs.debug << { x: 640, y: y, text: text,
+ size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)",
+ size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ end
+
+#+end_src
+
+*** Input Basics - Moving A Sprite - main.rb
+#+begin_src ruby
+ # ./samples/02_input_basics/01_moving_a_sprite/app/main.rb
+ def tick args
+ # create a player and set default values
+ # for the player's x, y, w (width), and h (height)
+ args.state.player.x ||= 100
+ args.state.player.y ||= 100
+ args.state.player.w ||= 50
+ args.state.player.h ||= 50
+
+ # render the player to the screen
+ 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' }
+
+ # move the player around using the keyboard
+ if args.inputs.up
+ args.state.player.y += 10
+ elsif args.inputs.down
+ args.state.player.y -= 10
+ end
+
+ if args.inputs.left
+ args.state.player.x -= 10
+ elsif args.inputs.right
+ args.state.player.x += 10
+ end
end
+
+ $gtk.reset
#+end_src
@@ -4838,11 +4228,7 @@ Follows is a source code listing for all files that have been open sourced. This
# This method effectively combines the row_to_px and small_font methods
# It changes the given row value to a DragonRuby pixel value
# and adds the customization parameters
- [x, row_to_px(args, row), message, small_font]
- end
-
- def small_font
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, alignment_enum: -2 }
end
def row_to_px args, row_number
@@ -4858,9 +4244,9 @@ Follows is a source code listing for all files that have been open sourced. This
args.state.key_event_occurred = true
end
- args.outputs.debug << [0, y - 50, 1280, 60].solid
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
#+end_src
@@ -4912,7 +4298,7 @@ Follows is a source code listing for all files that have been open sourced. This
args.outputs.labels << small_label(args, x, 15, "Click inside the blue box maybe ---->")
- box = [785, 370, 50, 50, 0, 0, 170]
+ box = { x: 785, y: 370, w: 50, h: 50, r: 0, g: 0, b: 170 }
args.outputs.borders << box
# Saves the most recent click into args.state
@@ -4934,11 +4320,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
def small_label args, x, row, message
- [x, row_to_px(args, row), message, small_font]
- end
-
- def small_font
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }
end
def row_to_px args, row_number
@@ -4954,9 +4336,9 @@ Follows is a source code listing for all files that have been open sourced. This
args.state.key_event_occurred = true
end
- args.outputs.debug << [0, y - 50, 1280, 60].solid
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
#+end_src
@@ -5008,9 +4390,15 @@ Follows is a source code listing for all files that have been open sourced. This
# They are stored in game so that they do not get reset every tick
if args.inputs.mouse.click
if !args.state.box_collision_one
- args.state.box_collision_one = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 180, 0, 0, 180]
+ args.state.box_collision_one = { x: args.inputs.mouse.click.point.x - 25,
+ y: args.inputs.mouse.click.point.y - 25,
+ w: 125, h: 125,
+ r: 180, g: 0, b: 0, a: 180 }
elsif !args.state.box_collision_two
- args.state.box_collision_two = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 0, 0, 180, 180]
+ args.state.box_collision_two = { x: args.inputs.mouse.click.point.x - 25,
+ y: args.inputs.mouse.click.point.y - 25,
+ w: 125, h: 125,
+ r: 0, g: 0, b: 180, a: 180 }
else
args.state.box_collision_one = nil
args.state.box_collision_two = nil
@@ -5037,15 +4425,11 @@ Follows is a source code listing for all files that have been open sourced. This
end
def small_label args, x, row, message
- [x, row_to_px(args, row), message, small_font]
- end
-
- def small_font
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }
end
def row_to_px args, row_number
- args.grid.top.shift_down(5).shift_down(20 * row_number)
+ args.grid.top - 5 - (20 * row_number)
end
def tick_instructions args, text, y = 715
@@ -5111,57 +4495,51 @@ Follows is a source code listing for all files that have been open sourced. This
def process_inputs
state.buttons = []
- state.buttons << [100, 500, inputs.controller_one.key_held.l1, "L1"]
- state.buttons << [100, 600, inputs.controller_one.key_held.l2, "L2"]
-
- state.buttons << [1100, 500, inputs.controller_one.key_held.r1, "R1"]
- state.buttons << [1100, 600, inputs.controller_one.key_held.r2, "R2"]
-
- state.buttons << [540, 450, inputs.controller_one.key_held.select, "Select"]
- state.buttons << [660, 450, inputs.controller_one.key_held.start, "Start"]
-
- state.buttons << [200, 300, inputs.controller_one.key_held.left, "Left"]
- state.buttons << [300, 400, inputs.controller_one.key_held.up, "Up"]
- state.buttons << [400, 300, inputs.controller_one.key_held.right, "Right"]
- state.buttons << [300, 200, inputs.controller_one.key_held.down, "Down"]
-
- state.buttons << [800, 300, inputs.controller_one.key_held.x, "X"]
- state.buttons << [900, 400, inputs.controller_one.key_held.y, "Y"]
- state.buttons << [1000, 300, inputs.controller_one.key_held.a, "A"]
- state.buttons << [900, 200, inputs.controller_one.key_held.b, "B"]
-
- state.buttons << [450 + inputs.controller_one.left_analog_x_perc * 100,
- 100 + inputs.controller_one.left_analog_y_perc * 100,
- inputs.controller_one.key_held.l3,
- "L3"]
-
- state.buttons << [750 + inputs.controller_one.right_analog_x_perc * 100,
- 100 + inputs.controller_one.right_analog_y_perc * 100,
- inputs.controller_one.key_held.r3,
- "R3"]
+ state.buttons << { x: 100, y: 500, active: inputs.controller_one.key_held.l1, text: "L1"}
+ state.buttons << { x: 100, y: 600, active: inputs.controller_one.key_held.l2, text: "L2"}
+ state.buttons << { x: 1100, y: 500, active: inputs.controller_one.key_held.r1, text: "R1"}
+ state.buttons << { x: 1100, y: 600, active: inputs.controller_one.key_held.r2, text: "R2"}
+ state.buttons << { x: 540, y: 450, active: inputs.controller_one.key_held.select, text: "Select"}
+ state.buttons << { x: 660, y: 450, active: inputs.controller_one.key_held.start, text: "Start"}
+ state.buttons << { x: 200, y: 300, active: inputs.controller_one.key_held.left, text: "Left"}
+ state.buttons << { x: 300, y: 400, active: inputs.controller_one.key_held.up, text: "Up"}
+ state.buttons << { x: 400, y: 300, active: inputs.controller_one.key_held.right, text: "Right"}
+ state.buttons << { x: 300, y: 200, active: inputs.controller_one.key_held.down, text: "Down"}
+ state.buttons << { x: 800, y: 300, active: inputs.controller_one.key_held.x, text: "X"}
+ state.buttons << { x: 900, y: 400, active: inputs.controller_one.key_held.y, text: "Y"}
+ state.buttons << { x: 1000, y: 300, active: inputs.controller_one.key_held.a, text: "A"}
+ state.buttons << { x: 900, y: 200, active: inputs.controller_one.key_held.b, text: "B"}
+ state.buttons << { x: 450 + inputs.controller_one.left_analog_x_perc * 100,
+ y: 100 + inputs.controller_one.left_analog_y_perc * 100,
+ active: inputs.controller_one.key_held.l3,
+ text: "L3" }
+ state.buttons << { x: 750 + inputs.controller_one.right_analog_x_perc * 100,
+ y: 100 + inputs.controller_one.right_analog_y_perc * 100,
+ active: inputs.controller_one.key_held.r3,
+ text: "R3" }
end
# Gives each button a square shape.
# If the button is being pressed or held (which means it is considered active),
# the square is filled in. Otherwise, the button simply has a border.
def render
- state.buttons.each do |x, y, active, text|
- rect = [x, y, 75, 75]
+ state.buttons.each do |b|
+ rect = { x: b.x, y: b.y, w: 75, h: 75 }
- if active # if button is pressed
+ if b.active # if button is pressed
outputs.solids << rect # rect is output as solid (filled in)
else
outputs.borders << rect # otherwise, output as border
end
# Outputs the text of each button using labels.
- outputs.labels << [x, y + 95, text] # add 95 to place label above button
+ outputs.labels << { x: b.x, y: b.y + 95, text: b.text } # add 95 to place label above button
end
- outputs.labels << [10, 60, "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)"]
- outputs.labels << [10, 30, "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)"]
- outputs.labels << [900, 60, "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)"]
- outputs.labels << [900, 30, "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)"]
+ outputs.labels << { x: 10, y: 60, text: "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)" }
+ outputs.labels << { x: 10, y: 30, text: "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)" }
+ outputs.labels << { x: 900, y: 60, text: "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)" }
+ outputs.labels << { x: 900, y: 30, text: "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)" }
end
end
@@ -5212,10 +4590,12 @@ Follows is a source code listing for all files that have been open sourced. This
# the next new touch will be finger_one again, but until then, new touches
# don't fill in earlier slots.
if !args.inputs.finger_one.nil?
- args.outputs.primitives << [640, 650, "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).", 5, 1, 255, 255, 255].label
+ args.outputs.primitives << { x: 640, y: 650, text: "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).",
+ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
if !args.inputs.finger_two.nil?
- args.outputs.primitives << [640, 600, "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).", 5, 1, 255, 255, 255].label
+ args.outputs.primitives << { x: 640, y: 600, text: "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).",
+ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
end
# Here's the more flexible interface: this will report as many simultaneous
@@ -5236,11 +4616,10 @@ Follows is a source code listing for all files that have been open sourced. This
r = (color & 0xFF0000) >> 16
g = (color & 0x00FF00) >> 8
b = (color & 0x0000FF)
- args.outputs.primitives << [v.x - (size / 2), v.y + (size / 2), size, size, r, g, b, 255].solid
- args.outputs.primitives << [v.x, v.y + size, k.to_s, 0, 1, 0, 0, 0].label
+ args.outputs.primitives << { x: v.x - (size / 2), y: v.y + (size / 2), w: size, h: size, r: r, g: g, b: b, a: 255 }.solid!
+ args.outputs.primitives << { x: v.x, y: v.y + size, text: k.to_s, alignment_enum: 1 }.label!
}
end
-
#+end_src
@@ -5280,6 +4659,8 @@ Follows is a source code listing for all files that have been open sourced. This
# in this tick "entry point": `looping_animation`, and the
# second method is `one_time_animation`.
def tick args
+ # uncomment the line below to see animation play out in slow motion
+ # args.gtk.slowmo! 6
looping_animation args
one_time_animation args
end
@@ -5312,22 +4693,22 @@ Follows is a source code listing for all files that have been open sourced. This
does_sprite_loop
# Now that we have `sprite_index, we can present the correct file.
- args.outputs.sprites << [100, 100, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]
+ args.outputs.sprites << { x: 100, y: 100, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }
# Try changing the numbers below to see how the animation changes:
- args.outputs.sprites << [100, 200, 100, 100, "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png"]
+ args.outputs.sprites << { x: 100, y: 200, w: 100, h: 100, path: "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png" }
end
# This function shows how to animate a sprite that executes
# only once when the "f" key is pressed.
def one_time_animation args
# This is just a label the shows instructions within the game.
- args.outputs.labels << [220, 350, "(press f to animate)"]
+ args.outputs.labels << { x: 220, y: 350, text: "(press f to animate)" }
# If "f" is pressed on the keyboard...
if args.inputs.keyboard.key_down.f
# Print the frame that "f" was pressed on.
- puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.inputs.keyboard.key_down.f}"
+ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.state.tick_count}"
# And MOST IMPORTANTLY set the point it time to start the animation,
# equal to "now" which is represented as args.state.tick_count.
@@ -5360,7 +4741,7 @@ Follows is a source code listing for all files that have been open sourced. This
sprite_index ||= 0
# Present the sprite.
- args.outputs.sprites << [100, 300, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]
+ args.outputs.sprites << { x: 100, y: 300, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }
tick_instructions args, "Sample app shows how to use Numeric#frame_index and string interpolation to animate a sprite over time."
end
@@ -7353,9 +6734,9 @@ Follows is a source code listing for all files that have been open sourced. This
mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode
if state.mouse_held
- outputs.primitives << mouse_overlay.border
+ outputs.primitives << mouse_overlay.border!
else
- outputs.primitives << mouse_overlay.solid
+ outputs.primitives << mouse_overlay.solid!
end
end
@@ -11650,6 +11031,1008 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Audio - Audio Mixer - main.rb
+#+begin_src ruby
+ # ./samples/07_advanced_audio/01_audio_mixer/app/main.rb
+ # these are the properties that you can sent on args.audio
+ def spawn_new_sound args, name, path
+ # Spawn randomly in an area that won't be covered by UI.
+ screenx = (rand * 600.0) + 200.0
+ screeny = (rand * 400.0) + 100.0
+
+ id = new_sound_id! args
+ # you can hang anything on the audio hashes you want, so we store the
+ # actual screen position in here for convenience.
+ args.audio[id] = {
+ name: name,
+ input: path,
+ screenx: screenx,
+ screeny: screeny,
+ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
+ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
+ z: 0.0,
+ gain: 1.0,
+ pitch: 1.0,
+ looping: true,
+ paused: false
+ }
+
+ args.state.selected = id
+ end
+
+ # these are values you can change on the ~args.audio~ data structure
+ def input_panel args
+ return unless args.state.panel
+ return if args.state.dragging
+
+ audio_entry = args.audio[args.state.selected]
+ results = args.state.panel
+
+ if args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.pitch_slider_rect.rect)
+ audio_entry.pitch = 2.0 * ((args.inputs.mouse.x - results.pitch_slider_rect.x).to_f / (results.pitch_slider_rect.w - 1.0))
+ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.playtime_slider_rect.rect)
+ audio_entry.playtime = audio_entry.length_ * ((args.inputs.mouse.x - results.playtime_slider_rect.x).to_f / (results.playtime_slider_rect.w - 1.0))
+ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.gain_slider_rect.rect)
+ audio_entry.gain = (args.inputs.mouse.x - results.gain_slider_rect.x).to_f / (results.gain_slider_rect.w - 1.0)
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.looping_checkbox_rect.rect)
+ audio_entry.looping = !audio_entry.looping
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.paused_checkbox_rect.rect)
+ audio_entry.paused = !audio_entry.paused
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.delete_button_rect.rect)
+ args.audio.delete args.state.selected
+ end
+ end
+
+ def render_sources args
+ args.outputs.primitives << args.audio.keys.map do |k|
+ s = args.audio[k]
+
+ isselected = (k == args.state.selected)
+
+ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]
+ [
+ [s.screenx, s.screeny, args.state.boxsize, args.state.boxsize, *color].solid,
+
+ {
+ x: s.screenx + args.state.boxsize.half,
+ y: s.screeny,
+ text: s.name,
+ r: 255,
+ g: 255,
+ b: 255,
+ alignment_enum: 1
+ }.label!
+ ]
+ end
+ end
+
+ def playtime_str 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]
+ end
+
+ def label_with_drop_shadow x, y, text
+ [
+ { x: x + 1, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,
+ { x: x + 2, y: y + 0, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,
+ { x: x + 0, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 200, g: 200, b: 200 }.label!
+ ]
+ end
+
+ def check_box opts = {}
+ checkbox_template = opts.args.layout.rect(w: 0.5, h: 0.5, col: 2)
+ final_rect = checkbox_template.center_inside_rect_y(opts.args.layout.rect(row: opts.row, col: opts.col))
+ color = { r: 0, g: 0, b: 0 }
+ color = { r: 255, g: 255, b: 255 } if opts.checked
+
+ {
+ rect: final_rect,
+ primitives: [
+ (final_rect.to_solid color)
+ ]
+ }
+ end
+
+ def progress_bar opts = {}
+ outer_rect = opts.args.layout.rect(row: opts.row, col: opts.col, w: 5, h: 1)
+ color = opts.percentage * 255
+ baseline_progress_bar = opts.args
+ .layout
+ .rect(w: 5, h: 0.5)
+
+ final_rect = baseline_progress_bar.center_inside_rect(outer_rect)
+ center = final_rect.rect_center_point
+
+ {
+ rect: final_rect,
+ primitives: [
+ final_rect.merge(r: color, g: color, b: color, a: 128).solid!,
+ label_with_drop_shadow(center.x, center.y, opts.text)
+ ]
+ }
+ end
+
+ def panel_primitives args, audio_entry
+ results = { primitives: [] }
+
+ return results unless audio_entry
+
+ # this uses DRGTK's layout apis to layout the controls
+ # imagine the screen is split into equal cells (24 cells across, 12 cells up and down)
+ # args.layout.rect returns a hash which we merge values with to create primitives
+ # using args.layout.rect removes the need for pixel pushing
+
+ # args.outputs.debug << args.layout.debug_primitives(r: 255, g: 255, b: 255)
+
+ white_color = { r: 255, g: 255, b: 255 }
+ label_style = white_color.merge(vertical_alignment_enum: 1)
+
+ # panel background
+ results.primitives << args.layout.rect(row: 0, col: 0, w: 7, h: 6, include_col_gutter: true, include_row_gutter: true)
+ .border!(r: 255, g: 255, b: 255)
+
+ # title
+ results.primitives << args.layout.point(row: 0, col: 3.5, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "Source #{args.state.selected} (#{args.audio[args.state.selected].name})",
+ size_enum: 3,
+ alignment_enum: 1)
+
+ # seperator line
+ results.primitives << args.layout.rect(row: 1, col: 0, w: 7, h: 0)
+ .line!(white_color)
+
+ # screen location
+ results.primitives << args.layout.point(row: 1.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "screen:")
+
+ results.primitives << args.layout.point(row: 1.0, col: 2, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "(#{audio_entry.screenx.to_i}, #{audio_entry.screeny.to_i})")
+
+ # position
+ results.primitives << args.layout.point(row: 1.5, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "position:")
+
+ results.primitives << args.layout.point(row: 1.5, col: 2, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "(#{audio_entry[:x].round(5).to_s[0..6]}, #{audio_entry[:y].round(5).to_s[0..6]})")
+
+ results.primitives << args.layout.point(row: 2.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "pitch:")
+
+ results.pitch_slider_rect = progress_bar(row: 2.0, col: 2,
+ percentage: audio_entry.pitch / 2.0,
+ text: "#{audio_entry.pitch.to_sf}",
+ args: args)
+
+ results.primitives << results.pitch_slider_rect.primitives
+
+ results.primitives << args.layout.point(row: 2.5, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "playtime:")
+
+ results.playtime_slider_rect = progress_bar(args: args,
+ row: 2.5,
+ col: 2,
+ percentage: audio_entry.playtime / audio_entry.length_,
+ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")
+
+ results.primitives << results.playtime_slider_rect.primitives
+
+ results.primitives << args.layout.point(row: 3.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "gain:")
+
+ results.gain_slider_rect = progress_bar(args: args,
+ row: 3.0,
+ col: 2,
+ percentage: audio_entry.gain,
+ text: "#{audio_entry.gain.to_sf}")
+
+ results.primitives << results.gain_slider_rect.primitives
+
+
+ results.primitives << args.layout.point(row: 3.5, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "looping:")
+
+ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)
+
+ results.looping_checkbox_rect = check_box(args: args, row: 3.5, col: 2, checked: audio_entry.looping)
+ results.primitives << results.looping_checkbox_rect.primitives
+
+ results.primitives << args.layout.point(row: 4.0, col: 0, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "paused:")
+
+ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)
+
+ results.paused_checkbox_rect = check_box(args: args, row: 4.0, col: 2, checked: !audio_entry.paused)
+ results.primitives << results.paused_checkbox_rect.primitives
+
+ results.delete_button_rect = { rect: args.layout.rect(row: 5, col: 0, w: 7, h: 1) }
+
+ results.primitives << results.delete_button_rect.to_solid(r: 180)
+
+ results.primitives << args.layout.point(row: 5, col: 3.5, row_anchor: 0.5)
+ .merge(label_style)
+ .merge(text: "DELETE", alignment_enum: 1)
+
+ return results
+ end
+
+ def render_panel args
+ args.state.panel = nil
+ audio_entry = args.audio[args.state.selected]
+ return unless audio_entry
+
+ mouse_down = (args.state.mouse_held >= 0)
+ args.state.panel = panel_primitives args, audio_entry
+ args.outputs.primitives << args.state.panel.primitives
+ end
+
+ def new_sound_id! args
+ args.state.sound_id ||= 0
+ args.state.sound_id += 1
+ args.state.sound_id
+ end
+
+ def render_launcher args
+ args.outputs.primitives << args.state.spawn_sound_buttons.map(&:primitives)
+ end
+
+ def render_ui args
+ render_launcher args
+ render_panel args
+ end
+
+ def tick args
+ defaults args
+ render args
+ input args
+ end
+
+ def input args
+ if !args.audio[args.state.selected]
+ args.state.selected = nil
+ args.state.dragging = nil
+ end
+
+ # spawn button and node interaction
+ if args.inputs.mouse.click
+ spawn_sound_button = args.state.spawn_sound_buttons.find { |b| args.inputs.mouse.inside_rect? b.rect }
+
+ audio_click_key, audio_click_value = args.audio.find do |k, v|
+ args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]
+ end
+
+ if spawn_sound_button
+ args.state.selected = nil
+ spawn_new_sound args, spawn_sound_button.name, spawn_sound_button.path
+ elsif audio_click_key
+ args.state.selected = audio_click_key
+ end
+ end
+
+ if args.state.mouse_state == :held && args.state.selected
+ v = args.audio[args.state.selected]
+ if args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]
+ args.state.dragging = args.state.selected
+ end
+
+ if args.state.dragging
+ s = args.audio[args.state.selected]
+ # you can hang anything on the audio hashes you want, so we store the
+ # actual screen position so it doesn't scale weirdly vs your mouse.
+ s.screenx = args.inputs.mouse.x - (args.state.boxsize / 2)
+ s.screeny = args.inputs.mouse.y - (args.state.boxsize / 2)
+
+ s.screeny = 50 if s.screeny < 50
+ s.screeny = (719 - args.state.boxsize) if s.screeny > (719 - args.state.boxsize)
+ s.screenx = 0 if s.screenx < 0
+ s.screenx = (1279 - args.state.boxsize) if s.screenx > (1279 - args.state.boxsize)
+
+ s.x = ((s.screenx / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
+ s.y = ((s.screeny / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
+ end
+ elsif args.state.mouse_state == :released
+ args.state.dragging = nil
+ end
+
+ input_panel args
+ end
+
+ def defaults args
+ args.state.mouse_state ||= :released
+ args.state.dragging_source ||= false
+ args.state.selected ||= 0
+ args.state.next_sound_index ||= 0
+ args.state.boxsize ||= 30
+ args.state.sound_files ||= [
+ { name: :tada, path: "sounds/tada.wav" },
+ { name: :splash, path: "sounds/splash.wav" },
+ { name: :drum, path: "sounds/drum.wav" },
+ { name: :spring, path: "sounds/spring.wav" },
+ { name: :music, path: "sounds/music.ogg" }
+ ]
+
+ # generate buttons based off the sound collection above
+ args.state.spawn_sound_buttons ||= begin
+ # create a group of buttons
+ # column centered (using col_offset to calculate the column offset)
+ # where each item is 2 columns apart
+ rects = args.layout.rect_group row: 11,
+ col_offset: {
+ count: args.state.sound_files.length,
+ w: 2
+ },
+ dcol: 2,
+ w: 2,
+ h: 1,
+ group: args.state.sound_files
+
+ # now that you have the rects
+ # construct the metadata for the buttons
+ rects.map do |rect|
+ {
+ rect: rect,
+ name: rect.name,
+ path: rect.path,
+ primitives: [
+ rect.to_border(r: 255, g: 255, b: 255),
+ rect.to_label(x: rect.center_x,
+ y: rect.center_y,
+ text: "#{rect.name}",
+ alignment_enum: 1,
+ vertical_alignment_enum: 1,
+ r: 255, g: 255, b: 255)
+ ]
+ }
+ end
+ end
+
+ if args.inputs.mouse.up
+ args.state.mouse_state = :released
+ args.state.dragging_source = false
+ elsif args.inputs.mouse.down
+ args.state.mouse_state = :held
+ end
+
+ args.outputs.background_color = [ 0, 0, 0, 255 ]
+ end
+
+ def render args
+ render_ui args
+ render_sources args
+ end
+
+#+end_src
+
+*** Advanced Audio - Audio Mixer - server_ip_address.txt
+#+begin_src ruby
+ # ./samples/07_advanced_audio/01_audio_mixer/app/server_ip_address.txt
+ 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
+ begin # region: top level tick methods
+ def tick args
+ defaults args
+ render args
+ input args
+ process_audio_queue args
+ end
+
+ def defaults args
+ args.state.sine_waves ||= {}
+ args.state.square_waves ||= {}
+ args.state.saw_tooth_waves ||= {}
+ args.state.triangle_waves ||= {}
+ args.state.audio_queue ||= []
+ args.state.buttons ||= [
+ (frequency_buttons args),
+ (sine_wave_note_buttons args),
+ (bell_buttons args),
+ (square_wave_note_buttons args),
+ (saw_tooth_wave_note_buttons args),
+ (triangle_wave_note_buttons args),
+ ].flatten
+ end
+
+ def render args
+ args.outputs.borders << args.state.buttons.map { |b| b[:border] }
+ args.outputs.labels << args.state.buttons.map { |b| b[:label] }
+ args.outputs.labels << args.layout
+ .rect(row: 0, col: 11.5)
+ .yield_self { |r| r.merge y: r.y + r.h }
+ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",
+ alignment_enum: 1)
+ end
+
+
+ def input args
+ args.state.buttons.each do |b|
+ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])
+ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "
+ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"
+ send b[:method_to_call], args, b
+ end
+ end
+
+ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))
+ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'
+ end
+ end
+
+ def process_audio_queue args
+ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }
+ args.state.audio_queue -= to_queue
+ to_queue.each { |a| args.audio[a[:id]] = a }
+
+ args.audio.find_all { |k, v| v[:decay_rate] }
+ .each { |k, v| v[:gain] -= v[:decay_rate] }
+
+ sounds_to_stop = args.audio
+ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }
+ .map { |k, v| k }
+
+ sounds_to_stop.each { |k| args.audio.delete k }
+ end
+ end
+
+ begin # region: button definitions, ui layout, callback functions
+ def button args, opts
+ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
+
+ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
+
+ label_offset_x = 5
+ label_offset_y = 30
+
+ button_def[:label] = button_def[:rect].merge text: opts[:text],
+ size_enum: -2.5,
+ x: button_def[:rect].x + label_offset_x,
+ y: button_def[:rect].y + label_offset_y
+
+ button_def
+ end
+
+ def play_sine_wave args, sender
+ queue_sine_wave args,
+ frequency: sender[:frequency],
+ duration: 1.seconds,
+ fade_out: true
+ end
+
+ def play_note args, sender
+ method_to_call = :queue_sine_wave
+ method_to_call = :queue_square_wave if sender[:type] == :square
+ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth
+ method_to_call = :queue_triangle_wave if sender[:type] == :triangle
+ method_to_call = :queue_bell if sender[:type] == :bell
+
+ send method_to_call, args,
+ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),
+ duration: 1.seconds,
+ fade_out: true
+ end
+
+ def frequency_buttons args
+ [
+ (button args,
+ row: 4.0, col: 0, text: "300hz",
+ frequency: 300,
+ method_to_call: :play_sine_wave),
+ (button args,
+ row: 5.0, col: 0, text: "400hz",
+ frequency: 400,
+ method_to_call: :play_sine_wave),
+ (button args,
+ row: 6.0, col: 0, text: "500hz",
+ frequency: 500,
+ method_to_call: :play_sine_wave),
+ ]
+ end
+
+ def sine_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 2, text: "Sine C4",
+ note: :c, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 2, text: "Sine D4",
+ note: :d, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 2, text: "Sine E4",
+ note: :e, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 2, text: "Sine F4",
+ note: :f, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 2, text: "Sine G4",
+ note: :g, octave: 4, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 2, text: "Sine A5",
+ note: :a, octave: 5, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 2, text: "Sine B5",
+ note: :b, octave: 5, type: :sine, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 2, text: "Sine C5",
+ note: :c, octave: 5, type: :sine, method_to_call: :play_note),
+ ]
+ end
+
+ def square_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 6, text: "Square C4",
+ note: :c, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 6, text: "Square D4",
+ note: :d, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 6, text: "Square E4",
+ note: :e, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 6, text: "Square F4",
+ note: :f, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 6, text: "Square G4",
+ note: :g, octave: 4, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 6, text: "Square A5",
+ note: :a, octave: 5, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 6, text: "Square B5",
+ note: :b, octave: 5, type: :square, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 6, text: "Square C5",
+ note: :c, octave: 5, type: :square, method_to_call: :play_note),
+ ]
+ end
+ def saw_tooth_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 8, text: "Saw C4",
+ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 8, text: "Saw D4",
+ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 8, text: "Saw E4",
+ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 8, text: "Saw F4",
+ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 8, text: "Saw G4",
+ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 8, text: "Saw A5",
+ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 8, text: "Saw B5",
+ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 8, text: "Saw C5",
+ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+ ]
+ end
+
+ def triangle_wave_note_buttons args
+ [
+ (button args,
+ row: 1.5, col: 10, text: "Triangle C4",
+ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 10, text: "Triangle D4",
+ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 10, text: "Triangle E4",
+ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 10, text: "Triangle F4",
+ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 10, text: "Triangle G4",
+ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 10, text: "Triangle A5",
+ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 10, text: "Triangle B5",
+ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 10, text: "Triangle C5",
+ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),
+ ]
+ end
+
+ def bell_buttons args
+ [
+ (button args,
+ row: 1.5, col: 4, text: "Bell C4",
+ note: :c, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 2.5, col: 4, text: "Bell D4",
+ note: :d, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 3.5, col: 4, text: "Bell E4",
+ note: :e, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 4.5, col: 4, text: "Bell F4",
+ note: :f, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 5.5, col: 4, text: "Bell G4",
+ note: :g, octave: 4, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 6.5, col: 4, text: "Bell A5",
+ note: :a, octave: 5, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 7.5, col: 4, text: "Bell B5",
+ note: :b, octave: 5, type: :bell, method_to_call: :play_note),
+ (button args,
+ row: 8.5, col: 4, text: "Bell C5",
+ note: :c, octave: 5, type: :bell, method_to_call: :play_note),
+ ]
+ end
+ end
+
+ begin # region: wave generation
+ begin # sine wave
+ def defaults_sine_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def sine_wave_for opts = {}
+ opts = defaults_sine_wave_for.merge opts
+ frequency = opts[:frequency]
+ sample_rate = opts[:sample_rate]
+ period_size = (sample_rate.fdiv frequency).ceil
+ period_size.map_with_index do |i|
+ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)
+ end.to_a
+ end
+
+ def defaults_queue_sine_wave
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_sine_wave args, opts = {}
+ opts = defaults_queue_sine_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.sine_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: sine_wave
+ end
+ end
+
+ begin # region: square wave
+ def defaults_square_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def square_wave_for opts = {}
+ opts = defaults_square_wave_for.merge opts
+ sine_wave = sine_wave_for opts
+ sine_wave.map do |v|
+ if v >= 0
+ 1.0
+ else
+ -1.0
+ end
+ end.to_a
+ end
+
+ def defaults_queue_square_wave
+ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_square_wave args, opts = {}
+ opts = defaults_queue_square_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.square_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: square_wave
+ end
+ end
+
+ begin # region: saw tooth wave
+ def defaults_saw_tooth_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def saw_tooth_wave_for opts = {}
+ opts = defaults_saw_tooth_wave_for.merge opts
+ sine_wave = sine_wave_for opts
+ period_size = sine_wave.length
+ sine_wave.map_with_index do |v, i|
+ (((i % period_size).fdiv period_size) * 2) - 1
+ end
+ end
+
+ def defaults_queue_saw_tooth_wave
+ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_saw_tooth_wave args, opts = {}
+ opts = defaults_queue_saw_tooth_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave
+ end
+ end
+
+ begin # region: triangle wave
+ def defaults_triangle_wave_for
+ { frequency: 440, sample_rate: 48000 }
+ end
+
+ def triangle_wave_for opts = {}
+ opts = defaults_saw_tooth_wave_for.merge opts
+ sine_wave = sine_wave_for opts
+ period_size = sine_wave.length
+ sine_wave.map_with_index do |v, i|
+ ratio = (i.fdiv period_size)
+ if ratio <= 0.5
+ (ratio * 4) - 1
+ else
+ ratio -= 0.5
+ 1 - (ratio * 4)
+ end
+ end
+ end
+
+ def defaults_queue_triangle_wave
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+ end
+
+ def queue_triangle_wave args, opts = {}
+ opts = defaults_queue_triangle_wave.merge opts
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate
+ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate
+
+ proc = lambda do
+ generate_audio_data args.state.triangle_waves[frequency], sample_rate
+ end
+
+ audio_state = new_audio_state args, opts
+ audio_state[:input] = [1, sample_rate, proc]
+ queue_audio args, audio_state: audio_state, wave: triangle_wave
+ end
+ end
+
+ begin # region: bell
+ def defaults_queue_bell
+ { frequency: 440, duration: 1.seconds, queue_in: 0 }
+ end
+
+ def queue_bell args, opts = {}
+ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }
+ end
+
+ def bell_harmonics
+ [
+ { frequency_ratio: 0.5, duration_ratio: 1.00 },
+ { frequency_ratio: 1.0, duration_ratio: 0.80 },
+ { frequency_ratio: 2.0, duration_ratio: 0.60 },
+ { frequency_ratio: 3.0, duration_ratio: 0.40 },
+ { frequency_ratio: 4.2, duration_ratio: 0.25 },
+ { frequency_ratio: 5.4, duration_ratio: 0.20 },
+ { frequency_ratio: 6.8, duration_ratio: 0.15 }
+ ]
+ end
+
+ def defaults_bell_to_sine_waves
+ { frequency: 440, duration: 1.seconds, queue_in: 0 }
+ end
+
+ def bell_to_sine_waves opts = {}
+ opts = defaults_bell_to_sine_waves.merge opts
+ bell_harmonics.map do |b|
+ {
+ frequency: opts[:frequency] * b[:frequency_ratio],
+ duration: opts[:duration] * b[:duration_ratio],
+ queue_in: opts[:queue_in],
+ gain: (1.fdiv bell_harmonics.length),
+ fade_out: true
+ }
+ end
+ end
+ end
+
+ begin # audio entity construction
+ def generate_audio_data sine_wave, sample_rate
+ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil
+ copy_count = (sample_size.fdiv sine_wave.length).ceil
+ sine_wave * copy_count
+ end
+
+ def defaults_new_audio_state
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+ end
+
+ def new_audio_state args, opts = {}
+ opts = defaults_new_audio_state.merge opts
+ decay_rate = 0
+ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]
+ frequency = opts[:frequency]
+ sample_rate = 48000
+
+ {
+ id: (new_id! args),
+ frequency: frequency,
+ sample_rate: 48000,
+ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],
+ gain: opts[:gain].to_f,
+ queue_at: args.state.tick_count + opts[:queue_in],
+ decay_rate: decay_rate,
+ pitch: 1.0,
+ looping: true,
+ paused: false
+ }
+ end
+
+ def queue_audio args, opts = {}
+ graph_wave args, opts[:wave], opts[:audio_state][:frequency]
+ args.state.audio_queue << opts[:audio_state]
+ end
+
+ def new_id! args
+ args.state.audio_id ||= 0
+ args.state.audio_id += 1
+ end
+
+ def graph_wave args, wave, frequency
+ if args.state.tick_count != args.state.graphed_at
+ args.outputs.static_lines.clear
+ args.outputs.static_sprites.clear
+ end
+
+ wave = wave
+
+ r, g, b = frequency.to_i % 85,
+ frequency.to_i % 170,
+ frequency.to_i % 255
+
+ starting_rect = args.layout.rect(row: 5, col: 13)
+ x_scale = 10
+ y_scale = 100
+ max_points = 25
+
+ points = wave
+ if wave.length > max_points
+ resolution = wave.length.idiv max_points
+ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }
+ end
+
+ args.outputs.static_lines << points.map_with_index do |y, x|
+ next_y = points[x + 1]
+
+ if next_y
+ {
+ x: starting_rect.x + (x * x_scale),
+ y: starting_rect.y + starting_rect.h.half + y_scale * y,
+ x2: starting_rect.x + ((x + 1) * x_scale),
+ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,
+ r: r,
+ g: g,
+ b: b
+ }
+ end
+ end
+
+ args.outputs.static_sprites << points.map_with_index do |y, x|
+ {
+ x: (starting_rect.x + (x * x_scale)) - 2,
+ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,
+ w: 4,
+ h: 4,
+ path: 'sprites/square-white.png',
+ r: r,
+ g: g,
+ b: b
+ }
+ end
+
+ args.state.graphed_at = args.state.tick_count
+ end
+ end
+
+ begin # region: musical note mapping
+ def defaults_frequency_for
+ { note: :a, octave: 5, sharp: false, flat: false }
+ end
+
+ def frequency_for opts = {}
+ opts = defaults_frequency_for.merge opts
+ octave_offset_multiplier = opts[:octave] - 5
+ note = note_frequencies_octave_5[opts[:note]]
+ if octave_offset_multiplier < 0
+ note = note * 1 / (octave_offset_multiplier.abs + 1)
+ elsif octave_offset_multiplier > 0
+ note = note * (octave_offset_multiplier.abs + 1) / 1
+ end
+ note
+ end
+
+ def note_frequencies_octave_5
+ {
+ a: 440.0,
+ a_sharp: 466.16, b_flat: 466.16,
+ b: 493.88,
+ c: 523.25,
+ c_sharp: 554.37, d_flat: 587.33,
+ d: 587.33,
+ d_sharp: 622.25, e_flat: 659.25,
+ e: 659.25,
+ f: 698.25,
+ f_sharp: 739.99, g_flat: 739.99,
+ g: 783.99,
+ g_sharp: 830.61, a_flat: 830.61
+ }
+ end
+ end
+ end
+
+ $gtk.reset
+
+#+end_src
+
*** Advanced Rendering - Simple Render Targets - main.rb
#+begin_src ruby
# ./samples/07_advanced_rendering/01_simple_render_targets/app/main.rb
@@ -12602,7 +12985,7 @@ Follows is a source code listing for all files that have been open sourced. This
flip_horizontally: false,
angle_anchor_x: 0.5, # rotation center set to middle
angle_anchor_y: 0.5
- }.sprite
+ }.sprite!
# Outputs label as primitive using a hash
args.outputs.primitives << {
@@ -12616,7 +12999,7 @@ Follows is a source code listing for all files that have been open sourced. This
b: 50,
a: 255, # transparency
font: "fonts/manaspc.ttf" # font style
- }.label
+ }.label!
# Outputs solid as primitive using a hash
args.outputs.primitives << {
@@ -12628,7 +13011,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 50,
b: 50,
a: 255 # transparency
- }.solid
+ }.solid!
# Outputs border as primitive using a hash
# Same parameters as solid
@@ -12641,7 +13024,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 50,
b: 50,
a: 255 # transparency
- }.border
+ }.border!
# Outputs line as primitive using a hash
args.outputs.primitives << {
@@ -12653,7 +13036,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 50,
b: 50,
a: 255 # transparency
- }.line
+ }.line!
end
#+end_src
@@ -12705,9 +13088,108 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Rendering - Simple Camera - main.rb
+#+begin_src ruby
+ # ./samples/07_advanced_rendering/07_simple_camera/app/main.rb
+ def tick args
+ # variables you can play around with
+ args.state.world.w ||= 1280
+ args.state.world.h ||= 720
+
+ args.state.player.x ||= 0
+ args.state.player.y ||= 0
+ args.state.player.size ||= 32
+
+ args.state.enemy.x ||= 700
+ args.state.enemy.y ||= 700
+ args.state.enemy.size ||= 16
+
+ args.state.camera.x ||= 640
+ args.state.camera.y ||= 300
+ args.state.camera.scale ||= 1.0
+ args.state.camera.show_empty_space ||= :yes
+
+ # instructions
+ args.outputs.primitives << { x: 0, y: 80.from_top, w: 360, h: 80, r: 0, g: 0, b: 0, a: 128 }.solid!
+ args.outputs.primitives << { x: 10, y: 10.from_top, text: "arrow keys to move around", r: 255, g: 255, b: 255}.label!
+ args.outputs.primitives << { x: 10, y: 30.from_top, text: "+/- to change zoom of camera", r: 255, g: 255, b: 255}.label!
+ args.outputs.primitives << { x: 10, y: 50.from_top, text: "tab to change camera edge behavior", r: 255, g: 255, b: 255}.label!
+
+ # render scene
+ args.outputs[:scene].w = args.state.world.w
+ args.outputs[:scene].h = args.state.world.h
+
+ args.outputs[:scene].solids << { x: 0, y: 0, w: args.state.world.w, h: args.state.world.h, r: 20, g: 60, b: 80 }
+ args.outputs[:scene].solids << { x: args.state.player.x, y: args.state.player.y,
+ w: args.state.player.size, h: args.state.player.size, r: 80, g: 155, b: 80 }
+ args.outputs[:scene].solids << { x: args.state.enemy.x, y: args.state.enemy.y,
+ w: args.state.enemy.size, h: args.state.enemy.size, r: 155, g: 80, b: 80 }
+
+ # render camera
+ scene_position = calc_scene_position args
+ args.outputs.sprites << { x: scene_position.x,
+ y: scene_position.y,
+ w: scene_position.w,
+ h: scene_position.h,
+ path: :scene }
+
+ # move player
+ if args.inputs.directional_angle
+ args.state.player.x += args.inputs.directional_angle.vector_x * 5
+ args.state.player.y += args.inputs.directional_angle.vector_y * 5
+ args.state.player.x = args.state.player.x.clamp(0, args.state.world.w - args.state.player.size)
+ args.state.player.y = args.state.player.y.clamp(0, args.state.world.h - args.state.player.size)
+ end
+
+ # +/- to zoom in and out
+ if args.inputs.keyboard.plus && args.state.tick_count.zmod?(3)
+ args.state.camera.scale += 0.05
+ elsif args.inputs.keyboard.hyphen && args.state.tick_count.zmod?(3)
+ args.state.camera.scale -= 0.05
+ elsif args.inputs.keyboard.key_down.tab
+ if args.state.camera.show_empty_space == :yes
+ args.state.camera.show_empty_space = :no
+ else
+ args.state.camera.show_empty_space = :yes
+ end
+ end
+
+ args.state.camera.scale = args.state.camera.scale.greater(0.1)
+ end
+
+ def calc_scene_position args
+ result = { x: args.state.camera.x - (args.state.player.x * args.state.camera.scale),
+ y: args.state.camera.y - (args.state.player.y * args.state.camera.scale),
+ w: args.state.world.w * args.state.camera.scale,
+ h: args.state.world.h * args.state.camera.scale,
+ scale: args.state.camera.scale }
+
+ return result if args.state.camera.show_empty_space == :yes
+
+ if result.w < args.grid.w
+ result.merge!(x: (args.grid.w - result.w).half)
+ elsif (args.state.player.x * result.scale) < args.grid.w.half
+ result.merge!(x: 10)
+ elsif (result.x + result.w) < args.grid.w
+ result.merge!(x: - result.w + (args.grid.w - 10))
+ end
+
+ if result.h < args.grid.h
+ result.merge!(y: (args.grid.h - result.h).half)
+ elsif (result.y) > 10
+ result.merge!(y: 10)
+ elsif (result.y + result.h) < args.grid.h
+ result.merge!(y: - result.h + (args.grid.h - 10))
+ end
+
+ result
+ end
+
+#+end_src
+
*** Advanced Rendering - Splitscreen Camera - main.rb
#+begin_src ruby
- # ./samples/07_advanced_rendering/07_splitscreen_camera/app/main.rb
+ # ./samples/07_advanced_rendering/08_splitscreen_camera/app/main.rb
class CameraMovement
attr_accessor :state, :inputs, :outputs, :grid
@@ -13108,7 +13590,7 @@ Follows is a source code listing for all files that have been open sourced. This
*** Advanced Rendering - Z Targeting Camera - main.rb
#+begin_src ruby
- # ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb
+ # ./samples/07_advanced_rendering/09_z_targeting_camera/app/main.rb
class Game
attr_gtk
@@ -13218,6 +13700,61 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Rendering - Blend Modes - main.rb
+#+begin_src ruby
+ # ./samples/07_advanced_rendering/10_blend_modes/app/main.rb
+ $gtk.reset
+
+ def draw_blendmode args, mode
+ w = 160
+ h = w
+ args.state.x += (1280-w) / (args.state.blendmodes.length + 1)
+ x = args.state.x
+ y = (720 - h) / 2
+ s = 'sprites/blue-feathered.png'
+ args.outputs.sprites << { blendmode_enum: mode.value, x: x, y: y, w: w, h: h, path: s }
+ args.outputs.labels << [x + (w/2), y, mode.name.to_s, 1, 1, 255, 255, 255]
+ end
+
+ def tick args
+
+ # Different blend modes do different things, depending on what they
+ # blend against (in this case, the pixels of the background color).
+ args.state.bg_element ||= 1
+ args.state.bg_color ||= 255
+ args.state.bg_color_direction ||= 1
+ bg_r = (args.state.bg_element == 1) ? args.state.bg_color : 0
+ bg_g = (args.state.bg_element == 2) ? args.state.bg_color : 0
+ bg_b = (args.state.bg_element == 3) ? args.state.bg_color : 0
+ args.state.bg_color += args.state.bg_color_direction
+ if (args.state.bg_color_direction > 0) && (args.state.bg_color >= 255)
+ args.state.bg_color_direction = -1
+ args.state.bg_color = 255
+ elsif (args.state.bg_color_direction < 0) && (args.state.bg_color <= 0)
+ args.state.bg_color_direction = 1
+ args.state.bg_color = 0
+ args.state.bg_element += 1
+ if args.state.bg_element >= 4
+ args.state.bg_element = 1
+ end
+ end
+
+ args.outputs.background_color = [ bg_r, bg_g, bg_b, 255 ]
+
+ args.state.blendmodes ||= [
+ { name: :none, value: 0 },
+ { name: :blend, value: 1 },
+ { name: :add, value: 2 },
+ { name: :mod, value: 3 },
+ { name: :mul, value: 4 }
+ ]
+
+ args.state.x = 0 # reset this, draw_blendmode will increment it.
+ args.state.blendmodes.each { |blendmode| draw_blendmode args, blendmode }
+ end
+
+#+end_src
+
*** Tweening Lerping Easing Functions - Easing Functions - main.rb
#+begin_src ruby
# ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb
@@ -13710,7 +14247,11 @@ Follows is a source code listing for all files that have been open sourced. This
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
- puts "* INFO - Please specify the number of sprites to render."
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Hashes"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13780,7 +14321,11 @@ Follows is a source code listing for all files that have been open sourced. This
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
- puts "* INFO - Please specify the number of sprites to render."
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Open Entities"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13854,7 +14399,11 @@ Follows is a source code listing for all files that have been open sourced. This
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
- puts "* INFO - Please specify the number of sprites to render."
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Strict Entities"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13911,6 +14460,11 @@ Follows is a source code listing for all files that have been open sourced. This
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Sprites, Classes"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -13968,19 +14522,24 @@ Follows is a source code listing for all files that have been open sourced. This
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Static Sprites, Classes"
+ 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| Star.new args.grid }
+ args.outputs.static_sprites << args.state.stars
end
# update
args.state.stars.each(&:move)
# render
- args.outputs.sprites << args.state.stars
args.outputs.background_color = [0, 0, 0]
args.outputs.primitives << args.gtk.current_framerate_primitives
end
@@ -14038,10 +14597,21 @@ Follows is a source code listing for all files that have been open sourced. This
# path,
# angle,
# alpha, red_saturation, green_saturation, blue_saturation
+ # tile_x, tile_y, tile_w, tile_h,
# flip_horizontally, flip_vertically,
- # tile_x, tile_y, tile_w, tile_h
# angle_anchor_x, angle_anchor_y,
# source_x, source_y, source_w, source_h
+
+ # The argument order for ffi_draw.draw_sprite_4 is:
+ # x, y, w, h,
+ # path,
+ # angle,
+ # alpha, red_saturation, green_saturation, blue_saturation
+ # tile_x, tile_y, tile_w, tile_h,
+ # flip_horizontally, flip_vertically,
+ # angle_anchor_x, angle_anchor_y,
+ # source_x, source_y, source_w, source_h,
+ # blendmode_enum
end
end
@@ -14049,6 +14619,11 @@ Follows is a source code listing for all files that have been open sourced. This
def tick args
# sets console command when sample app initially opens
if Kernel.global_tick_count == 0
+ puts ""
+ puts ""
+ puts "========================================================="
+ puts "* INFO: Static Sprites, Classes, Draw Override"
+ puts "* INFO: Please specify the number of sprites to render."
args.gtk.console.set_command "reset_with count: 100"
end
@@ -14219,6 +14794,55 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Debugging - Unit Tests - benchmark_api_tests.rb
+#+begin_src ruby
+ # ./samples/10_advanced_debugging/03_unit_tests/benchmark_api_tests.rb
+ def test_benchmark_api args, assert
+ result = args.gtk.benchmark iterations: 100,
+ only_one: -> () {
+ r = 0
+ (1..100).each do |i|
+ r += 1
+ end
+ }
+
+ assert.equal! result.first_place.name, :only_one
+
+ result = args.gtk.benchmark iterations: 100,
+ iterations_100: -> () {
+ r = 0
+ (1..100).each do |i|
+ r += 1
+ end
+ },
+ iterations_50: -> () {
+ r = 0
+ (1..50).each do |i|
+ r += 1
+ end
+ }
+
+ assert.equal! result.first_place.name, :iterations_50
+
+ result = args.gtk.benchmark iterations: 1,
+ iterations_100: -> () {
+ r = 0
+ (1..100).each do |i|
+ r += 1
+ end
+ },
+ iterations_50: -> () {
+ r = 0
+ (1..50).each do |i|
+ r += 1
+ end
+ }
+
+ assert.equal! result.too_small_to_measure, true
+ end
+
+#+end_src
+
*** Advanced Debugging - Unit Tests - exception_raising_tests.rb
#+begin_src ruby
# ./samples/10_advanced_debugging/03_unit_tests/exception_raising_tests.rb
@@ -14739,6 +15363,142 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Advanced Debugging - Unit Tests - pretty_format_tests.rb
+#+begin_src ruby
+ # ./samples/10_advanced_debugging/03_unit_tests/pretty_format_tests.rb
+ def H opts
+ opts
+ end
+
+ def A *opts
+ opts
+ end
+
+ def assert_format args, assert, hash, expected
+ actual = args.fn.pretty_format hash
+ assert.are_equal! actual, expected
+ end
+
+ def test_pretty_print args, assert
+ # =============================
+ # hash with single value
+ # =============================
+ input = (H first_name: "John")
+ expected = <<-S
+ {:first_name "John"}
+ S
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # hash with two values
+ # =============================
+ input = (H first_name: "John", last_name: "Smith")
+ expected = <<-S
+ {:first_name "John"
+ :last_name "Smith"}
+ S
+
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # hash with inner hash
+ # =============================
+ input = (H first_name: "John",
+ last_name: "Smith",
+ middle_initial: "I",
+ so: (H first_name: "Pocahontas",
+ last_name: "Tsenacommacah"),
+ friends: (A (H first_name: "Side", last_name: "Kick"),
+ (H first_name: "Tim", last_name: "Wizard")))
+ expected = <<-S
+ {:first_name "John"
+ :last_name "Smith"
+ :middle_initial "I"
+ :so {:first_name "Pocahontas"
+ :last_name "Tsenacommacah"}
+ :friends [{:first_name "Side"
+ :last_name "Kick"}
+ {:first_name "Tim"
+ :last_name "Wizard"}]}
+ S
+
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # array with one value
+ # =============================
+ input = (A 1)
+ expected = <<-S
+ [1]
+ S
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # array with multiple values
+ # =============================
+ input = (A 1, 2, 3)
+ expected = <<-S
+ [1
+ 2
+ 3]
+ S
+ (assert_format args, assert, input, expected)
+
+ # =============================
+ # array with multiple values hashes
+ # =============================
+ input = (A (H first_name: "Side", last_name: "Kick"),
+ (H first_name: "Tim", last_name: "Wizard"))
+ expected = <<-S
+ [{:first_name "Side"
+ :last_name "Kick"}
+ {:first_name "Tim"
+ :last_name "Wizard"}]
+ S
+
+ (assert_format args, assert, input, expected)
+ end
+
+ def test_nested_nested args, assert
+ # =============================
+ # nested array in nested hash
+ # =============================
+ input = (H type: :root,
+ text: "Root",
+ children: (A (H level: 1,
+ text: "Level 1",
+ children: (A (H level: 2,
+ text: "Level 2",
+ children: [])))))
+
+ expected = <<-S
+ {:type :root
+ :text "Root"
+ :children [{:level 1
+ :text "Level 1"
+ :children [{:level 2
+ :text "Level 2"
+ :children []}]}]}
+
+ S
+
+ (assert_format args, assert, input, expected)
+ end
+
+ def test_scene args, assert
+ script = <<-S
+ * Scene 1
+ ** Narrator
+ They say happy endings don't exist.
+ ** Narrator
+ They say true love is a lie.
+ S
+ input = parse_org args, script
+ puts (args.fn.pretty_format input)
+ end
+
+#+end_src
+
*** Advanced Debugging - Unit Tests - require_tests.rb
#+begin_src ruby
# ./samples/10_advanced_debugging/03_unit_tests/require_tests.rb
@@ -18624,13 +19384,13 @@ Follows is a source code listing for all files that have been open sourced. This
def tick
defaults
- render
- input
+ render
+ input
# If animation is playing, and max steps have not been reached
# Move the search a step forward
if state.play && state.current_step < state.max_steps
# Variable that tells the program what step to recalculate up to
- state.current_step += 1
+ state.current_step += 1
move_searches_one_step_forward
end
end
@@ -18652,7 +19412,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.
@@ -18677,7 +19437,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Unless the current step has a value
unless state.current_step
# Set the current step to 10
- state.current_step = 10
+ state.current_step = 10
# And calculate the searches up to step 10
recalculate_searches
end
@@ -18687,7 +19447,7 @@ 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 = grid.width * grid.height
+ state.max_steps = grid.width * grid.height
# Whether the animation should play or not
# If true, every tick moves anim_steps forward one
@@ -18780,7 +19540,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
@@ -18793,35 +19553,35 @@ Follows is a source code listing for all files that have been open sourced. This
if mouse_over_slider?
state.user_input = :slider
# If the mouse is over the star in the first grid
- elsif bfs_mouse_over_star?
+ elsif bfs_mouse_over_star?
# The user is editing the star from the first grid
- state.user_input = :bfs_star
+ state.user_input = :bfs_star
# If the mouse is over the star in the second grid
- elsif heuristic_mouse_over_star?
+ elsif heuristic_mouse_over_star?
# The user is editing the star from the second grid
- state.user_input = :heuristic_star
+ state.user_input = :heuristic_star
# If the mouse is over the target in the first grid
- elsif bfs_mouse_over_target?
+ elsif bfs_mouse_over_target?
# The user is editing the target from the first grid
- state.user_input = :bfs_target
+ state.user_input = :bfs_target
# If the mouse is over the target in the second grid
- elsif heuristic_mouse_over_target?
+ elsif heuristic_mouse_over_target?
# The user is editing the target from the second grid
- state.user_input = :heuristic_target
+ state.user_input = :heuristic_target
# If the mouse is over a wall in the first grid
- elsif bfs_mouse_over_wall?
+ elsif bfs_mouse_over_wall?
# The user is removing a wall from the first grid
- state.user_input = :bfs_remove_wall
+ state.user_input = :bfs_remove_wall
# If the mouse is over a wall in the second grid
- elsif heuristic_mouse_over_wall?
+ elsif heuristic_mouse_over_wall?
# The user is removing a wall from the second grid
state.user_input = :heuristic_remove_wall
# If the mouse is over the first grid
- elsif bfs_mouse_over_grid?
+ elsif bfs_mouse_over_grid?
# The user is adding a wall from the first grid
state.user_input = :bfs_add_wall
# If the mouse is over the second grid
- elsif heuristic_mouse_over_grid?
+ elsif heuristic_mouse_over_grid?
# The user is adding a wall from the second grid
state.user_input = :heuristic_add_wall
end
@@ -18831,22 +19591,22 @@ Follows is a source code listing for all files that have been open sourced. This
def process_input
if state.user_input == :slider
process_input_slider
- elsif state.user_input == :bfs_star
- process_input_bfs_star
+ elsif state.user_input == :bfs_star
+ process_input_bfs_star
elsif state.user_input == :heuristic_star
- process_input_heuristic_star
- elsif state.user_input == :bfs_target
- process_input_bfs_target
- elsif state.user_input == :heuristic_target
- process_input_heuristic_target
- elsif state.user_input == :bfs_remove_wall
- process_input_bfs_remove_wall
+ process_input_heuristic_star
+ elsif state.user_input == :bfs_target
+ process_input_bfs_target
+ elsif state.user_input == :heuristic_target
+ process_input_heuristic_target
+ elsif state.user_input == :bfs_remove_wall
+ process_input_bfs_remove_wall
elsif state.user_input == :heuristic_remove_wall
- process_input_heuristic_remove_wall
- elsif state.user_input == :bfs_add_wall
- process_input_bfs_add_wall
- elsif state.user_input == :heuristic_add_wall
- process_input_heuristic_add_wall
+ process_input_heuristic_remove_wall
+ elsif state.user_input == :bfs_add_wall
+ process_input_bfs_add_wall
+ elsif state.user_input == :heuristic_add_wall
+ process_input_heuristic_add_wall
end
end
@@ -18923,7 +19683,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 << bfs_horizontal_line(y)
+ outputs.lines << bfs_horizontal_line(y)
end
end
@@ -18938,10 +19698,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 << heuristic_horizontal_line(y)
+ outputs.lines << heuristic_horizontal_line(y)
end
end
-
+
# Returns a vertical line for a column of the first grid
def bfs_vertical_line column
bfs_scale_up([column, 0, column, grid.height])
@@ -18976,7 +19736,7 @@ Follows is a source code listing for all files that have been open sourced. This
def render_bfs_target
outputs.sprites << [bfs_scale_up(grid.target), 'target.png']
end
-
+
# Renders the target on the second grid
def render_heuristic_target
outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']
@@ -18984,14 +19744,14 @@ Follows is a source code listing for all files that have been open sourced. This
# Renders the walls on the first grid
def render_bfs_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [bfs_scale_up(wall), wall_color]
end
end
# Renders the walls on the second grid
def render_heuristic_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [heuristic_scale_up(wall), wall_color]
end
end
@@ -19012,14 +19772,14 @@ Follows is a source code listing for all files that have been open sourced. This
# Renders the frontier cells on the first grid
def render_bfs_frontier
- bfs.frontier.each do | frontier_cell |
+ bfs.frontier.each do | frontier_cell |
outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]
end
end
# Renders the frontier cells on the second grid
def render_heuristic_frontier
- heuristic.frontier.each do | frontier_cell |
+ heuristic.frontier.each do | frontier_cell |
outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]
end
end
@@ -19103,14 +19863,14 @@ Follows is a source code listing for all files that have been open sourced. This
# Checks and handles input for the buttons
# Called when the mouse is lifted
def input_buttons
- input_left_button
- input_center_button
- input_right_button
+ input_left_button
+ input_center_button
+ input_right_button
end
# Checks if the previous step button is clicked
# If it is, it pauses the animation and moves the search one step backward
- def input_left_button
+ def input_left_button
if left_button_clicked?
state.play = false
state.current_step -= 1
@@ -19122,7 +19882,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Inverses whether the animation is playing or not when clicked
def input_center_button
if center_button_clicked? || inputs.keyboard.key_down.space
- state.play = !state.play
+ state.play = !state.play
end
end
@@ -19130,8 +19890,8 @@ Follows is a source code listing for all files that have been open sourced. This
# If it is, it pauses the animation and moves the search one step forward
def input_right_button
if right_button_clicked?
- state.play = false
- state.current_step += 1
+ state.play = false
+ state.current_step += 1
move_searches_one_step_forward
end
end
@@ -19212,12 +19972,12 @@ Follows is a source code listing for all files that have been open sourced. This
# on the slider
# Changes the step of the search to be animated
def process_input_slider
- state.play = false
+ state.play = false
mouse_x = inputs.mouse.point.x
# Bounds the mouse_x to the closest x value on the slider line
- mouse_x = slider.x if mouse_x < slider.x
- mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w
+ mouse_x = slider.x if mouse_x < slider.x
+ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w
# Sets the current search step to the one represented by the mouse x value
# The slider's circle moves due to the render_slider method using anim_steps
@@ -19230,12 +19990,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_bfs_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless bfs_cell_closest_to_mouse == grid.target
- grid.star = bfs_cell_closest_to_mouse
+ grid.star = bfs_cell_closest_to_mouse
end
- unless old_star == grid.star
- recalculate_searches
+ unless old_star == grid.star
+ recalculate_searches
end
end
@@ -19243,12 +20003,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_heuristic_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless heuristic_cell_closest_to_mouse == grid.target
grid.star = heuristic_cell_closest_to_mouse
end
- unless old_star == grid.star
- recalculate_searches
+ unless old_star == grid.star
+ recalculate_searches
end
end
@@ -19256,12 +20016,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only recalculate_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_bfs_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless bfs_cell_closest_to_mouse == grid.star
grid.target = bfs_cell_closest_to_mouse
end
- unless old_target == grid.target
- recalculate_searches
+ unless old_target == grid.target
+ recalculate_searches
end
end
@@ -19269,12 +20029,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only recalculate_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_heuristic_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless heuristic_cell_closest_to_mouse == grid.star
grid.target = heuristic_cell_closest_to_mouse
end
- unless old_target == grid.target
- recalculate_searches
+ unless old_target == grid.target
+ recalculate_searches
end
end
@@ -19283,10 +20043,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 bfs_mouse_over_grid?
+ if bfs_mouse_over_grid?
if grid.walls.has_key?(bfs_cell_closest_to_mouse)
- grid.walls.delete(bfs_cell_closest_to_mouse)
- recalculate_searches
+ grid.walls.delete(bfs_cell_closest_to_mouse)
+ recalculate_searches
end
end
end
@@ -19296,29 +20056,29 @@ 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 heuristic_mouse_over_grid?
+ if heuristic_mouse_over_grid?
if grid.walls.has_key?(heuristic_cell_closest_to_mouse)
- grid.walls.delete(heuristic_cell_closest_to_mouse)
- recalculate_searches
+ grid.walls.delete(heuristic_cell_closest_to_mouse)
+ recalculate_searches
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def process_input_bfs_add_wall
- if bfs_mouse_over_grid?
+ if bfs_mouse_over_grid?
unless grid.walls.has_key?(bfs_cell_closest_to_mouse)
- grid.walls[bfs_cell_closest_to_mouse] = true
- recalculate_searches
+ grid.walls[bfs_cell_closest_to_mouse] = true
+ recalculate_searches
end
end
end
# Adds a wall in the second grid in the cell the mouse is over
def process_input_heuristic_add_wall
- if heuristic_mouse_over_grid?
+ if heuristic_mouse_over_grid?
unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)
- grid.walls[heuristic_cell_closest_to_mouse] = true
- recalculate_searches
+ grid.walls[heuristic_cell_closest_to_mouse] = true
+ recalculate_searches
end
end
end
@@ -19328,13 +20088,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 bfs_cell_closest_to_mouse
# Closest cell to the mouse in the first grid
- x = (inputs.mouse.point.x / grid.cell_size).to_i
- y = (inputs.mouse.point.y / grid.cell_size).to_i
+ x = (inputs.mouse.point.x / grid.cell_size).to_i
+ y = (inputs.mouse.point.y / grid.cell_size).to_i
# Bound x and y to the grid
- x = grid.width - 1 if x > grid.width - 1
- y = grid.height - 1 if y > grid.height - 1
+ x = grid.width - 1 if x > grid.width - 1
+ y = grid.height - 1 if y > grid.height - 1
# Return closest cell
- [x, y]
+ [x, y]
end
# When the user grabs the star and puts their cursor to the far right
@@ -19342,17 +20102,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 heuristic_cell_closest_to_mouse
# Closest cell grid to the mouse in the second
- x = (inputs.mouse.point.x / grid.cell_size).to_i
- y = (inputs.mouse.point.y / grid.cell_size).to_i
+ x = (inputs.mouse.point.x / grid.cell_size).to_i
+ y = (inputs.mouse.point.y / grid.cell_size).to_i
# Translate the cell to the first grid
x -= grid.width + 1
# Bound x and y to the first grid
x = 0 if x < 0
y = 0 if y < 0
- x = grid.width - 1 if x > grid.width - 1
- y = grid.height - 1 if y > grid.height - 1
+ x = grid.width - 1 if x > grid.width - 1
+ y = grid.height - 1 if y > grid.height - 1
# Return closest cell
- [x, y]
+ [x, y]
end
def recalculate_searches
@@ -19377,22 +20137,22 @@ Follows is a source code listing for all files that have been open sourced. This
return if bfs.came_from.has_key?(grid.target)
# Only runs at the beginning of the search as setup.
- if bfs.came_from.empty?
- bfs.frontier << grid.star
- bfs.came_from[grid.star] = nil
+ if bfs.came_from.empty?
+ bfs.frontier << grid.star
+ bfs.came_from[grid.star] = nil
end
# A step in the search
- unless bfs.frontier.empty?
+ unless bfs.frontier.empty?
# Takes the next frontier cell
- new_frontier = bfs.frontier.shift
+ new_frontier = bfs.frontier.shift
# For each of its neighbors
- adjacent_neighbors(new_frontier).each do |neighbor|
+ adjacent_neighbors(new_frontier).each do |neighbor|
# That have not been visited and are not walls
- unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- bfs.frontier << neighbor
- bfs.came_from[neighbor] = new_frontier
+ bfs.frontier << neighbor
+ bfs.came_from[neighbor] = new_frontier
end
end
end
@@ -19447,12 +20207,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Get the next cell to explore from
new_frontier = heuristic.frontier.shift
# For each of its neighbors
- adjacent_neighbors(new_frontier).each do |neighbor|
+ adjacent_neighbors(new_frontier).each do |neighbor|
# That have not been visited and are not walls
- unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- heuristic.frontier << neighbor
- heuristic.came_from[neighbor] = new_frontier
+ heuristic.frontier << neighbor
+ heuristic.came_from[neighbor] = new_frontier
end
end
end
@@ -19496,16 +20256,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
@@ -19554,7 +20314,7 @@ 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
@@ -19562,7 +20322,7 @@ Follows is a source code listing for all files that have been open sourced. This
def frontier_color
[103, 136, 204] # Blue
end
-
+
def path_color
[231, 230, 228] # Pastel White
end
@@ -19610,13 +20370,13 @@ Follows is a source code listing for all files that have been open sourced. This
def tick
defaults
- render
- input
+ render
+ input
# If animation is playing, and max steps have not been reached
# Move the search a step forward
if state.play && state.current_step < state.max_steps
# Variable that tells the program what step to recalculate up to
- state.current_step += 1
+ state.current_step += 1
move_searches_one_step_forward
end
end
@@ -19671,7 +20431,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.
@@ -19696,7 +20456,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Unless the current step has a value
unless state.current_step
# Set the current step to 10
- state.current_step = 10
+ state.current_step = 10
# And calculate the searches up to step 10
recalculate_searches
end
@@ -19706,7 +20466,7 @@ 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 = grid.width * grid.height
+ state.max_steps = grid.width * grid.height
# Whether the animation should play or not
# If true, every tick moves anim_steps forward one
@@ -19799,7 +20559,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
@@ -19812,35 +20572,35 @@ Follows is a source code listing for all files that have been open sourced. This
if mouse_over_slider?
state.user_input = :slider
# If the mouse is over the star in the first grid
- elsif bfs_mouse_over_star?
+ elsif bfs_mouse_over_star?
# The user is editing the star from the first grid
- state.user_input = :bfs_star
+ state.user_input = :bfs_star
# If the mouse is over the star in the second grid
- elsif heuristic_mouse_over_star?
+ elsif heuristic_mouse_over_star?
# The user is editing the star from the second grid
- state.user_input = :heuristic_star
+ state.user_input = :heuristic_star
# If the mouse is over the target in the first grid
- elsif bfs_mouse_over_target?
+ elsif bfs_mouse_over_target?
# The user is editing the target from the first grid
- state.user_input = :bfs_target
+ state.user_input = :bfs_target
# If the mouse is over the target in the second grid
- elsif heuristic_mouse_over_target?
+ elsif heuristic_mouse_over_target?
# The user is editing the target from the second grid
- state.user_input = :heuristic_target
+ state.user_input = :heuristic_target
# If the mouse is over a wall in the first grid
- elsif bfs_mouse_over_wall?
+ elsif bfs_mouse_over_wall?
# The user is removing a wall from the first grid
- state.user_input = :bfs_remove_wall
+ state.user_input = :bfs_remove_wall
# If the mouse is over a wall in the second grid
- elsif heuristic_mouse_over_wall?
+ elsif heuristic_mouse_over_wall?
# The user is removing a wall from the second grid
state.user_input = :heuristic_remove_wall
# If the mouse is over the first grid
- elsif bfs_mouse_over_grid?
+ elsif bfs_mouse_over_grid?
# The user is adding a wall from the first grid
state.user_input = :bfs_add_wall
# If the mouse is over the second grid
- elsif heuristic_mouse_over_grid?
+ elsif heuristic_mouse_over_grid?
# The user is adding a wall from the second grid
state.user_input = :heuristic_add_wall
end
@@ -19850,22 +20610,22 @@ Follows is a source code listing for all files that have been open sourced. This
def process_input
if state.user_input == :slider
process_input_slider
- elsif state.user_input == :bfs_star
- process_input_bfs_star
+ elsif state.user_input == :bfs_star
+ process_input_bfs_star
elsif state.user_input == :heuristic_star
- process_input_heuristic_star
- elsif state.user_input == :bfs_target
- process_input_bfs_target
- elsif state.user_input == :heuristic_target
- process_input_heuristic_target
- elsif state.user_input == :bfs_remove_wall
- process_input_bfs_remove_wall
+ process_input_heuristic_star
+ elsif state.user_input == :bfs_target
+ process_input_bfs_target
+ elsif state.user_input == :heuristic_target
+ process_input_heuristic_target
+ elsif state.user_input == :bfs_remove_wall
+ process_input_bfs_remove_wall
elsif state.user_input == :heuristic_remove_wall
- process_input_heuristic_remove_wall
- elsif state.user_input == :bfs_add_wall
- process_input_bfs_add_wall
- elsif state.user_input == :heuristic_add_wall
- process_input_heuristic_add_wall
+ process_input_heuristic_remove_wall
+ elsif state.user_input == :bfs_add_wall
+ process_input_bfs_add_wall
+ elsif state.user_input == :heuristic_add_wall
+ process_input_heuristic_add_wall
end
end
@@ -19942,7 +20702,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 << bfs_horizontal_line(y)
+ outputs.lines << bfs_horizontal_line(y)
end
end
@@ -19957,10 +20717,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 << heuristic_horizontal_line(y)
+ outputs.lines << heuristic_horizontal_line(y)
end
end
-
+
# Returns a vertical line for a column of the first grid
def bfs_vertical_line column
bfs_scale_up([column, 0, column, grid.height])
@@ -19995,7 +20755,7 @@ Follows is a source code listing for all files that have been open sourced. This
def render_bfs_target
outputs.sprites << [bfs_scale_up(grid.target), 'target.png']
end
-
+
# Renders the target on the second grid
def render_heuristic_target
outputs.sprites << [heuristic_scale_up(grid.target), 'target.png']
@@ -20003,14 +20763,14 @@ Follows is a source code listing for all files that have been open sourced. This
# Renders the walls on the first grid
def render_bfs_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [bfs_scale_up(wall), wall_color]
end
end
# Renders the walls on the second grid
def render_heuristic_walls
- grid.walls.each_key do | wall |
+ grid.walls.each_key do | wall |
outputs.solids << [heuristic_scale_up(wall), wall_color]
end
end
@@ -20031,14 +20791,14 @@ Follows is a source code listing for all files that have been open sourced. This
# Renders the frontier cells on the first grid
def render_bfs_frontier
- bfs.frontier.each do | frontier_cell |
+ bfs.frontier.each do | frontier_cell |
outputs.solids << [bfs_scale_up(frontier_cell), frontier_color, 200]
end
end
# Renders the frontier cells on the second grid
def render_heuristic_frontier
- heuristic.frontier.each do | frontier_cell |
+ heuristic.frontier.each do | frontier_cell |
outputs.solids << [heuristic_scale_up(frontier_cell), frontier_color, 200]
end
end
@@ -20122,14 +20882,14 @@ Follows is a source code listing for all files that have been open sourced. This
# Checks and handles input for the buttons
# Called when the mouse is lifted
def input_buttons
- input_left_button
- input_center_button
- input_right_button
+ input_left_button
+ input_center_button
+ input_right_button
end
# Checks if the previous step button is clicked
# If it is, it pauses the animation and moves the search one step backward
- def input_left_button
+ def input_left_button
if left_button_clicked?
state.play = false
state.current_step -= 1
@@ -20141,7 +20901,7 @@ Follows is a source code listing for all files that have been open sourced. This
# Inverses whether the animation is playing or not when clicked
def input_center_button
if center_button_clicked? || inputs.keyboard.key_down.space
- state.play = !state.play
+ state.play = !state.play
end
end
@@ -20149,8 +20909,8 @@ Follows is a source code listing for all files that have been open sourced. This
# If it is, it pauses the animation and moves the search one step forward
def input_right_button
if right_button_clicked?
- state.play = false
- state.current_step += 1
+ state.play = false
+ state.current_step += 1
move_searches_one_step_forward
end
end
@@ -20231,12 +20991,12 @@ Follows is a source code listing for all files that have been open sourced. This
# on the slider
# Changes the step of the search to be animated
def process_input_slider
- state.play = false
+ state.play = false
mouse_x = inputs.mouse.point.x
# Bounds the mouse_x to the closest x value on the slider line
- mouse_x = slider.x if mouse_x < slider.x
- mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w
+ mouse_x = slider.x if mouse_x < slider.x
+ mouse_x = slider.x + slider.w if mouse_x > slider.x + slider.w
# Sets the current search step to the one represented by the mouse x value
# The slider's circle moves due to the render_slider method using anim_steps
@@ -20249,12 +21009,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_bfs_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless bfs_cell_closest_to_mouse == grid.target
- grid.star = bfs_cell_closest_to_mouse
+ grid.star = bfs_cell_closest_to_mouse
end
- unless old_star == grid.star
- recalculate_searches
+ unless old_star == grid.star
+ recalculate_searches
end
end
@@ -20262,12 +21022,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_heuristic_star
- old_star = grid.star.clone
+ old_star = grid.star.clone
unless heuristic_cell_closest_to_mouse == grid.target
grid.star = heuristic_cell_closest_to_mouse
end
- unless old_star == grid.star
- recalculate_searches
+ unless old_star == grid.star
+ recalculate_searches
end
end
@@ -20275,12 +21035,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only recalculate_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_bfs_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless bfs_cell_closest_to_mouse == grid.star
grid.target = bfs_cell_closest_to_mouse
end
- unless old_target == grid.target
- recalculate_searches
+ unless old_target == grid.target
+ recalculate_searches
end
end
@@ -20288,12 +21048,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Only recalculate_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
def process_input_heuristic_target
- old_target = grid.target.clone
+ old_target = grid.target.clone
unless heuristic_cell_closest_to_mouse == grid.star
grid.target = heuristic_cell_closest_to_mouse
end
- unless old_target == grid.target
- recalculate_searches
+ unless old_target == grid.target
+ recalculate_searches
end
end
@@ -20302,10 +21062,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 bfs_mouse_over_grid?
+ if bfs_mouse_over_grid?
if grid.walls.has_key?(bfs_cell_closest_to_mouse)
- grid.walls.delete(bfs_cell_closest_to_mouse)
- recalculate_searches
+ grid.walls.delete(bfs_cell_closest_to_mouse)
+ recalculate_searches
end
end
end
@@ -20315,29 +21075,29 @@ 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 heuristic_mouse_over_grid?
+ if heuristic_mouse_over_grid?
if grid.walls.has_key?(heuristic_cell_closest_to_mouse)
- grid.walls.delete(heuristic_cell_closest_to_mouse)
- recalculate_searches
+ grid.walls.delete(heuristic_cell_closest_to_mouse)
+ recalculate_searches
end
end
end
# Adds a wall in the first grid in the cell the mouse is over
def process_input_bfs_add_wall
- if bfs_mouse_over_grid?
+ if bfs_mouse_over_grid?
unless grid.walls.has_key?(bfs_cell_closest_to_mouse)
- grid.walls[bfs_cell_closest_to_mouse] = true
- recalculate_searches
+ grid.walls[bfs_cell_closest_to_mouse] = true
+ recalculate_searches
end
end
end
# Adds a wall in the second grid in the cell the mouse is over
def process_input_heuristic_add_wall
- if heuristic_mouse_over_grid?
+ if heuristic_mouse_over_grid?
unless grid.walls.has_key?(heuristic_cell_closest_to_mouse)
- grid.walls[heuristic_cell_closest_to_mouse] = true
- recalculate_searches
+ grid.walls[heuristic_cell_closest_to_mouse] = true
+ recalculate_searches
end
end
end
@@ -20347,13 +21107,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 bfs_cell_closest_to_mouse
# Closest cell to the mouse in the first grid
- x = (inputs.mouse.point.x / grid.cell_size).to_i
- y = (inputs.mouse.point.y / grid.cell_size).to_i
+ x = (inputs.mouse.point.x / grid.cell_size).to_i
+ y = (inputs.mouse.point.y / grid.cell_size).to_i
# Bound x and y to the grid
- x = grid.width - 1 if x > grid.width - 1
- y = grid.height - 1 if y > grid.height - 1
+ x = grid.width - 1 if x > grid.width - 1
+ y = grid.height - 1 if y > grid.height - 1
# Return closest cell
- [x, y]
+ [x, y]
end
# When the user grabs the star and puts their cursor to the far right
@@ -20361,17 +21121,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 heuristic_cell_closest_to_mouse
# Closest cell grid to the mouse in the second
- x = (inputs.mouse.point.x / grid.cell_size).to_i
- y = (inputs.mouse.point.y / grid.cell_size).to_i
+ x = (inputs.mouse.point.x / grid.cell_size).to_i
+ y = (inputs.mouse.point.y / grid.cell_size).to_i
# Translate the cell to the first grid
x -= grid.width + 1
# Bound x and y to the first grid
x = 0 if x < 0
y = 0 if y < 0
- x = grid.width - 1 if x > grid.width - 1
- y = grid.height - 1 if y > grid.height - 1
+ x = grid.width - 1 if x > grid.width - 1
+ y = grid.height - 1 if y > grid.height - 1
# Return closest cell
- [x, y]
+ [x, y]
end
def recalculate_searches
@@ -20396,22 +21156,22 @@ Follows is a source code listing for all files that have been open sourced. This
return if bfs.came_from.has_key?(grid.target)
# Only runs at the beginning of the search as setup.
- if bfs.came_from.empty?
- bfs.frontier << grid.star
- bfs.came_from[grid.star] = nil
+ if bfs.came_from.empty?
+ bfs.frontier << grid.star
+ bfs.came_from[grid.star] = nil
end
# A step in the search
- unless bfs.frontier.empty?
+ unless bfs.frontier.empty?
# Takes the next frontier cell
- new_frontier = bfs.frontier.shift
+ new_frontier = bfs.frontier.shift
# For each of its neighbors
- adjacent_neighbors(new_frontier).each do |neighbor|
+ adjacent_neighbors(new_frontier).each do |neighbor|
# That have not been visited and are not walls
- unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless bfs.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- bfs.frontier << neighbor
- bfs.came_from[neighbor] = new_frontier
+ bfs.frontier << neighbor
+ bfs.came_from[neighbor] = new_frontier
end
end
end
@@ -20466,12 +21226,12 @@ Follows is a source code listing for all files that have been open sourced. This
# Get the next cell to explore from
new_frontier = heuristic.frontier.shift
# For each of its neighbors
- adjacent_neighbors(new_frontier).each do |neighbor|
+ adjacent_neighbors(new_frontier).each do |neighbor|
# That have not been visited and are not walls
- unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
+ unless heuristic.came_from.has_key?(neighbor) || grid.walls.has_key?(neighbor)
# Add them to the frontier and mark them as visited
- heuristic.frontier << neighbor
- heuristic.came_from[neighbor] = new_frontier
+ heuristic.frontier << neighbor
+ heuristic.came_from[neighbor] = new_frontier
end
end
end
@@ -20515,16 +21275,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
@@ -20573,7 +21333,7 @@ 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
@@ -20581,7 +21341,7 @@ Follows is a source code listing for all files that have been open sourced. This
def frontier_color
[103, 136, 204] # Blue
end
-
+
def path_color
[231, 230, 228] # Pastel White
end
@@ -24345,6 +25105,444 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Crafting - Farming Game Starting Point - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_crafting/farming_game_starting_point/app/main.rb
+ def tick args
+ args.state.tile_size = 80
+ args.state.player_speed = 4
+ args.state.player ||= tile(args, 7, 3, 0, 128, 180)
+ generate_map args
+ #press j to plant a green onion
+ if args.inputs.keyboard.j
+ #change this part you can change what you want to plant
+ args.state.walls << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y)/args.state.tile_size), 255, 255, 255)
+ args.state.plants << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y+80)/args.state.tile_size), 0, 160, 0)
+ end
+ # Adds walls, background, and player to args.outputs.solids so they appear on screen
+ args.outputs.solids << [0,0,1280,720, 237,189,101]
+ args.outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']
+ args.outputs.solids << args.state.walls
+ args.outputs.solids << args.state.player
+ args.outputs.solids << args.state.plants
+ args.outputs.labels << [320, 640, "press J to plant", 3, 1, 255, 0, 0, 200]
+
+ move_player args, -1, 0 if args.inputs.keyboard.left # x position decreases by 1 if left key is pressed
+ move_player args, 1, 0 if args.inputs.keyboard.right # x position increases by 1 if right key is pressed
+ move_player args, 0, 1 if args.inputs.keyboard.up # y position increases by 1 if up is pressed
+ move_player args, 0, -1 if args.inputs.keyboard.down # y position decreases by 1 if down is pressed
+ end
+
+ # Sets position, size, and color of the tile
+ def tile args, x, y, *color
+ [x * args.state.tile_size, # sets definition for array using method parameters
+ y * args.state.tile_size, # multiplying by tile_size sets x and y to correct position using pixel values
+ args.state.tile_size,
+ args.state.tile_size,
+ *color]
+ end
+
+ # Creates map by adding tiles to the wall, as well as a goal (that the player needs to reach)
+ def generate_map args
+ return if args.state.area
+
+ # Creates the area of the map. There are 9 rows running horizontally across the screen
+ # and 16 columns running vertically on the screen. Any spot with a "1" is not
+ # open for the player to move into (and is green), and any spot with a "0" is available
+ # for the player to move in.
+ args.state.area = [
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],
+ ].reverse # reverses the order of the area collection
+
+ # By reversing the order, the way that the area appears above is how it appears
+ # on the screen in the game. If we did not reverse, the map would appear inverted.
+
+ #The wall starts off with no tiles.
+ args.state.walls = []
+ args.state.plants = []
+
+ # If v is 1, a green tile is added to args.state.walls.
+ # If v is 2, a black tile is created as the goal.
+ args.state.area.map_2d do |y, x, v|
+ if v == 1
+ args.state.walls << tile(args, x, y, 255, 160, 156) # green tile
+ end
+ end
+ end
+
+ # Allows the player to move their box around the screen
+ def move_player args, *vector
+ box = args.state.player.shift_rect(vector) # box is able to move at an angle
+
+ # If the player's box hits a wall, it is not able to move further in that direction
+ return if args.state.walls
+ .any_intersect_rect?(box)
+
+ # Player's box is able to move at angles (not just the four general directions) fast
+ args.state.player =
+ args.state.player
+ .shift_rect(vector.x * args.state.player_speed, # if we don't multiply by speed, then
+ vector.y * args.state.player_speed) # the box will move extremely slow
+ end
+
+#+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
+ # For advanced users:
+ # You can put some quick verification tests here, any method
+ # that starts with the `test_` will be run when you save this file.
+
+ # Here is an example test and game
+
+ # To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick
+
+ class MySuperHappyFunGame
+ attr_gtk
+
+ def tick
+ outputs.solids << [100, 100, 300, 300]
+ end
+ end
+
+ def test_universe args, assert
+ game = MySuperHappyFunGame.new
+ game.args = args
+ game.tick
+ assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick"
+ assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending"
+ puts "test_universe completed successfully"
+ end
+
+ puts "running tests"
+ $gtk.reset 100
+ $gtk.log_level = :off
+ $gtk.tests.start
+
+#+end_src
+
*** Dev Tools - Add Buttons To Console - main.rb
#+begin_src ruby
# ./samples/99_genre_dev_tools/add_buttons_to_console/app/main.rb
@@ -24515,12 +25713,12 @@ Follows is a source code listing for all files that have been open sourced. This
label = { x: b.x + state.buttons_frame_selection.size.half,
y: b.y,
text: "#{i + 1}", r: 180, g: 180, b: 180,
- size_enum: -4, alignment_enum: 1 }.label
+ size_enum: -4, alignment_enum: 1 }.label!
- selection_border = b.merge(r: 40, g: 40, b: 40).border
+ selection_border = b.merge(r: 40, g: 40, b: 40).border!
if i == state.animation_frames_selected_index
- selection_border = b.merge(r: 40, g: 230, b: 200).border
+ selection_border = b.merge(r: 40, g: 230, b: 200).border!
end
[selection_border, label]
@@ -25257,6 +26455,528 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** Dungeon Crawl - Classics Jam - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_dungeon_crawl/classics_jam/app/main.rb
+ class Game
+ attr_gtk
+
+ def tick
+ defaults
+ render
+ input
+ calc
+ end
+
+ def defaults
+ player.x ||= 640
+ player.y ||= 360
+ player.w ||= 16
+ player.h ||= 16
+ player.attacked_at ||= -1
+ player.angle ||= 0
+ player.future_player ||= future_player_position 0, 0
+ player.projectiles ||= []
+ player.damage ||= 0
+ state.level ||= create_level level_one_template
+ end
+
+ def render
+ outputs.sprites << level.walls.map do |w|
+ w.merge(path: 'sprites/square/gray.png')
+ end
+
+ outputs.sprites << level.spawn_locations.map do |s|
+ s.merge(path: 'sprites/square/blue.png')
+ end
+
+ outputs.sprites << player.projectiles.map do |p|
+ p.merge(path: 'sprites/square/blue.png')
+ end
+
+ outputs.sprites << level.enemies.map do |e|
+ e.merge(path: 'sprites/square/red.png')
+ end
+
+ outputs.sprites << player.merge(path: 'sprites/circle/green.png', angle: player.angle)
+
+ outputs.labels << { x: 30, y: 30.from_top, text: "damage: #{player.damage || 0}" }
+ end
+
+ def input
+ player.angle = inputs.directional_angle || player.angle
+ if inputs.controller_one.key_down.a || inputs.keyboard.key_down.space
+ player.attacked_at = state.tick_count
+ end
+ end
+
+ def calc
+ calc_player
+ calc_projectiles
+ calc_enemies
+ calc_spawn_locations
+ end
+
+ def calc_player
+ if player.attacked_at == state.tick_count
+ player.projectiles << { at: state.tick_count,
+ x: player.x,
+ y: player.y,
+ angle: player.angle,
+ w: 4,
+ h: 4 }.center_inside_rect(player)
+ end
+
+ if player.attacked_at.elapsed_time > 5
+ future_player = future_player_position inputs.left_right * 2, inputs.up_down * 2
+ future_player_collision = future_collision player, future_player, level.walls
+ player.x = future_player_collision.x if !future_player_collision.dx_collision
+ player.y = future_player_collision.y if !future_player_collision.dy_collision
+ end
+ end
+
+ def calc_projectile_collisions entities
+ entities.each do |e|
+ e.damage ||= 0
+ player.projectiles.each do |p|
+ if !p.collided && (p.intersect_rect? e)
+ p.collided = true
+ e.damage += 1
+ end
+ end
+ end
+ end
+
+ def calc_projectiles
+ player.projectiles.map! do |p|
+ dx, dy = p.angle.vector 10
+ p.merge(x: p.x + dx, y: p.y + dy)
+ end
+
+ calc_projectile_collisions level.walls + level.enemies + level.spawn_locations
+ player.projectiles.reject! { |p| p.at.elapsed_time > 10000 }
+ player.projectiles.reject! { |p| p.collided }
+ level.enemies.reject! { |e| e.damage > e.hp }
+ level.spawn_locations.reject! { |s| s.damage > s.hp }
+ end
+
+ def calc_enemies
+ level.enemies.map! do |e|
+ dx = 0
+ dx = 1 if e.x < player.x
+ dx = -1 if e.x > player.x
+ dy = 0
+ dy = 1 if e.y < player.y
+ dy = -1 if e.y > player.y
+ future_e = future_entity_position dx, dy, e
+ future_e_collision = future_collision e, future_e, level.enemies + level.walls
+ e.next_x = e.x
+ e.next_y = e.y
+ e.next_x = future_e_collision.x if !future_e_collision.dx_collision
+ e.next_y = future_e_collision.y if !future_e_collision.dy_collision
+ e
+ end
+
+ level.enemies.map! do |e|
+ e.x = e.next_x
+ e.y = e.next_y
+ e
+ end
+
+ level.enemies.each do |e|
+ player.damage += 1 if e.intersect_rect? player
+ end
+ end
+
+ def calc_spawn_locations
+ level.spawn_locations.map! do |s|
+ s.merge(countdown: s.countdown - 1)
+ end
+ level.spawn_locations
+ .find_all { |s| s.countdown.neg? }
+ .each do |s|
+ s.countdown = s.rate
+ s.merge(countdown: s.rate)
+ new_enemy = create_enemy s
+ if !(level.enemies.find { |e| e.intersect_rect? new_enemy })
+ level.enemies << new_enemy
+ end
+ end
+ end
+
+ def create_enemy spawn_location
+ to_cell(spawn_location.ordinal_x, spawn_location.ordinal_y).merge hp: 2
+ end
+
+ def create_level level_template
+ {
+ walls: level_template.walls.map { |w| to_cell(w.ordinal_x, w.ordinal_y).merge(w) },
+ enemies: [],
+ spawn_locations: level_template.spawn_locations.map { |s| to_cell(s.ordinal_x, s.ordinal_y).merge(s) }
+ }
+ end
+
+ def level_one_template
+ {
+ walls: [{ ordinal_x: 25, ordinal_y: 20},
+ { ordinal_x: 25, ordinal_y: 21},
+ { ordinal_x: 25, ordinal_y: 22},
+ { ordinal_x: 25, ordinal_y: 23}],
+ spawn_locations: [{ ordinal_x: 10, ordinal_y: 10, rate: 120, countdown: 0, hp: 5 }]
+ }
+ end
+
+ def player
+ state.player ||= {}
+ end
+
+ def level
+ state.level ||= {}
+ end
+
+ def future_collision entity, future_entity, others
+ dx_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dx) }
+ dy_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dy) }
+
+ {
+ dx_collision: dx_collision,
+ x: future_entity.dx.x,
+ dy_collision: dy_collision,
+ y: future_entity.dy.y
+ }
+ end
+
+ def future_entity_position dx, dy, entity
+ {
+ dx: entity.merge(x: entity.x + dx),
+ dy: entity.merge(y: entity.y + dy),
+ both: entity.merge(x: entity.x + dx, y: entity.y + dy)
+ }
+ end
+
+ def future_player_position dx, dy
+ future_entity_position dx, dy, player
+ end
+
+ def to_cell ordinal_x, ordinal_y
+ { x: ordinal_x * 16, y: ordinal_y * 16, w: 16, h: 16 }
+ end
+ end
+
+ def tick args
+ $game ||= Game.new
+ $game.args = args
+ $game.tick
+ end
+
+ $gtk.reset
+ $game = nil
+
+#+end_src
+
+*** Fighting - Special Move Inputs - main.rb
+#+begin_src ruby
+ # ./samples/99_genre_fighting/01_special_move_inputs/app/main.rb
+ def tick args
+ #tick_instructions args, "Use LEFT and RIGHT arrow keys to move and SPACE to jump."
+ defaults args
+ render args
+ input args
+ calc args
+ end
+
+ # sets default values and creates empty collections
+ # initialization only happens in the first frame
+ def defaults args
+ fiddle args
+
+ args.state.tick_count = args.state.tick_count
+ args.state.bridge_top = 128
+ args.state.player.x ||= 0 # initializes player's properties
+ args.state.player.y ||= args.state.bridge_top
+ args.state.player.w ||= 64
+ args.state.player.h ||= 64
+ args.state.player.dy ||= 0
+ args.state.player.dx ||= 0
+ args.state.player.r ||= 0
+ args.state.game_over_at ||= 0
+ args.state.animation_time ||=0
+
+ args.state.timeleft ||=0
+ args.state.timeright ||=0
+ args.state.lastpush ||=0
+
+ args.state.inputlist ||= ["j","k","l"]
+ end
+
+ # sets enemy, player, hammer values
+ def fiddle args
+ args.state.gravity = -0.5
+ args.state.player_jump_power = 10 # sets player values
+ args.state.player_jump_power_duration = 5
+ args.state.player_max_run_speed = 20
+ args.state.player_speed_slowdown_rate = 0.9
+ args.state.player_acceleration = 0.9
+ end
+
+ # outputs objects onto the screen
+ def render args
+ if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)
+ args.state.player.dx = 0
+ end
+
+ #move list
+ (args.layout.rect_group row: 0, col_from_right: 8, drow: 0.3,
+ merge: { vertical_alignment_enum: 0, size_enum: -2 },
+ group: [
+ { text: "move: WASD" },
+ { text: "jump: Space" },
+ { text: "attack forwards: J (while on ground" },
+ { text: "attack upwards: K (while on groud)" },
+ { text: "attack backwards: J (while on ground and holding A)" },
+ { text: "attack downwards: K (while in air)" },
+ { text: "dash attack: J, K in quick succession." },
+ { text: "shield: hold J, K at the same time." },
+ { text: "dash backwards: A, A in quick succession." },
+ ]).into args.outputs.labels
+
+ # registered moves
+ args.outputs.labels << { x: 0.to_layout_col,
+ y: 0.to_layout_row,
+ text: "input history",
+ size_enum: -2,
+ vertical_alignment_enum: 0 }
+
+ (args.state.inputlist.take(5)).map do |s|
+ { text: s, size_enum: -2, vertical_alignment_enum: 0 }
+ end.yield_self do |group|
+ (args.layout.rect_group row: 0.3, col: 0, drow: 0.3, group: group).into args.outputs.labels
+ end
+
+
+ #sprites
+ player = [args.state.player.x, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/square/white.png",
+ args.state.player.r]
+
+ playershield = [args.state.player.x - 20, args.state.player.y - 10,
+ args.state.player.w + 20, args.state.player.h + 20,
+ "sprites/square/blue.png",
+ args.state.player.r,
+ 0]
+
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png",
+ args.state.player.r,
+ 0]
+
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png",
+ args.state.player.r+90,
+ 0]
+
+ if ((args.state.tick_count - args.state.lastpush) <= 15)
+ if (args.state.inputlist[0] == "<<")
+ player = [args.state.player.x, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/square/yellow.png", args.state.player.r]
+ end
+
+ if (args.state.inputlist[0] == "shield")
+ player = [args.state.player.x, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/square/indigo.png", args.state.player.r]
+
+ playershield = [args.state.player.x - 10, args.state.player.y - 10,
+ args.state.player.w + 20, args.state.player.h + 20,
+ "sprites/square/blue.png", args.state.player.r, 50]
+ end
+
+ if (args.state.inputlist[0] == "back-attack")
+ playerjab = [args.state.player.x - 20, args.state.player.y,
+ args.state.player.w - 10, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r, 255]
+ end
+
+ if (args.state.inputlist[0] == "forward-attack")
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r, 255]
+ end
+
+ if (args.state.inputlist[0] == "up-attack")
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]
+ end
+
+ if (args.state.inputlist[0] == "dair")
+ playerupper = [args.state.player.x, args.state.player.y - 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]
+ end
+
+ if (args.state.inputlist[0] == "dash-attack")
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/violet.png", args.state.player.r + 90, 255]
+
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+ args.state.player.w, args.state.player.h,
+ "sprites/isometric/violet.png", args.state.player.r, 255]
+ end
+ end
+
+ args.outputs.sprites << playerjab
+ args.outputs.sprites << playerupper
+ args.outputs.sprites << player
+ args.outputs.sprites << playershield
+
+ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge
+ [i * 64, args.state.bridge_top - 64, 64, 64]
+ end
+ end
+
+ # Performs calculations to move objects on the screen
+ def calc args
+ # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.
+ args.state.player.x += args.state.player.dx
+ args.state.player.y += args.state.player.dy
+
+ # Since acceleration is the change in velocity, the change in y (dy) increases every frame
+ args.state.player.dy += args.state.gravity
+
+ # player's y position is either current y position or y position of top of
+ # bridge, whichever has a greater value
+ # ensures that the player never goes below the bridge
+ args.state.player.y = args.state.player.y.greater(args.state.bridge_top)
+
+ # player's x position is either the current x position or 0, whichever has a greater value
+ # ensures that the player doesn't go too far left (out of the screen's scope)
+ args.state.player.x = args.state.player.x.greater(0)
+
+ # player is not falling if it is located on the top of the bridge
+ args.state.player.falling = false if args.state.player.y == args.state.bridge_top
+ #args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player
+ end
+
+ # Resets the player by changing its properties back to the values they had at initialization
+ def reset_player args
+ args.state.player.x = 0
+ args.state.player.y = args.state.bridge_top
+ args.state.player.dy = 0
+ args.state.player.dx = 0
+ args.state.enemy.hammers.clear # empties hammer collection
+ args.state.enemy.hammer_queue.clear # empties hammer_queue
+ args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)
+ end
+
+ # Processes input from the user to move the player
+ def input args
+ if args.state.inputlist.length > 5
+ args.state.inputlist.pop
+ end
+
+ should_process_special_move = (args.inputs.keyboard.key_down.j) ||
+ (args.inputs.keyboard.key_down.k) ||
+ (args.inputs.keyboard.key_down.a) ||
+ (args.inputs.keyboard.key_down.d) ||
+ (args.inputs.controller_one.key_down.y) ||
+ (args.inputs.controller_one.key_down.x) ||
+ (args.inputs.controller_one.key_down.left) ||
+ (args.inputs.controller_one.key_down.right)
+
+ if (should_process_special_move)
+ if (args.inputs.keyboard.key_down.j && args.inputs.keyboard.key_down.k) ||
+ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.y)
+ args.state.inputlist.unshift("shield")
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&
+ (args.state.inputlist[0] == "forward-attack") && ((args.state.tick_count - args.state.lastpush) <= 15)
+ args.state.inputlist.unshift("dash-attack")
+ args.state.player.dx = 20
+ elsif (args.inputs.keyboard.key_down.j && args.inputs.keyboard.a) ||
+ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.left)
+ args.state.inputlist.unshift("back-attack")
+ elsif ( args.inputs.controller_one.key_down.x || args.inputs.keyboard.key_down.j)
+ args.state.inputlist.unshift("forward-attack")
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&
+ (args.state.player.y > 128)
+ args.state.inputlist.unshift("dair")
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y)
+ args.state.inputlist.unshift("up-attack")
+ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a) &&
+ (args.state.inputlist[0] == "<") &&
+ ((args.state.tick_count - args.state.lastpush) <= 10)
+ args.state.inputlist.unshift("<<")
+ args.state.player.dx = -15
+ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a)
+ args.state.inputlist.unshift("<")
+ args.state.timeleft = args.state.tick_count
+ elsif (args.inputs.controller_one.key_down.right || args.inputs.keyboard.key_down.d)
+ args.state.inputlist.unshift(">")
+ end
+
+ args.state.lastpush = args.state.tick_count
+ end
+
+ if args.inputs.keyboard.space || args.inputs.controller_one.r2 # if the user presses the space bar
+ args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame
+
+ # if the time that has passed since the jump is less than the player's jump duration and
+ # the player is not falling
+ if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling
+ args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump
+ end
+ end
+
+ # if the space bar is in the "up" state (or not being pressed down)
+ if args.inputs.keyboard.key_up.space || args.inputs.controller_one.key_up.r2
+ args.state.player.jumped_at = nil # jumped_at is empty
+ args.state.player.falling = true # the player is falling
+ end
+
+ if args.inputs.left # if left key is pressed
+ if args.state.player.dx < -5
+ args.state.player.dx = args.state.player.dx
+ else
+ args.state.player.dx = -5
+ end
+
+ elsif args.inputs.right # if right key is pressed
+ if args.state.player.dx > 5
+ args.state.player.dx = args.state.player.dx
+ else
+ args.state.player.dx = 5
+ end
+ else
+ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down
+ end
+
+ if ((args.state.player.dx).abs > 5) #&& ((args.state.tick_count - args.state.lastpush) <= 10)
+ args.state.player.dx *= 0.95
+ end
+ end
+
+ def tick_instructions args, text, y = 715
+ return if args.state.key_event_occurred
+ if args.inputs.mouse.click ||
+ args.inputs.keyboard.directional_vector ||
+ args.inputs.keyboard.key_down.enter ||
+ args.inputs.keyboard.key_down.space ||
+ args.inputs.keyboard.key_down.escape
+ args.state.key_event_occurred = true
+ end
+
+ args.outputs.debug << [0, y - 50, 1280, 60].solid
+ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
+ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ end
+
+#+end_src
+
*** Lowrez - Nokia 3310 - main.rb
#+begin_src ruby
# ./samples/99_genre_lowrez/nokia_3310/app/main.rb
@@ -25867,7 +27587,7 @@ Follows is a source code listing for all files that have been open sourced. This
text: text,
size_enum: -1.5,
r: 255, g: 255, b: 255
- }.label
+ }.label!
end
args.outputs.debug << {
@@ -25877,7 +27597,7 @@ Follows is a source code listing for all files that have been open sourced. This
size_enum: -0.5,
alignment_enum: 1,
r: 255, g: 255, b: 255
- }.label
+ }.label!
end
def snake_demo args
@@ -26129,7 +27849,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 240,
b: 216,
a: 100
- }.line
+ }.line!
end
(NOKIA_WIDTH + 1).map_with_index do |i|
@@ -26142,7 +27862,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 240,
b: 216,
a: 100
- }.line
+ }.line!
end
@args.state.overlay_rendered = true
@@ -26894,7 +28614,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 128,
b: 128,
a: 80
- }.line
+ }.line!
args.outputs.static_debug << {
x: LOWREZ_X_OFFSET + (i * 10),
@@ -26905,7 +28625,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 128,
b: 128,
a: 80
- }.line
+ }.line!
end
end
@@ -26932,7 +28652,7 @@ Follows is a source code listing for all files that have been open sourced. This
y: 720 - (i * 20),
text: text,
size_enum: -1.5
- }.label
+ }.label!
end
args.outputs.debug << {
@@ -26941,7 +28661,7 @@ Follows is a source code listing for all files that have been open sourced. This
text: "INFO: dev mode is currently enabled. Comment out the invocation of ~render_debug~ within the ~tick~ method to hide the debug layer.",
size_enum: -0.5,
alignment_enum: 1
- }.label
+ }.label!
end
$gtk.reset
@@ -35432,58 +37152,21 @@ Follows is a source code listing for all files that have been open sourced. This
class Args
include ArgsDeprecated
include Serialize
-
- # Contains information related to input devices and input events.
- #
- # @return [Inputs]
attr_accessor :inputs
-
- # Contains the means to interact with output devices such as the screen.
- #
- # @return [Outputs]
attr_accessor :outputs
-
- # Contains the means to interact with the audio mixer.
- #
- # @return [Hash]
attr_accessor :audio
-
- # Contains display size information to assist in positioning things on the screen.
- #
- # @return [Grid]
attr_accessor :grid
-
- # Provides access to game play recording facilities within Game Toolkit.
- #
- # @return [Recording]
attr_accessor :recording
-
- # Gives you access to geometry related functions.
- #
- # @return [Geometry]
attr_accessor :geometry
-
attr_accessor :fn
-
- # This is where you'll put state associated with your video game.
- #
- # @return [OpenEntity]
attr_accessor :state
-
- # Gives you access to the top level DragonRuby runtime.
- #
- # @return [Runtime]
+ attr_accessor :temp_state
attr_accessor :runtime
alias_method :gtk, :runtime
-
attr_accessor :passes
-
attr_accessor :wizards
-
attr_accessor :layout
-
attr_accessor :easing
-
attr_accessor :string
def initialize runtime, recording
@@ -35492,6 +37175,7 @@ Follows is a source code listing for all files that have been open sourced. This
@audio = {}
@passes = []
@state = OpenEntity.new
+ @temp_state = OpenEntity.new
@state.tick_count = -1
@runtime = runtime
@recording = recording
@@ -35521,11 +37205,12 @@ Follows is a source code listing for all files that have been open sourced. This
def serialize
{
- state: state.as_hash,
- inputs: inputs.serialize,
- passes: passes.serialize,
- outputs: outputs.serialize,
- grid: grid.serialize
+ state: state.as_hash,
+ temp_state: temp_state.as_hash,
+ inputs: inputs.serialize,
+ passes: passes.serialize,
+ outputs: outputs.serialize,
+ grid: grid.serialize
}
end
@@ -35691,10 +37376,10 @@ Follows is a source code listing for all files that have been open sourced. This
class Assert
def custom_assertion actual, expected, message = nil
- # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
+ # this tells Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
@assertion_performed = true
- # perform your custom logic here and rais an exception to denote a failure.
+ # perform your custom logic here and raise an exception to denote a failure.
raise "Some Error. #{message}."
end
@@ -35704,14 +37389,14 @@ Follows is a source code listing for all files that have been open sourced. This
attr :assertion_performed
=begin
- Us this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
+ Use this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
=end
def ok!
@assertion_performed = true
end
=begin
- Assert if a value is a thruthy value. All assert method take an optional final parameter that is the message to display to the user.
+ Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.
@example
@@ -35765,7 +37450,7 @@ Follows is a source code listing for all files that have been open sourced. This
@assertion_performed = true
if actual != expected
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
- message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}\n#{message}"
raise message
end
nil
@@ -35775,7 +37460,7 @@ Follows is a source code listing for all files that have been open sourced. This
@assertion_performed = true
if actual == expected
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
- message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}\n#{message}"
raise message
end
nil
@@ -35830,6 +37515,10 @@ Follows is a source code listing for all files that have been open sourced. This
args.state
end
+ def temp_state
+ args.temp_state
+ end
+
def inputs
args.inputs
end
@@ -35857,6 +37546,14 @@ Follows is a source code listing for all files that have been open sourced. This
def layout
args.layout
end
+
+ def new_entity entity_type, init_hash = nil, &block
+ args.state.new_entity entity_type, init_hash, &block
+ end
+
+ def new_entity_strict entity_type, init_hash = nil, &block
+ args.state.new_entity_strict entity_type, init_hash, &block
+ end
end
#+end_src
@@ -35903,7 +37600,7 @@ Follows is a source code listing for all files that have been open sourced. This
attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x,
:tile_y, :tile_w, :tile_h, :flip_horizontally,
:flip_vertically, :angle_anchor_x, :angle_anchor_y, :id,
- :source_x, :source_y, :source_w, :source_h
+ :source_x, :source_y, :source_w, :source_h, :blendmode_enum
def primitive_marker
:sprite
@@ -35948,7 +37645,7 @@ Follows is a source code listing for all files that have been open sourced. This
:font_style, :menu
def initialize
- @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)
+ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)
@menu = Menu.new self
@disabled = false
@log_offset = 0
@@ -35968,6 +37665,8 @@ Follows is a source code listing for all files that have been open sourced. This
@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]
@animation_duration = 1.seconds
@shown_at = -1
load_history
@@ -36242,6 +37941,8 @@ Follows is a source code listing for all files that have been open sourced. This
if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa'
$gtk.request_quit
+ elsif cmd.start_with? ':'
+ send ((cmd.gsub '-', '_').gsub ':', '')
else
puts "-> #{cmd}"
begin
@@ -36250,13 +37951,19 @@ Follows is a source code listing for all files that have been open sourced. This
if $results.nil?
puts "=> nil"
elsif $results == :console_silent_eval
+ # do nothing since the console is silent
else
puts "=> #{$results}"
end
@last_command_errored = false
rescue Exception => e
try_search_docs e
- puts "* EXCEPTION: #{e}"
+ # if an exception is thrown and the bactrace includes something helpful, then show it
+ if (e.backtrace || []).first && (e.backtrace.first.include? "(eval)")
+ puts "* EXCEPTION: #{e}"
+ else
+ puts "* EXCEPTION: #{e}\n#{e.__backtrace_to_org__}"
+ end
end
end
end
@@ -36483,6 +38190,11 @@ Follows is a source code listing for all files that have been open sourced. This
end
render_log_offset args
+
+ args.outputs.reserved << { x: 10.from_right, y: @bottom + 10,
+ text: "Press CTRL+g or ESCAPE to clear the prompt.",
+ vertical_alignment_enum: 0,
+ alignment_enum: 2, r: 80, g: 80, b: 80 }.label!
end
def render_log_offset args
@@ -36505,7 +38217,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
def include_subdued_markers? text
- include_any_words? text, subdued_markers
+ (text.start_with? "* INFO: ") && (include_any_words? text, subdued_markers)
end
def include_any_words? text, words
@@ -36651,8 +38363,32 @@ Follows is a source code listing for all files that have been open sourced. This
(log_entry.start_with? "**** ")
end
+ def code? log_entry
+ (just_symbol? log_entry) || (codeblock_marker? log_entry)
+ end
+
+ def just_symbol? log_entry
+ scrubbed = log_entry.gsub("*", "").strip
+ (scrubbed.start_with? ":") && (!scrubbed.include? " ") && (!scrubbed.include? "=>")
+ end
+
+ def code_comment? log_entry
+ return true if log_entry.strip.start_with?("# ")
+ return false
+ end
+
+ def codeblock_marker? log_entry
+ return true if log_entry.strip.start_with?("#+begin_src")
+ return true if log_entry.strip.start_with?("#+end_src")
+ return false
+ end
+
def color_for_log_entry(log_entry)
- if include_row_marker? log_entry
+ if code? log_entry
+ @code_color
+ elsif code_comment? log_entry
+ @comment_color
+ elsif include_row_marker? log_entry
@text_color
elsif include_error_marker? log_entry
@error_color
@@ -36727,6 +38463,10 @@ Follows is a source code listing for all files that have been open sourced. This
@color
end
+ def to_s
+ "GTK::Console::Color #{to_h}"
+ end
+
def to_h
{ r: @color[0], g: @color[1], b: @color[2], a: @color[3] }
end
@@ -36774,7 +38514,7 @@ Follows is a source code listing for all files that have been open sourced. This
size_enum: size_enum,
alignment_enum: alignment_enum,
**color.to_h,
- }.label
+ }.label!
end
end
end
@@ -36838,7 +38578,7 @@ Follows is a source code listing for all files that have been open sourced. This
def itch_wizard_clicked
@console.scroll_to_bottom
- $wizards.itch.start
+ $wizards.itch.restart
end
def docs_clicked
@@ -36863,6 +38603,7 @@ Follows is a source code listing for all files that have been open sourced. This
@buttons = [
(button id: :record, row: 0, col: 9, text: "record gameplay", method: :record_clicked),
(button id: :replay, row: 0, col: 10, text: "start replay", method: :replay_clicked),
+ *custom_buttons
]
elsif @menu_shown == :hidden
@buttons = [
@@ -36921,8 +38662,8 @@ Follows is a source code listing for all files that have been open sourced. This
method: method
}.let do |entity|
primitives = []
- primitives << entity[:rect].merge(a: 164).solid
- primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border
+ primitives << entity[:rect].solid!(a: 164)
+ primitives << entity[:rect].border!(r: 255, g: 255, b: 255)
primitives << text.wrapped_lines(5)
.map_with_index do |l, i|
[
@@ -37023,14 +38764,14 @@ Follows is a source code listing for all files that have been open sourced. This
return if @cursor_position.zero?
new_pos = @cursor_position - 1
- (is_word_boundary? @current_input_str[new_pos]) ?
+ (is_word_boundary? @current_input_str[new_pos]) ?
(new_pos -= 1 until !(is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?):
(new_pos -= 1 until (is_word_boundary? @current_input_str[new_pos - 1]) || new_pos.zero?)
@cursor_position = new_pos
update_cursor_position_px
end
-
+
def move_cursor_right
@cursor_position += 1 if @cursor_position < current_input_str.length
update_cursor_position_px
@@ -37043,7 +38784,7 @@ Follows is a source code listing for all files that have been open sourced. This
(is_word_boundary? @current_input_str[new_pos]) ?
(new_pos += 1 until !(is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len)):
(new_pos += 1 until (is_word_boundary? @current_input_str[new_pos]) || (new_pos.equal? str_len))
-
+
@cursor_position = new_pos
update_cursor_position_px
end
@@ -37126,17 +38867,17 @@ Follows is a source code listing for all files that have been open sourced. This
"#{" " * (string_width.length - c.length) } #{c} |"
end.join
- # remove seperators between empty values
+ # remove separators between empty values
formated_row = formated_row.gsub(" | ", " ")
puts formated_row
end
- def pretty_print_row_seperator string_width, cell_width, column_width, columns
+ def pretty_print_row_separator string_width, cell_width, column_width, columns
# this is a joint: +--------
column_joint = "+#{"-" * cell_width}"
- # multiple joints create a row seperator: +----+----+
+ # multiple joints create a row separator: +----+----+
puts (column_joint * columns) + "+"
end
@@ -37145,12 +38886,12 @@ Follows is a source code listing for all files that have been open sourced. This
args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5,
y: y + 5,
x2: x + @cursor_position_px + 0.5,
- y2: y + @font_style.letter_size.y + 5)
+ y2: y + @font_style.letter_size.y + 4)
args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1,
y: y + 5,
x2: x + @cursor_position_px + 1,
- y2: y + @font_style.letter_size.y + 5)
+ y2: y + @font_style.letter_size.y + 4)
# debugging rectangle for string
# args.outputs.reserved << (@cursor_color.to_h.merge x: x,
@@ -37778,7 +39519,7 @@ Follows is a source code listing for all files that have been open sourced. This
:l1, :r1,
:l2, :r2,
:l3, :r3,
- :start, :select,
+ :start, :select, :home,
:directional_up, :directional_down, :directional_left, :directional_right
].freeze
@@ -37786,6 +39527,22 @@ Follows is a source code listing for all files that have been open sourced. This
attr label
end
+ def back
+ @select
+ end
+
+ def back= value
+ @select = value
+ end
+
+ def guide
+ @home
+ end
+
+ def guide= value
+ @home = value
+ end
+
# Activate a key.
#
# @return [void]
@@ -37834,7 +39591,7 @@ Follows is a source code listing for all files that have been open sourced. This
error_message = <<-S
* ERROR
- The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy:
+ The GTK::DirectionalKeys module should only be included in objects that respond to the following api hierarchy:
- (#{ directional_methods.join("|") })
- key_held.(#{ directional_methods.join("|") })
@@ -37891,6 +39648,12 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
+ def directional_angle
+ return nil unless directional_vector
+
+ Math.atan2(up_down, left_right).to_degrees
+ end
+
def method_missing m, *args
# combine the key with ctrl_
if m.to_s.start_with?("ctrl_")
@@ -38123,6 +39886,22 @@ 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
+ px = point.x
+ py = point.y
+ cx = 0
+ cy = 0
+ if around
+ cx = around.x
+ cy = around.y
+ end
+
+ point.merge(x: ((px - cx) * c - (py - cy) * s) + cx,
+ y: ((px - cx) * s + (py - cy) * c) + cy)
+ end
+
# Returns f(t) for a cubic Bezier curve.
def self.cubic_bezier t, a, b, c, d
s = 1 - t
@@ -38204,7 +39983,7 @@ Follows is a source code listing for all files that have been open sourced. This
rescue Exception => e
raise e, <<-S
* ERROR:
- center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+ center_inside_rect for self #{self} and other_rect #{other_rect}.\n#{e}.
S
end
@@ -38221,7 +40000,7 @@ Follows is a source code listing for all files that have been open sourced. This
rescue Exception => e
raise e, <<-S
* ERROR:
- center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+ center_inside_rect_x for self #{self} and other_rect #{other_rect}.\n#{e}.
S
end
@@ -38238,7 +40017,7 @@ Follows is a source code listing for all files that have been open sourced. This
rescue Exception => e
raise e, <<-S
* ERROR:
- center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+ center_inside_rect_y for self #{self} and other_rect #{other_rect}.\n#{e}.
S
end
@@ -38247,7 +40026,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
- # Returns a primitive that is anchored/repositioned based off its retangle.
+ # Returns a primitive that is anchored/repositioned based off its rectangle.
# @gtk
def anchor_rect anchor_x, anchor_y
current_w = self.w
@@ -38383,10 +40162,10 @@ Follows is a source code listing for all files that have been open sourced. This
# @gtk
def self.intersect_rect? rect_one, rect_two, tolerance = 0.1
- return false if rect_one.right - tolerance < rect_two.left + tolerance
- return false if rect_one.left + tolerance > rect_two.right - tolerance
- return false if rect_one.top - tolerance < rect_two.bottom + tolerance
- return false if rect_one.bottom + tolerance > rect_two.top - tolerance
+ return false if ((rect_one.x + rect_one.w) - tolerance) < (rect_two.x + tolerance)
+ return false if (rect_one.x + tolerance) > ((rect_two.x + rect_two.w) - tolerance)
+ return false if ((rect_one.y + rect_one.h) - tolerance) < (rect_two.y + tolerance)
+ return false if (rect_one.y + tolerance) > ((rect_two.y + rect_two.h) - tolerance)
return true
rescue Exception => e
context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]
@@ -38414,6 +40193,7 @@ Follows is a source code listing for all files that have been open sourced. This
- rect_one: #{rect_one}
- rect_two: #{rect_two}
#{context_help}
+ \n#{e}
S
end
@@ -38424,14 +40204,14 @@ Follows is a source code listing for all files that have been open sourced. This
y = y.shift_down(size * anchor_y)
[x, y, size, size]
rescue Exception => e
- raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}."
+ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"
end
# @gtk
def self.distance point_one, point_two
Math.sqrt((point_two.x - point_one.x)**2 + (point_two.y - point_one.y)**2)
rescue Exception => e
- raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."
+ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}.\n#{e}"
end
# @gtk
@@ -38440,31 +40220,34 @@ Follows is a source code listing for all files that have been open sourced. This
d_x = end_point.x - start_point.x
Math::PI.+(Math.atan2(d_y, d_x)).to_degrees
rescue Exception => e
- raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}."
+ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"
end
# @gtk
def self.angle_to start_point, end_point
angle_from end_point, start_point
rescue Exception => e
- raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}."
+ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"
end
# @gtk
def self.point_inside_circle? point, circle_center_point, radius
(point.x - circle_center_point.x) ** 2 + (point.y - circle_center_point.y) ** 2 < radius ** 2
rescue Exception => e
- raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}"
+ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}.\n#{e}"
end
# @gtk
def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0
+ return nil if !inner_rect
+ return nil if !outer_rect
+
inner_rect.x + tolerance >= outer_rect.x - tolerance &&
- inner_rect.right - tolerance <= outer_rect.right + tolerance &&
+ (inner_rect.x + inner_rect.w) - tolerance <= (outer_rect.x + outer_rect.w) + tolerance &&
inner_rect.y + tolerance >= outer_rect.y - tolerance &&
- inner_rect.top - tolerance <= outer_rect.top + tolerance
+ (inner_rect.y + inner_rect.h) - tolerance <= (outer_rect.y + outer_rect.h) + tolerance
rescue Exception => e
- raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."
+ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}.\n#{e}"
end
# @gtk
@@ -38499,7 +40282,7 @@ Follows is a source code listing for all files that have been open sourced. This
return rect
end
rescue Exception => e
- raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}."
+ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"
end
# @gtk
@@ -38513,7 +40296,21 @@ Follows is a source code listing for all files that have been open sourced. This
anchor_x: anchor_x,
anchor_y: anchor_y
rescue Exception => e
- raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]."
+ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)].\n#{e}"
+ end
+
+ def self.rect_to_line rect
+ l = rect.to_hash.line
+ l.merge(x2: l.x + l.w - 1,
+ y2: l.y + l.h)
+ end
+
+ def self.rect_center_point rect
+ { x: rect.x + rect.w.half, y: rect.y + rect.h.half }
+ end
+
+ def rect_center_point
+ Geometry.rect_center_point self
end
end # module Geometry
end # module GTK
@@ -38710,6 +40507,14 @@ Follows is a source code listing for all files that have been open sourced. This
def bottom_right
[@right, @bottom].point
end
+
+ def x
+ 0
+ end
+
+ def y
+ 0
+ end
end
end
@@ -38911,6 +40716,30 @@ Follows is a source code listing for all files that have been open sourced. This
}
end
+ def self.method_to_key_hash
+ return @method_to_key_hash if @method_to_key_hash
+ @method_to_key_hash = {}
+ string_representation_overrides ||= {
+ backspace: '\b'
+ }
+ char_to_method_hash.each do |k, v|
+ v.each do |vi|
+ t = { char_or_raw_key: k }
+
+ if k.is_a? Numeric
+ t[:raw_key] = k
+ t[:string_representation] = "raw_key == #{k}"
+ else
+ t[:char] = k
+ t[:string_representation] = "\"#{k.strip}\""
+ end
+
+ @method_to_key_hash[vi] = t
+ end
+ end
+ @method_to_key_hash
+ end
+
def self.char_to_method char, int = nil
methods = char_to_method_hash[char] || char_to_method_hash[int]
methods ? methods.dup : [char.to_sym || int]
@@ -39025,24 +40854,32 @@ Follows is a source code listing for all files that have been open sourced. This
end
def method_missing m, *args
- begin
- define_singleton_method(m) do
- r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)
- clear_key m
- return r
- end
+ if KeyboardKeys.method_to_key_hash[m.without_ending_bang]
+ begin
+ define_singleton_method(m) do
+ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)
+ clear_key m
+ return r
+ end
- return self.send m
- rescue Exception => e
- log_important "#{e}"
+ return self.send m
+ rescue Exception => e
+ log_important "#{e}"
+ end
end
+ did_you_mean = KeyboardKeys.method_to_key_hash.find_all do |k, v|
+ k.to_s[0..1] == m.to_s[0..1]
+ end.map {|k, v| ":#{k} (#{v[:string_representation]})" }
+ did_you_mean_string = ""
+ did_you_mean_string = ". Did you mean #{did_you_mean.join ", "}?"
+
raise <<-S
* ERROR:
- There is no member on the keyboard called #{m}. Here is a to_s representation of what's available:
-
- #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}
+ #{KeyboardKeys.method_to_key_hash.map { |k, v| "** :#{k} #{v.string_representation}" }.join("\n")}
+ There is no key on the keyboard called :#{m}#{did_you_mean_string}.
+ Full list of available keys =:points_up:=.
S
end
@@ -39426,6 +41263,10 @@ Follows is a source code listing for all files that have been open sourced. This
(controller_one && controller_one.directional_vector)
end
+ def directional_angle
+ keyboard.directional_angle || (controller_one && controller_one.directional_angle)
+ end
+
# Returns a signal indicating right (`1`), left (`-1`), or neither ('0').
#
# @return [Integer]
@@ -39497,19 +41338,12 @@ Follows is a source code listing for all files that have been open sourced. This
*** ios_wizard.rb
#+begin_src ruby
# ./dragon/ios_wizard.rb
+ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński
# Copyright 2019 DragonRuby LLC
# MIT License
# ios_wizard.rb has been released under MIT (*only this file*).
- class WizardException < Exception
- attr_accessor :console_primitives
-
- def initialize *console_primitives
- @console_primitives = console_primitives
- end
- end
-
- class IOSWizard
+ class IOSWizard < Wizard
def initialize
@doctor_executed_at = 0
end
@@ -39522,23 +41356,45 @@ Follows is a source code listing for all files that have been open sourced. This
@steps ||= []
end
- def steps_development_build
+ def prerequisite_steps
[
:check_for_xcode,
:check_for_brew,
:check_for_certs,
- :check_for_device,
- :check_for_dev_profile,
+ ]
+ end
+
+ def app_metadata_retrieval_steps
+ [
:determine_team_identifier,
:determine_app_name,
:determine_app_id,
- :blow_away_temp,
+ ]
+ end
+
+ def steps_development_build
+ [
+ *prerequisite_steps,
+
+ :check_for_device,
+ :check_for_dev_profile,
+
+ *app_metadata_retrieval_steps,
+
+ :clear_tmp_directory,
:stage_app,
+
:development_write_info_plist,
+
:write_entitlements_plist,
:compile_icons,
- :create_payload_directory,
+ :clear_payload_directory,
+
+ :create_payload_directory_dev,
+
+ :create_payload,
:code_sign_payload,
+
:create_ipa,
:deploy
]
@@ -39546,20 +41402,27 @@ Follows is a source code listing for all files that have been open sourced. This
def steps_production_build
[
- :check_for_xcode,
- :check_for_brew,
- :check_for_certs,
+ *prerequisite_steps,
+
:check_for_distribution_profile,
- :determine_team_identifier,
- :determine_app_name,
- :determine_app_id,
- :blow_away_temp,
+ :determine_app_version,
+
+ *app_metadata_retrieval_steps,
+
+ :clear_tmp_directory,
:stage_app,
+
:production_write_info_plist,
+
:write_entitlements_plist,
:compile_icons,
- :create_payload_directory,
+ :clear_payload_directory,
+
+ :create_payload_directory_prod,
+
+ :create_payload,
:code_sign_payload,
+
:create_ipa,
:print_publish_help
]
@@ -39595,6 +41458,8 @@ Follows is a source code listing for all files that have been open sourced. This
@steps = steps_development_build
@steps = steps_production_build if @production_build
@certificate_name = nil
+ @app_version = opts[:version]
+ @app_version = "1.0" if @opts[:env] == :dev && !@app_version
init_wizard_status
log_info "Starting iOS Wizard so we can deploy to your device."
@start_at = Kernel.global_tick_count
@@ -39616,8 +41481,10 @@ Follows is a source code listing for all files that have been open sourced. This
log "=" * $console.console_text_width
else
log_error e.to_s
+ log e.__backtrace_to_org__
end
+ init_wizard_status
$console.set_command "$wizards.ios.start env: :#{@opts[:env]}"
end
@@ -39724,13 +41591,66 @@ Follows is a source code listing for all files that have been open sourced. This
return "profiles/development.mobileprovision"
end
+ def ios_metadata_template
+ <<-S
+ # 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=
+ S
+ end
+
+ def ios_metadata
+ contents = $gtk.read_file 'metadata/ios_metadata.txt'
+
+ if !contents
+ $gtk.write_file 'metadata/ios_metadata.txt', ios_metadata_template
+ contents = $gtk.read_file 'metadata/ios_metadata.txt'
+ end
+
+ kvps = contents.each_line
+ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }
+ .map do |l|
+ key, value = l.split("=")
+ [key.strip.to_sym, value.strip]
+ end.flatten
+ Hash[*kvps]
+ end
+
+ def game_metadata
+ contents = $gtk.read_file 'metadata/game_metadata.txt'
+
+ kvps = contents.each_line
+ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }
+ .map do |l|
+ key, value = l.split("=")
+ [key.strip.to_sym, value.strip]
+ end.flatten
+ Hash[*kvps]
+ end
+
+ 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.",
+ "Instructions for where the values should come from are within metadata/ios_metadata.txt."
+ )
+ end
+
def determine_team_identifier
- @team_name = (team_identifier_from_provisioning_profile @opts[:env])
- log_info "Team Identifer is: #{@team_name}"
+ @team_id = (ios_metadata.teamid || "")
+ raise_ios_metadata_required if @team_id.strip.length == 0
+ log_info "Team Identifer is: #{@team_id}"
end
def determine_app_name
- @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data]
+ @app_name = (ios_metadata.appname || "")
+ raise_ios_metadata_required if @app_name.strip.length == 0
log_info "App name is: #{@app_name}."
end
@@ -39754,36 +41674,9 @@ Follows is a source code listing for all files that have been open sourced. This
$gtk.parse_xml scrubbed
end
- def app_id_from_provisioning_profile environment
- application_identifier_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]
- (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|
- if node[:children] && node[:children][0] && node[:children][0][:data] == "application-identifier"
- application_identifier_index = i
- break
- end
- end
-
- app_id_with_team_identifier = (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][application_identifier_index + 1][:children].first[:data]
- team_identifer = team_identifier_from_provisioning_profile environment
- app_id_with_team_identifier.gsub "#{team_identifer}.", ""
- end
-
- def team_identifier_from_provisioning_profile environment
- team_identifer_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]
-
- (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|
- if node[:children] && node[:children][0] && node[:children][0][:data] == "com.apple.developer.team-identifier"
- team_identifer_index = i
- break
- end
- end
-
- (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data]
- end
-
def determine_app_id
- @app_id = app_id_from_provisioning_profile @opts[:env]
-
+ @app_id = ios_metadata.appid
+ raise_ios_metadata_required if @app_id.strip.length == 0
log_info "App Identifier is set to : #{@app_id}"
end
@@ -39802,7 +41695,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
- def blow_away_temp
+ def clear_tmp_directory
sh "rm -rf #{tmp_directory}"
end
@@ -39943,7 +41836,8 @@ Follows is a source code listing for all files that have been open sourced. This
log_info "Creating Entitlements.plist"
- $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip
+ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip
+ $gtk.write_file_root "tmp/ios/Entitlements.txt", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip
sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\""
sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\""
@@ -39981,15 +41875,15 @@ Follows is a source code listing for all files that have been open sourced. This
<key>CFBundleExecutable</key>
<string>:app_name</string>
<key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
+ <string>:app_version</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.6</string>
+ <string>:app_version</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>5.6</string>
+ <string>:app_version</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
@@ -40138,13 +42032,13 @@ Follows is a source code listing for all files that have been open sourced. This
<key>CFBundleIdentifier</key>
<string>:app_id</string>
<key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
+ <string>:app_version</string>
<key>CFBundleName</key>
<string>:app_name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
@@ -40152,7 +42046,7 @@ Follows is a source code listing for all files that have been open sourced. This
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
@@ -40238,6 +42132,7 @@ Follows is a source code listing for all files that have been open sourced. This
info_plist_string.gsub!(":app_id", @app_id)
$gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
+ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip
@info_plist_written = true
end
@@ -40291,13 +42186,13 @@ Follows is a source code listing for all files that have been open sourced. This
<key>CFBundleIdentifier</key>
<string>:app_id</string>
<key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
+ <string>:app_version</string>
<key>CFBundleName</key>
<string>:app_name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
@@ -40305,7 +42200,7 @@ Follows is a source code listing for all files that have been open sourced. This
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
- <string>5.2</string>
+ <string>:app_version</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
@@ -40389,8 +42284,10 @@ Follows is a source code listing for all files that have been open sourced. This
info_plist_string.gsub!(":app_name", @app_name)
info_plist_string.gsub!(":app_id", @app_id)
+ info_plist_string.gsub!(":app_version", @app_version)
$gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
+ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip
@info_plist_written = true
end
@@ -40412,28 +42309,53 @@ Follows is a source code listing for all files that have been open sourced. This
"#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}"
end
- def write_ip_address
+ def embed_mobileprovision
+ sh %Q[cp #{@provisioning_profile_path} "#{app_path}/embedded.mobileprovision"]
+ sh %Q[/usr/bin/plutil -convert binary1 "#{app_path}/Info.plist"]
+ end
+
+ def clear_payload_directory
+ sh %Q[rm "#{@app_name}".ipa]
+ sh %Q[rm -rf "#{app_path}/app"]
+ sh %Q[rm -rf "#{app_path}/sounds"]
+ sh %Q[rm -rf "#{app_path}/sprites"]
+ sh %Q[rm -rf "#{app_path}/data"]
+ sh %Q[rm -rf "#{app_path}/fonts"]
+ end
+
+ def stage_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/"]
+ sh %Q[cp -r "#{root_folder}/data/" "#{app_path}/data/"]
+ sh %Q[cp -r "#{root_folder}/fonts/" "#{app_path}/fonts/"]
+ end
+
+ def create_payload
+ sh %Q[mkdir -p #{tmp_directory}/ipa_root/Payload]
+ sh %Q[cp -r "#{app_path}" "#{tmp_directory}/ipa_root/Payload"]
+ sh %Q[chmod -R 755 "#{tmp_directory}/ipa_root/Payload"]
+ end
+
+ def create_payload_directory_dev
+ # write dev machine's ip address for hotloading
$gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip
+
+ embed_mobileprovision
+ clear_payload_directory
+ stage_app
end
- def create_payload_directory
- sh "cp #{@provisioning_profile_path} \"#{app_path}/embedded.mobileprovision\""
- sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""
- write_ip_address
- sh "rm \"#{@app_name}\".ipa"
- sh "rm -rf \"#{app_path}/app\""
- sh "rm -rf \"#{app_path}/sounds\""
- sh "rm -rf \"#{app_path}/sprites\""
- sh "rm -rf \"#{app_path}/data\""
- sh "rm -rf \"#{app_path}/fonts\""
- sh "cp -r \"#{root_folder}/app/\" \"#{app_path}/app/\""
- sh "cp -r \"#{root_folder}/sounds/\" \"#{app_path}/sounds/\""
- sh "cp -r \"#{root_folder}/sprites/\" \"#{app_path}/sprites/\""
- sh "cp -r \"#{root_folder}/data/\" \"#{app_path}/data/\""
- sh "cp -r \"#{root_folder}/fonts/\" \"#{app_path}/fonts/\""
- sh "mkdir -p #{tmp_directory}/ipa_root/Payload"
- sh "cp -r \"#{app_path}\" \"#{tmp_directory}/ipa_root/Payload\""
- sh "chmod -R 755 \"#{tmp_directory}/ipa_root/Payload\""
+ def create_payload_directory_prod
+ # production builds does not hotload ip address
+ sh %Q[rm "#{root_folder}/app/server_ip_address.txt"]
+
+ embed_mobileprovision
+ stage_app
+
+ # production build marker
+ sh %Q[mkdir -p "#{app_path}/metadata/"]
+ sh %Q[touch metadata/DRAGONRUBY_PRODUCTION_BUILD]
end
def create_ipa
@@ -40466,10 +42388,22 @@ Follows is a source code listing for all files that have been open sourced. This
end
def print_publish_help
- log_info "Go to https://appstoreconnect.apple.com/apps and create an App if you haven't already done so."
- log_info "Go to https://appleid.apple.com and create a 'Application Specific Password'."
- log_info "To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."
- log_info "Your app is located at ./tmp/ios/#{@app_name}.ipa"
+ has_transporter = (sh "ls /Applications/Transporter.app").include? "Contents"
+ if !has_transporter
+ $gtk.openurl "https://apps.apple.com/us/app/transporter/id1450874784?mt=12"
+ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}, version: \"#{@opts[:version]}\""
+ raise WizardException.new(
+ "* To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."
+ )
+ else
+ sh "mkdir ./tmp/ios/intermediary_artifacts"
+ sh "mv \"#{tmp_directory}/#{@app_name}.app\" #{tmp_directory}/intermediary_artifacts/"
+ sh "mv \"#{tmp_directory}/do_zip.sh\" #{tmp_directory}/intermediary_artifacts"
+ sh "mv \"#{tmp_directory}/Entitlements.plist\" #{tmp_directory}/intermediary_artifacts"
+ sh "mv \"#{tmp_directory}/ipa_root\" #{tmp_directory}/intermediary_artifacts/"
+ sh "open /Applications/Transporter.app"
+ sh "open ./tmp/ios/"
+ end
end
def compile_icons
@@ -40490,6 +42424,26 @@ Follows is a source code listing for all files that have been open sourced. This
sh "cp -r \"#{root_folder}/native/\" \"#{app_path}/native/\""
sh "CODESIGN_ALLOCATE=\"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate\" /usr/bin/codesign -f -s \"#{@certificate_name}\" --entitlements #{tmp_directory}/Entitlements.plist \"#{tmp_directory}/#{@app_name}.app/native/ios-device/ext.dylib\""
end
+
+ def set_version version
+ @app_version = version
+ start env: @opts[:env], version: version
+ end
+
+ def app_version
+ log_info "Attempting to retrieve App Version from metadata/ios_metadata.txt."
+ ios_version_number = (ios_metadata.version || "").strip
+ if ios_version_number.length == 0
+ log_info "Not found. Attempting to retrieve App Version from metadata/game_metadata.txt."
+ ios_version_number = (game_metadata.version || "").strip
+ end
+ ios_version_number
+ end
+
+ def determine_app_version
+ @app_version = app_version
+ return if @app_version
+ end
end
#+end_src
@@ -40501,38 +42455,14 @@ Follows is a source code listing for all files that have been open sourced. This
# MIT License
# itch_wizard.rb has been released under MIT (*only this file*).
- class ItchWizard
+ class ItchWizard < Wizard
def steps
[
:check_metadata,
- :deploy
+ :deploy,
]
end
- def metadata_file_path
- "metadata/game_metadata.txt"
- end
-
- def get_metadata
- metadata = $gtk.read_file metadata_file_path
-
- if !metadata
- write_blank_metadata
- metadata = $gtk.read_file metadata_file_path
- end
-
- dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
-
- {
- dev_id: dev_id.strip,
- dev_title: dev_title.strip,
- game_id: game_id.strip,
- game_title: game_title.strip,
- version: version.strip,
- icon: icon.strip
- }
- end
-
def write_blank_metadata
$gtk.write_file metadata_file_path, <<-S.strip
#devid=myname
@@ -40550,7 +42480,7 @@ Follows is a source code listing for all files that have been open sourced. This
write_blank_metadata
end
- if metadata_text.each_line.to_a.length != 6
+ if metadata_text.strip.each_line.to_a.length < 6
write_blank_metadata
end
@@ -40562,70 +42492,67 @@ Follows is a source code listing for all files that have been open sourced. This
if metadata[:dev_id].start_with?("#") || !@dev_id
log "* PROMPT: Please provide your username for Itch."
- $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\""
+ $console.set_command "$wizards.itch.set_dev_id \"#{metadata[:dev_id]}\""
return :need_dev_id
end
if metadata[:dev_title].start_with?("#") || !@dev_title
log "* PROMPT: Please provide developer's/company's name that you want displayed."
- $console.set_command "$wizards.itch.set_dev_title \"Your Name\""
+ $console.set_command "$wizards.itch.set_dev_title \"#{metadata[:dev_title]}\""
return :need_dev_title
end
if metadata[:game_id].start_with?("#") || !@game_id
log "* PROMPT: Please provide the id for you game. This is the id you specified when you set up a new game page on Itch."
- $console.set_command "$wizards.itch.set_game_id \"your-game-id\""
+ $console.set_command "$wizards.itch.set_game_id \"#{metadata[:game_id]}\""
return :need_game_id
end
if metadata[:game_title].start_with?("#") || !@game_title
log "* PROMPT: Please provide the display name for your game. (This can include spaces)"
- $console.set_command "$wizards.itch.set_game_title \"Your Game\""
+ $console.set_command "$wizards.itch.set_game_title \"#{metadata[:game_title]}\""
return :need_game_title
end
if metadata[:version].start_with?("#") || !@version
log "* PROMPT: Please provide the version for your game."
- $console.set_command "$wizards.itch.set_version \"1.0\""
+ $console.set_command "$wizards.itch.set_version \"#{metadata[:version]}\""
return :need_version
end
if metadata[:icon].start_with?("#") || !@icon
log "* PROMPT: Please provide icon path for your game."
- $console.set_command "$wizards.itch.set_icon \"icon.png\""
+ $console.set_command "$wizards.itch.set_icon \"#{metadata[:icon]}\""
return :need_icon
end
+ puts "here!! success!!!"
+
return :success
end
def set_dev_id value
@dev_id = value
- write_metadata
start
end
def set_dev_title value
@dev_title = value
- write_metadata
start
end
def set_game_id value
@game_id = value
- write_metadata
start
end
def set_game_title value
@game_title = value
- write_metadata
start
end
def set_version value
@version = value
- write_metadata
start
end
@@ -40668,7 +42595,7 @@ Follows is a source code listing for all files that have been open sourced. This
end
if @icon
- text += "icon=metadata/#{@icon}\n"
+ text += "icon=#{@icon}\n"
else
text += "#icon=metadata/icon.png\n"
end
@@ -40686,10 +42613,25 @@ Follows is a source code listing for all files that have been open sourced. This
def deploy
log_info "* Running dragonruby-publish: #{package_command}"
- results = $gtk.exec package_command
+ $gtk.openurl "http://itch.io/dashboard" if $gtk.platform == "Mac OS X"
+ if $gtk.platform? :mac
+ $gtk.exec "rm -rf ./builds"
+ end
+ results = $gtk.exec "#{package_command} --only-package"
+ puts File.expand_path("./builds")
+
log "#+begin_src"
log results
log "#+end_src"
+
+ if $gtk.platform? :mac
+ $gtk.exec "open ./builds/"
+ elsif $gtk.platform? :windows
+ $gtk.exec "powershell \"ii .\""
+ end
+
+ $gtk.openurl "https://itch.io/dashboard"
+
:success
end
@@ -40700,7 +42642,7 @@ Follows is a source code listing for all files that have been open sourced. This
steps.each do |m|
begin
log_info "Running Itch Wizard Step: ~$wizards.itch.#{m}~"
- result = (send m) || :success if @wizard_status[m][:result] != :success
+ result = (send m) || :success
@wizard_status[m][:result] = result
if result != :success
log_info "Exiting wizard. :#{result}"
@@ -41049,10 +42991,18 @@ Follows is a source code listing for all files that have been open sourced. This
device.grid_area.row_count
end
+ def row_max_index
+ row_count - 1
+ end
+
def col_count
device.grid_area.col_count
end
+ def col_max_index
+ col_count - 1
+ end
+
def gutter_height
device.grid_area.gutter
end
@@ -41075,18 +43025,124 @@ Follows is a source code listing for all files that have been open sourced. This
def rect_defaults
{
- row: nil,
- col: nil,
- h: 1,
- w: 1,
- dx: 0,
- dy: 0,
- rect: :control_rect
+ row: nil,
+ col: nil,
+ h: 1,
+ w: 1,
+ dx: 0,
+ dx_ratio: 1,
+ dy: 0,
+ dy_ratio: 1,
+ dh_ratio: 1,
+ dw_ratio: 1,
+ merge: nil,
+ rect: :control_rect
}
end
- def rect opts
+ def row n
+ (rect row: n, col: 0, w: 0, h: 0).x
+ end
+
+ def row_from_bottom n
+ (rect row: row_count - n, col: 0, w: 0, h: 0).x
+ end
+
+ def col n
+ (rect row: 0, col: n, w: 0, h: 0).y
+ end
+
+ def col_from_right n
+ (rect row: 0, col: col_max_index - n, w: 0, h: 0).y
+ end
+
+ def w n
+ (rect row: 0, col: 0, w: n, h: 1).w
+ end
+
+ def h n
+ (rect row: 0, col: 0, w: 1, h: n).h
+ end
+
+ def rect_group opts
+ group = opts.group
+ r = opts.row || 0
+ r = row_max_index - opts.row_from_bottom if opts.row_from_bottom
+ c = opts.col || 0
+ c = col_max_index - opts.col_from_right if opts.col_from_right
+ drow = opts.drow || 0
+ dcol = opts.dcol || 0
+ w = opts.w || 0
+ h = opts.h || 0
+ merge = opts[:merge]
+
+ running_row = r
+ running_col = c
+
+ running_col = calc_col_offset(opts.col_offset) if opts.col_offset
+ running_row = calc_row_offset(opts.row_offset) if opts.row_offset
+
+ group.map do |i|
+ group_layout_opts = i.layout || {}
+ group_layout_opts = group_layout_opts.merge row: running_row,
+ col: running_col,
+ merge: merge,
+ w: w, h: h
+ result = (rect group_layout_opts).merge i
+
+ if (i.is_a? Hash) && (i.primitive_marker == :label)
+ if i.alignment_enum == 1
+ result.x += result.w.half
+ elsif i.alignment_enum == 2
+ result.x += result.w
+ end
+ end
+
+ running_row += drow
+ running_col += dcol
+ result
+ end
+ end
+
+ def calc_row_offset opts = {}
+ count = opts[:count] || opts[:length] || 0
+ h = opts.h || 1
+ (row_count - (count * h)) / 2.0
+ end
+
+ def calc_col_offset opts = {}
+ count = opts[:count] || opts[:length] || 0
+ w = opts.w || 1
+ (col_count - (count * w)) / 2.0
+ end
+
+ def point opts = {}
+ opts.w = 1
+ opts.h = 1
+ opts.row ||= 0
+ opts.col ||= 0
+ r = rect opts
+ r.x += r.w * opts.col_anchor if opts.col_anchor
+ r.y += r.h * opts.row_anchor if opts.row_anchor
+ r
+ end
+
+ def rect *all_opts
+ if all_opts.length == 1
+ opts = all_opts.first
+ else
+ opts = {}
+ all_opts.each do |o|
+ opts.merge! o
+ end
+ end
+
+ opts.row = row_max_index - opts.row_from_bottom if opts.row_from_bottom
+ opts.col = col_max_index - opts.col_from_right if opts.col_from_right
opts = rect_defaults.merge opts
+ opts.row ||= 0
+ opts.col ||= 0
+
result = send opts[:rect]
if opts[:row] && opts[:col] && opts[:w] && opts[:h]
col = rect_col opts[:col], opts[:w]
@@ -41094,7 +43150,9 @@ Follows is a source code listing for all files that have been open sourced. This
result = control_rect.merge x: col.x,
y: row.y,
w: col.w,
- h: row.h
+ h: row.h,
+ center_x: col.center_x,
+ center_y: row.center_y
elsif opts[:row] && !opts[:col]
result = rect_row opts[:row], opts[:h]
elsif !opts[:row] && opts[:col]
@@ -41132,13 +43190,21 @@ Follows is a source code listing for all files that have been open sourced. This
result[:h] += device.grid_area.gutter * 2
end
- result[:x] += opts[:dx] if opts[:dx]
- result[:y] += opts[:dy] if opts[:dy]
- result[:w] += opts[:dw] if opts[:dw]
- result[:h] += opts[:dh] if opts[:dh]
+ result[:x] += opts[:dx] if opts[:dx]
+ result[:x] *= opts[:dx_ratio] if opts[:dx_ratio]
+ result[:y] += opts[:dy] if opts[:dy]
+ result[:y] *= opts[:dy_ratio] if opts[:dy_ratio]
+ result[:w] += opts[:dw] if opts[:dw]
+ result[:w] *= opts[:dw_ratio] if opts[:dw_ratio]
+ result[:h] += opts[:dh] if opts[:dh]
+ result[:h] *= opts[:dh_ratio] if opts[:dh_ratio]
+ result.merge! opts[:merge] if opts[:merge]
result[:row] = opts[:row]
result[:col] = opts[:col]
+ result[:h] = result[:h].clamp 0
+ result[:w] = result[:w].clamp 0
+
if $gtk.args.grid.name == :center
result[:x] -= 640
result[:y] -= 360
@@ -41173,7 +43239,7 @@ Follows is a source code listing for all files that have been open sourced. This
row_y = device.h - row_y - row_h
- result = control_rect.merge y: row_y, h: row_h
+ result = control_rect.merge y: row_y, h: row_h, center_y: (row_y + row_h.half)
@rect_cache[:row][index][h] = result
@rect_cache[:row][index][h]
end
@@ -41196,7 +43262,7 @@ Follows is a source code listing for all files that have been open sourced. This
col_w = col_w.to_i
col_w -= 1 if col_w.odd?
- result = control_rect.merge x: col_x, w: col_w
+ result = control_rect.merge x: col_x, w: col_w, center_x: (col_x + col_w.half)
@rect_cache[:col][index][w] = result
@rect_cache[:col][index][w]
end
@@ -41247,6 +43313,26 @@ Follows is a source code listing for all files that have been open sourced. This
@device
end
+ def debug_primitives opts = {}
+ @primitives ||= col_count.map_with_index do |col|
+ row_count.map_with_index do |row|
+ cell = rect row: row, col: col
+ center = Geometry.rect_center_point cell
+ [
+ cell.merge(opts).border,
+ cell.merge(opts)
+ .label!(x: center.x,
+ y: center.y,
+ text: "#{row},#{col}",
+ size_enum: -3,
+ vertical_alignment_enum: 1,
+ alignment_enum: 1)
+ ]
+ end
+ end
+ @primitives
+ end
+
def serialize
{
device: @device.serialize,
@@ -41260,6 +43346,13 @@ Follows is a source code listing for all files that have been open sourced. This
def to_s
serialize.to_s
end
+
+ def reset
+ @primitives = nil
+ @rect_cache ||= {}
+ @rect_cache.clear
+ end
+
end
end
@@ -41399,6 +43492,11 @@ Follows is a source code listing for all files that have been open sourced. This
self.puts message
end
+ def self.reset
+ @once = {}
+ nil
+ end
+
def self.puts_once *ids, message
id = "#{ids}"
@once ||= {}
@@ -41535,6 +43633,53 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
+*** metadata.rb
+#+begin_src ruby
+ # ./dragon/metadata.rb
+ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński
+ # Copyright 2021 DragonRuby LLC
+ # MIT License
+ # metadata.rb has been released under MIT (*only this file*).
+
+ module Metadata
+ def metadata_file_path
+ "metadata/game_metadata.txt"
+ end
+
+ def get_metadata
+ metadata = $gtk.read_file metadata_file_path
+
+ if !metadata
+ write_blank_metadata
+ metadata = $gtk.read_file metadata_file_path
+ end
+
+ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
+
+ {
+ dev_id: dev_id.strip,
+ dev_title: dev_title.strip,
+ game_id: game_id.strip,
+ game_title: game_title.strip,
+ version: version.strip,
+ icon: icon.strip
+ }
+ end
+
+ def write_blank_metadata
+ $gtk.write_file metadata_file_path, <<-S.strip
+ #devid=myname
+ #devtitle=My Name
+ #gameid=mygame
+ #gametitle=My Game
+ #version=0.1
+ #icon=metadata/icon.png
+ S
+ end
+ end
+
+#+end_src
+
*** numeric.rb
#+begin_src ruby
# ./dragon/numeric.rb
@@ -41553,6 +43698,35 @@ Follows is a source code listing for all files that have been open sourced. This
alias_method :lte, :<=
alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__
+ def to_layout_row opts = {}
+ $layout.rect(row: self,
+ col: opts.col || 0,
+ w: opts.w || 0,
+ h: opts.h || 0).y
+ end
+
+ def to_layout_col opts = {}
+ $layout.rect(row: 0,
+ col: self,
+ w: opts.w || 0,
+ h: opts.h || 0).x
+ end
+
+ def to_layout_w
+ $layout.rect(row: 0, col: 0, w: self, h: 1).w
+ end
+
+ def to_layout_h
+ $layout.rect(row: 0, col: 0, w: 1, h: self).h
+ end
+
+ def to_layout_row_from_bottom opts = {}
+ ($layout.row_max_index - self).to_layout_row opts
+ end
+
+ def to_layout_col_from_right opts = {}
+ ($layout.col_max_index - self).to_layout_col opts
+ end
# Converts a numeric value representing seconds into frames.
#
@@ -41568,10 +43742,26 @@ Follows is a source code listing for all files that have been open sourced. This
self / 2.0
end
+ def third
+ self / 3.0
+ end
+
+ def quarter
+ self / 4.0
+ end
+
def to_byte
clamp(0, 255).to_i
end
+ def clamp *opts
+ min = (opts.at 0)
+ max = (opts.at 1)
+ return min if min && self < min
+ return max if max && self > max
+ return self
+ end
+
def clamp_wrap min, max
max, min = min, max if min > max
return self if self >= min && self <= max
@@ -41796,7 +43986,7 @@ Follows is a source code listing for all files that have been open sourced. This
self * Math::PI.fdiv(180)
end
- # Converts a number representing an angle in radians to degress.
+ # Converts a number representing an angle in radians to degrees.
#
# @gtk
def to_degrees
@@ -41813,21 +44003,21 @@ Follows is a source code listing for all files that have been open sourced. This
GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y)
end
- # Returns a normal vector for a number that represents an angle in degress.
+ # Returns a normal vector for a number that represents an angle in degrees.
#
# @gtk
def vector max_value = 1
[vector_x(max_value), vector_y(max_value)]
end
- # Returns the y component of a normal vector for a number that represents an angle in degress.
+ # Returns the y component of a normal vector for a number that represents an angle in degrees.
#
# @gtk
def vector_y max_value = 1
max_value * Math.sin(self.to_radians)
end
- # Returns the x component of a normal vector for a number that represents an angle in degress.
+ # Returns the x component of a normal vector for a number that represents an angle in degrees.
#
# @gtk
def vector_x max_value = 1
@@ -41854,6 +44044,18 @@ Follows is a source code listing for all files that have been open sourced. This
(self % n) == 0
end
+ def multiply n
+ self * n
+ end
+
+ def fmult n
+ self * n.to_f
+ end
+
+ def imult n
+ (self * n).to_i
+ end
+
def mult n
self * n
end
@@ -41975,12 +44177,6 @@ Follows is a source code listing for all files that have been open sourced. This
return gt other
end
- def == other
- return true if __original_eq_eq__ other
- return __original_eq_eq__ other.entity_id if other.is_a? OpenEntity
- return false
- end
-
# @gtk
def map
unless block_given?
@@ -42067,29 +44263,29 @@ Follows is a source code listing for all files that have been open sourced. This
end
def - other
- return nil unless other
- super
+ return self unless other
+ self - other
rescue Exception => e
__raise_arithmetic_exception__ other, :-, e
end
def + other
- return nil unless other
- super
+ return self unless other
+ self + other
rescue Exception => e
__raise_arithmetic_exception__ other, :+, e
end
def * other
- return nil unless other
- super
+ return self unless other
+ self * other
rescue Exception => e
__raise_arithmetic_exception__ other, :*, e
end
def / other
- return nil unless other
- super
+ return self unless other
+ self / other
rescue Exception => e
__raise_arithmetic_exception__ other, :/, e
end
@@ -42119,6 +44315,10 @@ Follows is a source code listing for all files that have been open sourced. This
def self.clamp n, min, max
n.clamp min, max
end
+
+ def mid? l, r
+ (between? l, r) || (between? r, l)
+ end
end
class Fixnum
@@ -42145,39 +44345,33 @@ Follows is a source code listing for all files that have been open sourced. This
end
def + other
- return nil unless other
- super
+ return self unless other
+ self + other
rescue Exception => e
__raise_arithmetic_exception__ other, :+, e
end
def * other
- return nil unless other
- super
+ return self unless other
+ self * other
rescue Exception => e
__raise_arithmetic_exception__ other, :*, e
end
def / other
- return nil unless other
- super
+ return self unless other
+ self / other
rescue Exception => e
__raise_arithmetic_exception__ other, :/, e
end
def - other
- return nil unless other
- super
+ return self unless other
+ self - other
rescue Exception => e
__raise_arithmetic_exception__ other, :-, e
end
- def == other
- return true if __original_eq_eq__ other
- return __original_eq_eq__ other.entity_id if other.is_a? GTK::OpenEntity
- return false
- 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`.
#
@@ -42234,28 +44428,28 @@ Follows is a source code listing for all files that have been open sourced. This
alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__
def - other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :-, e
end
def + other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :+, e
end
def * other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :*, e
end
def / other
- return nil unless other
+ return self unless other
super
rescue Exception => e
__raise_arithmetic_exception__ other, :/, e
@@ -42302,6 +44496,10 @@ Follows is a source code listing for all files that have been open sourced. This
def nan?
false
end
+
+ def center other
+ (self - other).abs.fdiv(2)
+ end
end
#+end_src
@@ -42358,7 +44556,7 @@ Follows is a source code listing for all files that have been open sourced. This
def local_state
@local_state ||= OpenEntity.new
@local_state.hotload_client ||= @local_state.new_entity(:hotload_client,
- notes: "This enitity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",
+ notes: "This entity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",
changes: { },
changes_queue: [],
reloaded_files_times: [])
@@ -42534,7 +44732,7 @@ Follows is a source code listing for all files that have been open sourced. This
sub_index = index - previous_line[:sum]
word = (cursor_line[:line][0..sub_index - 1]).strip
token = (word.split " ")[-1]
- dots = (token.split ".")
+ dots = (token.split ".").flat_map { |s| s.split "[" }.flat_map { |s| s.split "]" }.flat_map { |s| s.split "(" }.flat_map { |s| s.split ")" }
dot = dots[-1]
end
@@ -42555,6 +44753,10 @@ Follows is a source code listing for all files that have been open sourced. This
ignores ||= []
ignores = [ignores].flatten
keys = keys.map { |k| k.to_s }
+ keys = keys.reject { |k| k.include? '"' }
+ .reject { |k| k.start_with? "'" }
+ .reject { |k| k.include? "," }
+ .reject { |k| k.start_with? "#" }
others = ["def", "end"] +
[ :entity_keys_by_ref,
:entity_name,
@@ -42612,6 +44814,10 @@ Follows is a source code listing for all files that have been open sourced. This
return autocomplete_filter_methods lookup_result.call if lookup_result
+ if dot[0].upcase == dot[0] && (Object.const_defined? dot.to_sym)
+ return (Object.const_get dot.to_sym).autocomplete_methods
+ end
+
start_collecting = false
dots_after_state = dots.find_all do |s|
if s == "state"
@@ -42627,10 +44833,16 @@ Follows is a source code listing for all files that have been open sourced. This
target = target.as_hash[k.to_sym] if target.respond_to? :as_hash
end
- return autocomplete_filter_methods target.as_hash.keys
+ if target.respond_to? :as_hash
+ return autocomplete_filter_methods target.as_hash.keys
+ else
+ return autocomplete_filter_methods target.autocomplete_methods
+ end
end
+ text = text.each_line.reject { |l| l.strip.start_with? "#" }.join "\n"
+ text = text.each_line.map { |l| l.split("#").first }.join "\n"
text.gsub!("[", " ")
text.gsub!("]", " ")
text.gsub!("(", " ")
@@ -42647,154 +44859,158 @@ Follows is a source code listing for all files that have been open sourced. This
#+end_src
-*** runtime/draw.rb
+*** runtime/benchmark.rb
#+begin_src ruby
- # ./dragon/runtime/draw.rb
+ # ./dragon/runtime/benchmark.rb
# Copyright 2019 DragonRuby LLC
# MIT License
- # draw.rb has been released under MIT (*only this file*).
+ # benchmark.rb has been released under MIT (*only this file*).
module GTK
class Runtime
- module Draw
- def primitives pass
- if $top_level.respond_to? :primitives_override
- return $top_level.tick_render @args, pass
- end
-
- # Don't change this draw order unless you understand
- # the implications.
-
- # pass.solids.each { |s| draw_solid s }
- # while loops are faster than each with block
- idx = 0
- length = pass.solids.length
- while idx < pass.solids.length
- draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster
- idx += 1
- end
-
- # pass.static_solids.each { |s| draw_solid s }
+ module Benchmark
+ def benchmark_single iterations, name, proc
+ log <<-S
+ ** Invoking :#{name}...
+ S
+ time_start = Time.now
idx = 0
- length = pass.static_solids.length
- while idx < length
- draw_solid (pass.static_solids.at idx)
+ r = nil
+ while idx < iterations
+ r = proc.call
idx += 1
end
- # pass.sprites.each { |s| draw_sprite s }
- idx = 0
- length = pass.sprites.length
- while idx < length
- draw_sprite (pass.sprites.at idx)
- idx += 1
- end
+ result = (Time.now - time_start).round 3
- # pass.static_sprites.each { |s| draw_sprite s }
- idx = 0
- length = pass.static_sprites.length
- while idx < length
- draw_sprite (pass.static_sprites.at idx)
- idx += 1
- end
+ { name: name,
+ time: result,
+ time_ms: (result * 1000).to_i }
+ end
- # pass.primitives.each { |p| draw_primitive p }
- idx = 0
- length = pass.primitives.length
- while idx < length
- draw_primitive (pass.primitives.at idx)
- idx += 1
- end
+ def benchmark opts = {}
+ iterations = opts.iterations
- # pass.static_primitives.each { |p| draw_primitive p }
- idx = 0
- length = pass.static_primitives.length
- while idx < length
- draw_primitive (pass.static_primitives.at idx)
- idx += 1
- end
+ log <<-S
+ * BENCHMARK: Started
+ ** Caller: #{(caller || []).first}
+ ** Iterations: #{iterations}
+ S
+ procs = opts.find_all { |k, v| v.respond_to? :call }
+
+ times = procs.map do |(name, proc)|
+ benchmark_single iterations, name, proc
+ end.sort_by { |r| r.time }
+
+ first_place = times.first
+ second_place = times.second || first_place
+
+ times = times.map do |candidate|
+ average_time = first_place.time
+ .add(candidate.time)
+ .abs
+ .fdiv(2)
+
+ difference_percentage = 0
+ if average_time == 0
+ difference_percentage = 0
+ else
+ difference_percentage = first_place.time
+ .subtract(candidate.time)
+ .abs
+ .fdiv(average_time)
+ .imult(100)
+ end
- # pass.labels.each { |l| draw_label l }
- idx = 0
- length = pass.labels.length
- while idx < length
- draw_label (pass.labels.at idx)
- idx += 1
+ difference_time = ((first_place.time - candidate.time) * 1000).round
+ candidate.merge(difference_percentage: difference_percentage,
+ difference_time: difference_time)
end
- # pass.static_labels.each { |l| draw_label l }
- idx = 0
- length = pass.static_labels.length
- while idx < length
- draw_label (pass.static_labels.at idx)
- idx += 1
+ too_small_to_measure = false
+ if (first_place.time + second_place.time) == 0
+ too_small_to_measure = true
+ difference_percentage = 0
+ log <<-S
+ * BENCHMARK: Average time for experiments were too small. Increase the number of iterations.
+ S
+ else
+ difference_percentage = (((first_place.time - second_place.time).abs.fdiv((first_place.time + second_place.time).abs.fdiv(2))) * 100).round
end
- # pass.lines.each { |l| draw_line l }
- idx = 0
- length = pass.lines.length
- while idx < length
- draw_line (pass.lines.at idx)
- idx += 1
- end
+ difference_time = first_place.time.-(second_place.time).*(1000).abs.round
- # pass.static_lines.each { |l| draw_line l }
- idx = 0
- length = pass.static_lines.length
- while idx < pass.static_lines.length
- draw_line (pass.static_lines.at idx)
- idx += 1
- end
+ r = {
+ iterations: iterations,
+ first_place: first_place,
+ second_place: second_place,
+ difference_time: difference_time,
+ difference_percentage: difference_percentage,
+ times: times,
+ too_small_to_measure: too_small_to_measure
+ }
- # pass.borders.each { |b| draw_border b }
- idx = 0
- length = pass.borders.length
- while idx < length
- draw_border (pass.borders.at idx)
- idx += 1
- end
+ log_message = []
+ only_one_result = first_place.name == second_place.name
- # pass.static_borders.each { |b| draw_border b }
- idx = 0
- length = pass.static_borders.length
- while idx < length
- draw_border (pass.static_borders.at idx)
- idx += 1
+ if only_one_result
+ log <<-S
+ * BENCHMARK: #{r.first_place.name} completed in #{r.first_place.time_ms}ms."
+ S
+ else
+ log <<-S
+ * BENCHMARK: #{r.message}
+ ** Fastest: #{r.first_place.name.inspect}
+ ** Second: #{r.second_place.name.inspect}
+ ** Margin: #{r.difference_percentage}% (#{r.difference_time.abs}ms) #{r.first_place.time_ms}ms vs #{r.second_place.time_ms}ms.
+ ** Times:
+ #{r.times.map { |t| "*** #{t.name}: #{t.time_ms}ms (#{t.difference_percentage}% #{t.difference_time.abs}ms)." }.join("\n")}
+ S
end
- if !$gtk.production
- # pass.debug.each { |r| draw_primitive r }
- idx = 0
- length = pass.debug.length
- while idx < length
- draw_primitive (pass.debug.at idx)
- idx += 1
- end
+ r
+ end
+ end
+ end
+ end
+
+#+end_src
+
+*** runtime/draw.rb
+#+begin_src ruby
+ # ./dragon/runtime/draw.rb
+ # Copyright 2019 DragonRuby LLC
+ # MIT License
+ # draw.rb has been released under MIT (*only this file*).
- # pass.static_debug.each { |r| draw_primitive r }
- idx = 0
- length = pass.static_debug.length
- while idx < length
- draw_primitive (pass.static_debug.at idx)
- idx += 1
- end
+ module GTK
+ class Runtime
+ module Draw
+ def primitives pass
+ if $top_level.respond_to? :primitives_override
+ return $top_level.tick_render @args, pass
end
- # pass.reserved.each { |r| draw_primitive r }
- idx = 0
- length = pass.reserved.length
- while idx < length
- draw_primitive (pass.reserved.at idx)
- idx += 1
- end
+ fn.each_send pass.solids, self, :draw_solid
+ fn.each_send pass.static_solids, self, :draw_solid
+ fn.each_send pass.sprites, self, :draw_sprite
+ fn.each_send pass.static_sprites, self, :draw_sprite
+ fn.each_send pass.primitives, self, :draw_primitive
+ fn.each_send pass.static_primitives, self, :draw_primitive
+ fn.each_send pass.labels, self, :draw_label
+ fn.each_send pass.static_labels, self, :draw_label
+ fn.each_send pass.lines, self, :draw_line
+ fn.each_send pass.static_lines, self, :draw_line
+ fn.each_send pass.borders, self, :draw_border
+ fn.each_send pass.static_borders, self, :draw_border
- # pass.static_reserved.each { |r| draw_primitive r }
- idx = 0
- length = pass.static_reserved.length
- while idx < length
- draw_primitive (pass.static_reserved.at idx)
- idx += 1
+ if !$gtk.production
+ fn.each_send pass.debug, self, :draw_primitive
+ fn.each_send pass.static_debug, self, :draw_primitive
end
+
+ fn.each_send pass.reserved, self, :draw_primitive
+ fn.each_send pass.static_reserved, self, :draw_primitive
rescue Exception => e
pause!
pretty_print_exception_and_export! e
@@ -42805,7 +45021,9 @@ 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
- @ffi_draw.draw_solid s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a
+ @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)
end
rescue Exception => e
raise_conversion_for_rendering_failed s, e, :solid
@@ -42816,14 +45034,15 @@ 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
- @ffi_draw.draw_sprite_3 s.x, s.y, s.w, s.h,
- s.path.s_or_default,
+ @ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,
+ (s.path || '').to_s,
s.angle,
s.a, s.r, s.g, s.b,
s.tile_x, s.tile_y, s.tile_w, s.tile_h,
!!s.flip_horizontally, !!s.flip_vertically,
s.angle_anchor_x, s.angle_anchor_y,
- s.source_x, s.source_y, s.source_w, s.source_h
+ s.source_x, s.source_y, s.source_w, s.source_h,
+ (s.blendmode_enum || 1)
end
rescue Exception => e
raise_conversion_for_rendering_failed s, e, :sprite
@@ -42834,7 +45053,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
- @ffi_draw.draw_screenshot s.path.s_or_default,
+ @ffi_draw.draw_screenshot (s.path || '').to_s,
s.x, s.y, s.w, s.h,
s.angle,
s.a, s.r, s.g, s.b,
@@ -42852,10 +45071,13 @@ 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
- @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,
- l.size_enum, l.alignment_enum,
- l.r, l.g, l.b, l.a,
- l.font.s_or_default(nil)
+ @ffi_draw.draw_label_3 l.x, l.y,
+ (l.text || '').to_s,
+ l.size_enum, l.alignment_enum,
+ l.r, l.g, l.b, l.a,
+ l.font,
+ (l.vertical_alignment_enum || 2),
+ (l.blendmode_enum || 1)
end
rescue Exception => e
raise_conversion_for_rendering_failed l, e, :label
@@ -42866,7 +45088,21 @@ 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
- @ffi_draw.draw_line l.x, l.y, l.x2, l.y2, l.r, l.g, l.b, l.a
+ if l.x2
+ @ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,
+ l.r, l.g, l.b, l.a,
+ (l.blendmode_enum || 1)
+ else
+ w = l.w || 0
+ w = 1 if w == 0
+ h = l.h || 0
+ h = 1 if h == 0
+ @ffi_draw.draw_line_2 l.x, l.y,
+ l.x + w - 1,
+ l.y + h - 1,
+ l.r, l.g, l.b, l.a,
+ (l.blendmode_enum || 1)
+ end
end
rescue Exception => e
raise_conversion_for_rendering_failed l, e, :line
@@ -42877,7 +45113,9 @@ 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
- @ffi_draw.draw_border s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a
+ @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)
end
rescue Exception => e
raise_conversion_for_rendering_failed s, e, :border
@@ -42897,7 +45135,6 @@ Follows is a source code listing for all files that have been open sourced. This
pause!
pretty_print_exception_and_export! e
end
-
end
end
end
@@ -43113,7 +45350,7 @@ Follows is a source code listing for all files that have been open sourced. This
def framerate_diagnostics_primitives
[
- { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid,
+ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid!,
{
x: 5,
y: 5.from_top,
@@ -43122,7 +45359,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 20.from_top,
@@ -43131,7 +45368,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 35.from_top,
@@ -43140,7 +45377,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 50.from_top,
@@ -43149,7 +45386,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
{
x: 5,
y: 65.from_top,
@@ -43158,7 +45395,7 @@ Follows is a source code listing for all files that have been open sourced. This
g: 255,
b: 255,
size_enum: -2
- }.label,
+ }.label!,
]
end
@@ -43183,7 +45420,14 @@ Follows is a source code listing for all files that have been open sourced. This
def hotload_init
@hotload_if_needed = 0
@mailbox_if_needed = 0
+
+ # schema for file_mtimes
+ # { FILE_PATH: { current: (Time as Fixnum),
+ # last: (Time as Fixnum) },
+ # FILE_PATH: { current: (Time as Fixnum),
+ # last: (Time as Fixnum) } }
@file_mtimes = { }
+
@suppress_mailbox = true
files_to_reload.each { |f| init_mtimes f }
init_mtimes 'app/mailbox.rb'
@@ -43221,6 +45465,7 @@ Follows is a source code listing for all files that have been open sourced. This
'dragon/symbol.rb',
'dragon/numeric_deprecated.rb',
'dragon/numeric.rb',
+ 'dragon/hash_deprecated.rb',
'dragon/hash.rb',
'dragon/outputs_deprecated.rb',
'dragon/array_docs.rb',
@@ -43253,6 +45498,7 @@ Follows is a source code listing for all files that have been open sourced. This
'dragon/trace.rb',
'dragon/readme_docs.rb',
'dragon/hotload_client.rb',
+ 'dragon/wizards.rb',
'dragon/ios_wizard.rb',
'dragon/itch_wizard.rb',
] + core_files_to_reload + @required_files
@@ -43271,10 +45517,8 @@ Follows is a source code listing for all files that have been open sourced. This
end
def init_mtimes file
- current_key = "current_#{file}".to_sym
- last_key = "last_#{file}".to_sym
- @file_mtimes[current_key] ||= @ffi_file.mtime(file)
- @file_mtimes[last_key] ||= @ffi_file.mtime(file)
+ @file_mtimes[file] ||= { current: @ffi_file.mtime(file),
+ last: @ffi_file.mtime(file) }
end
def hotload_source_files
@@ -43306,25 +45550,36 @@ Follows is a source code listing for all files that have been open sourced. This
end
def hotload_if_needed
+ return if Kernel.tick_count < 0
hotload_source_files
check_mailbox
end
def on_load_succeeded file
- @rcb_sender.files_reloaded << file
- @rcb_sender.reloaded_files << file
+ self.files_reloaded << file
+ self.reloaded_files << file
Trace.untrace_classes!
end
+ def reset_all_mtimes
+ @file_mtimes.each do |file, _|
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+ @file_mtimes[file].last = @file_mtimes[file].current
+ end
+
+ files_to_reload.each do |file, _|
+ @file_mtimes[file] ||= {}
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+ @file_mtimes[file].last = @file_mtimes[file].current
+ end
+ end
+
def reload_if_needed file, force = false
- current_key = "current_#{file}".to_sym
- last_key = "last_#{file}".to_sym
- @file_mtimes[current_key] ||= nil
- @file_mtimes[last_key] ||= nil
- @file_mtimes[current_key] = @ffi_file.mtime(file)
- return if !force && @file_mtimes[last_key] == @file_mtimes[current_key]
+ @file_mtimes[file] ||= { current: @ffi_file.mtime(file), last: @ffi_file.mtime(file) }
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+ return if !force && @file_mtimes[file].current == @file_mtimes[file].last
on_load_succeeded file if reload_ruby_file file
- @file_mtimes[last_key] = @file_mtimes[current_key]
+ @file_mtimes[file].last = @file_mtimes[file].current
end
end
end
@@ -43366,6 +45621,30 @@ Follows is a source code listing for all files that have been open sourced. This
end
end
+ def char_byte
+ return nil if self.length == 0
+ c = self.each_char.first.bytes
+ c = c.first if c.is_a? Enumerable
+ c
+ end
+
+ def insert_character_at index, char
+ t = each_char.to_a
+ t = (t.insert index, char)
+ t.join
+ end
+
+ def excluding_character_at index
+ t = each_char.to_a
+ t.delete_at index
+ t.join
+ end
+
+ def excluding_last_character
+ return "" if self.length <= 1
+ return excluding_character_at(self.length - 1)
+ end
+
def end_with_bang?
self[-1] == "!"
end
@@ -43583,7 +45862,7 @@ Follows is a source code listing for all files that have been open sourced. This
log "#{self.failed.length} test(s) failed."
self.failed.each do |h|
log "**** Test name: :#{h[:m]}"
- log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"
+ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}\n#{h[:e].__backtrace_to_org__}"
end
end
end
@@ -43788,6 +46067,40 @@ Follows is a source code listing for all files that have been open sourced. This
# MIT License
# wizards.rb has been released under MIT (*only this file*).
+ class Wizard
+ def metadata_file_path
+ "metadata/game_metadata.txt"
+ end
+
+ def get_metadata
+ metadata = $gtk.read_file metadata_file_path
+
+ if !metadata
+ write_blank_metadata
+ metadata = $gtk.read_file metadata_file_path
+ end
+
+ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
+
+ {
+ dev_id: dev_id.strip.gsub("#", "").gsub("devid=", ""),
+ dev_title: dev_title.strip.gsub("#", "").gsub("devtitle=", ""),
+ game_id: game_id.strip.gsub("#", "").gsub("gameid=", ""),
+ game_title: game_title.strip.gsub("#", "").gsub("gametitle=", ""),
+ version: version.strip.gsub("#", "").gsub("version=", ""),
+ icon: icon.strip.gsub("#", "").gsub("icon=", "")
+ }
+ end
+ end
+
+ class WizardException < Exception
+ attr_accessor :console_primitives
+
+ def initialize *console_primitives
+ @console_primitives = console_primitives
+ end
+ end
+
module GTK
class Wizards
attr_accessor :ios, :itch
diff --git a/docs/parse_log.txt b/docs/parse_log.txt
index 5f10281..4e43983 100644
--- a/docs/parse_log.txt
+++ b/docs/parse_log.txt
@@ -40,11 +40,6 @@ To search docs you can type ~docs_search "SEARCH TERM"~ or if you want to get fa
- End of paragraph detected.
*** True Line Result
-** Processing line: ~[[docs_search.gif]]~
-** Processing line: ~~
-- End of paragraph detected.
-*** True Line Result
-[[docs_search.gif]]
** Processing line: ~* Hello World~
- Header detected.
*** True Line Result
@@ -126,50 +121,91 @@ I am a Dragon Rider.
- End of paragraph detected.
*** True Line Result
-** Processing line: ~* Watch Some Intro Videos~
+** Processing line: ~* Intro Videos~
- Header detected.
*** True Line Result
*** True Line Result
-* Watch Some Intro Videos
+* Intro Videos
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-** Processing line: ~Each video is only 20 minutes and all of them will fit into a lunch~
-** Processing line: ~break. So please watch them:~
+** Processing line: ~Here are some videos to help you get the lay of the land.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-Each video is only 20 minutes and all of them will fit into a lunch break. So please watch them:
+Here are some videos to help you get the lay of the land.
+** Processing line: ~** Quick Api Tour~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** Quick Api Tour
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~
- Line was identified as a start of a list.
*** True Line Result
-** Processing line: ~2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~
-- Line was identified as a continuation of a list.
+** Processing line: ~~
+- End of paragraph detected.
*** True Line Result
1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]
-** Processing line: ~3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~
+** Processing line: ~** If You Are Completely New to Ruby and Programming~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** If You Are Completely New to Ruby and Programming
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~1. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~
+- Line was identified as a start of a list.
+*** True Line Result
+
+** Processing line: ~2. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~
- Line was identified as a continuation of a list.
*** True Line Result
-2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]
+1. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]
+** Processing line: ~3. You may also want to try this free course provided at [[http://dragonruby.school]].~
+- Line was identified as a continuation of a list.
+*** True Line Result
+2. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]
-** Processing line: ~The second and third videos are not required if you are proficient~
-** Processing line: ~with Ruby, but *definitely* watch the first one.~
+3. You may also want to try this free course provided at [[http://dragonruby.school]].
+** Processing line: ~** If You Have Game Dev Experience~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** If You Have Game Dev Experience
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-The second and third videos are not required if you are proficient with Ruby, but *definitely* watch the first one.
-** Processing line: ~You may also want to try this free course provided at~
-** Processing line: ~[[http://dragonruby.school]].~
+
+** Processing line: ~1. Building Tetris - Part 1: [[https://youtu.be/xZMwRSbC4rY]]~
+- Line was identified as a start of a list.
+*** True Line Result
+
+** Processing line: ~2. Building Tetris - Part 2: [[https://youtu.be/C3LLzDUDgz4]]~
+- Line was identified as a continuation of a list.
+*** True Line Result
+1. Building Tetris - Part 1: [[https://youtu.be/xZMwRSbC4rY]]
+** Processing line: ~3. Low Res Game Jam Tutorial: [[https://youtu.be/pCI90ukKCME]]~
+- Line was identified as a continuation of a list.
+*** True Line Result
+2. Building Tetris - Part 2: [[https://youtu.be/C3LLzDUDgz4]]
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-You may also want to try this free course provided at [[http://dragonruby.school]].
+3. Low Res Game Jam Tutorial: [[https://youtu.be/pCI90ukKCME]]
** Processing line: ~* Getting Started Tutorial~
- Header detected.
*** True Line Result
@@ -1115,7 +1151,7 @@ If you have a Pro subscription, you also have the capability to deploy to mobile
*** True Line Result
To deploy to iOS, you need to have a Mac running MacOS Catalina, an iOS device, and an active/paid Developer Account with Apple. From the Console type: ~$wizards.ios.start~ and you will be guided through the deployment process.
** Processing line: ~To deploy to Android, you need to have an Android emulator/device, and~
-** Processing line: ~a environment that is able to run Android SDK. ~dragonruby-publish~~
+** Processing line: ~an environment that is able to run Android SDK. ~dragonruby-publish~~
** Processing line: ~will create an APK for you. From there, you can sign the APK and~
** Processing line: ~install it to your device. The signing and installation procedure~
** Processing line: ~varies from OS to OS. Here's an example of what the command might look~
@@ -1123,7 +1159,7 @@ To deploy to iOS, you need to have a Mac running MacOS Catalina, an iOS device,
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-To deploy to Android, you need to have an Android emulator/device, and a environment that is able to run Android SDK. ~dragonruby-publish~ will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:
+To deploy to Android, you need to have an Android emulator/device, and an environment that is able to run Android SDK. ~dragonruby-publish~ will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:
** Processing line: ~#+begin_src~
- Line was identified as the beginning of a code block.
*** True Line Result
@@ -1168,11 +1204,11 @@ To deploy to Android, you need to have an Android emulator/device, and a environ
** Processing line: ~game engines. Given that Game Toolkit is a relatively new engine,~
** Processing line: ~there are definitely features that are missing. So having a big check~
** Processing line: ~list of "all the cool things" is not this engine's forte. This is~
-** Processing line: ~compensated with a strong commitment to the following principals.~
+** Processing line: ~compensated with a strong commitment to the following principles.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principals.
+The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principles.
** Processing line: ~** Challenge The Status Quo~
- Header detected.
*** True Line Result
@@ -1238,16 +1274,16 @@ There is a programming idiom in software called "The Pit of Success". The term n
** Processing line: ~DragonRuby's philosophy is to provide multiple options across the "make it~
** Processing line: ~fast" vs "make it right" spectrum, with incremental/intuitive~
** Processing line: ~transitions between the options provided. A concrete example of this philosophy~
-** Processing line: ~would be render primitives: the spectrum of options allows renderable constructs take~
-** Processing line: ~the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with),~
+** Processing line: ~would be render primitives: the spectrum of options allows renderable constructs that~
+** Processing line: ~take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with),~
** Processing line: ~hashes (a little more work, but gives you the ability to add additional properties),~
-** Processing line: ~open and string entities (more work than hashes, but yields cleaner apis),~
+** Processing line: ~open and strict entities (more work than hashes, but yields cleaner apis),~
** Processing line: ~and finally - if you really need full power/flexibility in rendering - classes~
** Processing line: ~(which take the most amount of code and programming knowledge to create).~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and string entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).
+DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs that take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and strict entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).
** Processing line: ~** Release Early and Often~
- Header detected.
*** True Line Result
@@ -1558,11 +1594,11 @@ The elevator pitch is:
** Processing line: ~DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels"~
** Processing line: ~within the runtime allows us to target platforms no other Ruby can~
** Processing line: ~target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo~
-** Processing line: ~Switch, PS4, Xbox, and Scadia.~
+** Processing line: ~Switch, PS4, Xbox, and Stadia.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Scadia.
+DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Stadia.
** Processing line: ~**** What does Multilevel Cross-platform mean?~
- Header detected.
*** True Line Result
@@ -1770,14 +1806,14 @@ You can use DragonRuby's Console within the game to inspect object and execute s
- End of paragraph detected.
*** True Line Result
- If you use the `repl` method, the code will be executed and the DragonRuby Console will automatically open so you can see the results (on Mac and Linux, the results will also be printed to the terminal).
-** Processing line: ~- All ~puts~ statements will also be saved to ~logs/log.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.~
+** Processing line: ~- All ~puts~ statements will also be saved to ~logs/puts.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.~
- Line was identified as a list.
*** True Line Result
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-- All ~puts~ statements will also be saved to ~logs/log.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.
+- All ~puts~ statements will also be saved to ~logs/puts.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.
** Processing line: ~4. To ignore code in ~repl.rb~, instead of commenting it out, prefix ~repl~ with the letter ~x~ and it'll be ignored.~
** Processing line: ~~
- End of paragraph detected.
@@ -1897,14 +1933,14 @@ You can use DragonRuby's replay capabilities to troubleshoot:
- Line was identified as a start of a list.
*** True Line Result
-** Processing line: ~2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recoding by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.~
+** Processing line: ~2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recording by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.~
- Line was identified as a continuation of a list.
*** True Line Result
1. DragonRuby is hot loaded which gives you a very fast feedback loop (if the game throws an exception, it's because of the code you just added).
** Processing line: ~3. DragonRuby also ships with a unit testing facility. You can invoke the following command to run a test: ~./dragonruby . --eval some_ruby_file.rb --no-tick~.~
- Line was identified as a continuation of a list.
*** True Line Result
-2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recoding by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.
+2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recording by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.
** Processing line: ~4. Get into the habit of adding debugging facilities within the game itself. You can add drawing primitives to ~args.outputs.debug~ that will render on top of your game but will be ignored in a production release.~
- Line was identified as a continuation of a list.
*** True Line Result
@@ -1944,11 +1980,11 @@ You can use DragonRuby's replay capabilities to troubleshoot:
*** True Line Result
Let's check the official source for the answer to this question: isrubydead.com: [[https://isrubydead.com/]].
** Processing line: ~On a more serious note, Ruby's _quantity_ levels aren't what they used~
-** Processing line: ~to be. And that's totally fine. Every one chases the new and shiny.~
+** Processing line: ~to be. And that's totally fine. Everyone chases the new and shiny.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Every one chases the new and shiny.
+On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Everyone chases the new and shiny.
** Processing line: ~What really matters is _quality/maturity_. Here is the latest (StackOverflow~
** Processing line: ~Survey sorted by highest paid developers)[https://insights.stackoverflow.com/survey/2019#top-paying-technologies].~
** Processing line: ~~
@@ -2134,16 +2170,14 @@ Just contact Amir at [email protected] with a short explanation of your
- End of paragraph detected.
*** True Line Result
-** Processing line: ~You can try our [web-based sandbox environment](). But it won't do the~
-** Processing line: ~runtime justice. Or just come to our [Slack]() or [Discord]() channel~
-** Processing line: ~and ask questions. We'd be happy to have a one on one video chat with~
-** Processing line: ~you and show off all the cool stuff we're doing.~
+** Processing line: ~You can try our web-based sandbox environment at [[http://fiddle.dragonruby.org]]. But it won't do the~
+** Processing line: ~runtime justice. Or just come to our Discord Channel at [[http://discord.dragonruby.org]] and ask questions.~
+** Processing line: ~We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-You can try our [web-based sandbox environment](). But it won't do the runtime justice. Or just come to our [Slack]() or [Discord]() channel and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.
-** Processing line: ~Seriously just buy it. Get a refund if you don't like it. We make it~
-** Processing line: ~stupid easy to do so.~
+You can try our web-based sandbox environment at [[http://fiddle.dragonruby.org]]. But it won't do the runtime justice. Or just come to our Discord Channel at [[http://discord.dragonruby.org]] and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.
+** Processing line: ~Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
@@ -2556,10 +2590,14 @@ You can represent a sprite as a ~Hash~:
- Inside source: true
*** True Line Result
angle_anchor_x: 0.5,
-** Processing line: ~ angle_anchor_y: 1.0~
+** Processing line: ~ angle_anchor_y: 1.0,~
+- Inside source: true
+*** True Line Result
+ angle_anchor_y: 1.0,
+** Processing line: ~ blendmode_enum: 1~
- Inside source: true
*** True Line Result
- angle_anchor_y: 1.0
+ blendmode_enum: 1
** Processing line: ~ }~
- Inside source: true
*** True Line Result
@@ -2576,6 +2614,12 @@ You can represent a sprite as a ~Hash~:
- End of paragraph detected.
*** True Line Result
+** Processing line: ~The ~blendmode_enum~ value can be set to ~0~ (no blending), ~1~ (alpha blending),~
+** Processing line: ~~2~ (additive blending), ~3~ (modulo blending), ~4~ (multiply blending).~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+The ~blendmode_enum~ value can be set to ~0~ (no blending), ~1~ (alpha blending), ~2~ (additive blending), ~3~ (modulo blending), ~4~ (multiply blending).
** Processing line: ~You can represent a sprite as an ~object~:~
** Processing line: ~~
- End of paragraph detected.
@@ -2611,10 +2655,10 @@ You can represent a sprite as an ~object~:
- Inside source: true
*** True Line Result
:flip_horizontally, :flip_vertically,
-** Processing line: ~ :angle_anchor_x, :angle_anchor_y~
+** Processing line: ~ :angle_anchor_x, :angle_anchor_y, :blendmode_enum~
- Inside source: true
*** True Line Result
- :angle_anchor_x, :angle_anchor_y
+ :angle_anchor_x, :angle_anchor_y, :blendmode_enum
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -2941,46 +2985,50 @@ You can add additional metadata about your game within a label, which requires y
- Inside source: true
*** True Line Result
args.outputs.labels << {
-** Processing line: ~ x: 200,~
+** Processing line: ~ x: 200,~
- Inside source: true
*** True Line Result
- x: 200,
-** Processing line: ~ y: 550,~
+ x: 200,
+** Processing line: ~ y: 550,~
- Inside source: true
*** True Line Result
- y: 550,
-** Processing line: ~ text: "dragonruby",~
+ y: 550,
+** Processing line: ~ text: "dragonruby",~
- Inside source: true
*** True Line Result
- text: "dragonruby",
-** Processing line: ~ size_enum: 2,~
+ text: "dragonruby",
+** Processing line: ~ size_enum: 2,~
- Inside source: true
*** True Line Result
- size_enum: 2,
-** Processing line: ~ alignment_enum: 1,~
+ size_enum: 2,
+** Processing line: ~ alignment_enum: 1,~
- Inside source: true
*** True Line Result
- alignment_enum: 1,
-** Processing line: ~ r: 155,~
+ alignment_enum: 1,
+** Processing line: ~ r: 155,~
- Inside source: true
*** True Line Result
- r: 155,
-** Processing line: ~ g: 50,~
+ r: 155,
+** Processing line: ~ g: 50,~
- Inside source: true
*** True Line Result
- g: 50,
-** Processing line: ~ b: 50,~
+ g: 50,
+** Processing line: ~ b: 50,~
- Inside source: true
*** True Line Result
- b: 50,
-** Processing line: ~ a: 255,~
+ b: 50,
+** Processing line: ~ a: 255,~
- Inside source: true
*** True Line Result
- a: 255,
-** Processing line: ~ font: "fonts/manaspc.ttf",~
+ a: 255,
+** Processing line: ~ font: "fonts/manaspc.ttf",~
- Inside source: true
*** True Line Result
- font: "fonts/manaspc.ttf",
+ font: "fonts/manaspc.ttf",
+** Processing line: ~ vertical_alignment_enum: 0, # 0 is bottom, 1 is middle, 2 is top~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 0, # 0 is bottom, 1 is middle, 2 is top
** Processing line: ~ # You can add any properties you like (this will be ignored/won't cause errors)~
- Inside source: true
*** True Line Result
@@ -3110,6 +3158,67 @@ You can get the render size of any string using ~args.gtk.calcstringbox~.
- End of paragraph detected.
*** True Line Result
+** Processing line: ~** Rendering Labels With New Line Characters And Wrapping~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** Rendering Labels With New Line Characters And Wrapping
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~You can use a strategy like the following to create multiple labels from a String.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+You can use a strategy like the following to create multiple labels from a String.
+** 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: ~ long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elitteger dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."~
+- Inside source: true
+*** True Line Result
+ long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elitteger dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."
+** Processing line: ~ max_character_length = 30~
+- Inside source: true
+*** True Line Result
+ max_character_length = 30
+** Processing line: ~ long_strings_split = args.string.wrapped_lines long_string, max_character_length~
+- Inside source: true
+*** True Line Result
+ long_strings_split = args.string.wrapped_lines long_string, max_character_length
+** Processing line: ~ args.outputs.labels << long_strings_split.map_with_index do |s, i|~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << long_strings_split.map_with_index do |s, i|
+** Processing line: ~ { x: 10, y: 600 - (i * 20), text: s }~
+- Inside source: true
+*** True Line Result
+ { x: 10, y: 600 - (i * 20), text: s }
+** 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: ~** How To Play A Sound~
- Header detected.
*** True Line Result
@@ -3699,11 +3808,11 @@ Returns ~true~ if: the ~right~ arrow or ~d~ key is pressed or held on the ~keybo
Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.left~ and ~args.inputs.right~.
*** True Line Result
*** ~.up_down~
-** Processing line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.up~ and ~args.inputs.down~.~
+** Processing line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.down~ and ~args.inputs.up~.~
** Processing line: ~*** ~.text~ OR ~.history~~
- Header detected.
*** True Line Result
-Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.up~ and ~args.inputs.down~.
+Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.down~ and ~args.inputs.up~.
*** True Line Result
*** ~.text~ OR ~.history~
** Processing line: ~Returns a string that represents the last key that was pressed on the keyboard.~
@@ -3785,13 +3894,23 @@ Returns a bitmask for all buttons on the mouse: ~1~ for a button in the ~down~ s
**** ~mouse.wheel~
** Processing line: ~Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred.~
** Processing line: ~***** ~.x~~
+- Header detected.
+*** True Line Result
+Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred.
+*** True Line Result
+***** ~.x~
** Processing line: ~Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis.~
** Processing line: ~***** ~.y~~
+- Header detected.
+*** True Line Result
+Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis.
+*** True Line Result
+***** ~.y~
** Processing line: ~Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.~
** Processing line: ~**** ~.click~ OR ~.down~, ~.previous_click~, ~.up~~
- Header detected.
*** True Line Result
-Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred. ***** ~.x~ Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis. ***** ~.y~ Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.
+Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.
*** True Line Result
**** ~.click~ OR ~.down~, ~.previous_click~, ~.up~
** Processing line: ~The properties ~args.inputs.mouse.(click|down|previous_click|up)~ each return ~nil~ if the mouse button event didn't occur. And return an Entity~
@@ -3803,47 +3922,47 @@ The properties ~args.inputs.mouse.(click|down|previous_click|up)~ each return ~n
*** True Line Result
*** ~.controller_one~, ~.controller_two~
** Processing line: ~Represents controllers connected to the usb ports.~
-** Processing line: ~**** ~.up~
+** Processing line: ~**** ~.up~~
- Header detected.
*** True Line Result
Represents controllers connected to the usb ports.
*** True Line Result
-**** ~.up
+**** ~.up~
** Processing line: ~Returns ~true~ if ~up~ is pressed or held on the directional or left analog.~
-** Processing line: ~**** ~.down~
+** Processing line: ~**** ~.down~~
- Header detected.
*** True Line Result
Returns ~true~ if ~up~ is pressed or held on the directional or left analog.
*** True Line Result
-**** ~.down
+**** ~.down~
** Processing line: ~Returns ~true~ if ~down~ is pressed or held on the directional or left analog.~
-** Processing line: ~**** ~.left~
+** Processing line: ~**** ~.left~~
- Header detected.
*** True Line Result
Returns ~true~ if ~down~ is pressed or held on the directional or left analog.
*** True Line Result
-**** ~.left
+**** ~.left~
** Processing line: ~Returns ~true~ if ~left~ is pressed or held on the directional or left analog.~
-** Processing line: ~**** ~.right~
+** Processing line: ~**** ~.right~~
- Header detected.
*** True Line Result
Returns ~true~ if ~left~ is pressed or held on the directional or left analog.
*** True Line Result
-**** ~.right
+**** ~.right~
** Processing line: ~Returns ~true~ if ~right~ is pressed or held on the directional or left analog.~
-** Processing line: ~**** ~.left_right~
+** Processing line: ~**** ~.left_right~~
- Header detected.
*** True Line Result
Returns ~true~ if ~right~ is pressed or held on the directional or left analog.
*** True Line Result
-**** ~.left_right
+**** ~.left_right~
** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.controller_(one|two).left~ and ~args.inputs.controller_(one|two).right~.~
-** Processing line: ~**** ~.up_down~
+** Processing line: ~**** ~.up_down~~
- Header detected.
*** True Line Result
Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.controller_(one|two).left~ and ~args.inputs.controller_(one|two).right~.
*** True Line Result
-**** ~.up_down
+**** ~.up_down~
** Processing line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.controller_(one|two).up~ and ~args.inputs.controller_(one|two).down~.~
** Processing line: ~**** ~.(left_analog_x_raw|right_analog_x_raw)~~
- Header detected.
@@ -3873,33 +3992,33 @@ Returns a number between ~-1~ and ~1~ which represents the percentage the analog
*** True Line Result
**** ~.left_analog_y_perc|right_analog_y_perc)~
** Processing line: ~Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved vertically as a ratio of the maximum vertical movement.~
-** Processing line: ~**** ~.directional_up)~~
+** Processing line: ~**** ~.directional_up~~
- Header detected.
*** True Line Result
Returns a number between ~-1~ and ~1~ which represents the percentage the analog is moved vertically as a ratio of the maximum vertical movement.
*** True Line Result
-**** ~.directional_up)~
+**** ~.directional_up~
** Processing line: ~Returns ~true~ if ~up~ is pressed or held on the directional.~
-** Processing line: ~**** ~.directional_down)~~
+** Processing line: ~**** ~.directional_down~~
- Header detected.
*** True Line Result
Returns ~true~ if ~up~ is pressed or held on the directional.
*** True Line Result
-**** ~.directional_down)~
+**** ~.directional_down~
** Processing line: ~Returns ~true~ if ~down~ is pressed or held on the directional.~
-** Processing line: ~**** ~.directional_left)~~
+** Processing line: ~**** ~.directional_left~~
- Header detected.
*** True Line Result
Returns ~true~ if ~down~ is pressed or held on the directional.
*** True Line Result
-**** ~.directional_left)~
+**** ~.directional_left~
** Processing line: ~Returns ~true~ if ~left~ is pressed or held on the directional.~
-** Processing line: ~**** ~.directional_right)~~
+** Processing line: ~**** ~.directional_right~~
- Header detected.
*** True Line Result
Returns ~true~ if ~left~ is pressed or held on the directional.
*** True Line Result
-**** ~.directional_right)~
+**** ~.directional_right~
** Processing line: ~Returns ~true~ if ~right~ is pressed or held on the directional.~
** Processing line: ~**** ~.(a|b|x|y|l1|r1|l2|r2|l3|r3|start|select)~~
- Header detected.
@@ -4491,10 +4610,39 @@ Send any Primitive to this collection which represents things you render to the
*** True Line Result
** ~args.geometry~
** Processing line: ~This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.
+** Processing line: ~Here are some general notes with regards to the arguments these geometric functions accept.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+Here are some general notes with regards to the arguments these geometric functions accept.
+** Processing line: ~1. ~Rectangles~ can be represented as an ~Array~ with four (or more) values ~[x, y, w, h]~, as a ~Hash~ ~{ x:, y:, w:, h: }~ or an object that responds to ~x~, ~y~, ~w~, and ~h~.~
+- Line was identified as a start of a list.
+*** True Line Result
+
+** Processing line: ~2. ~Points~ can be represent as an ~Array~ with two (or more) values ~[x, y]~, as a ~Hash~ ~{ x:, y:}~ or an object that responds to ~x~, and ~y~.~
+- Line was identified as a continuation of a list.
+*** True Line Result
+1. ~Rectangles~ can be represented as an ~Array~ with four (or more) values ~[x, y, w, h]~, as a ~Hash~ ~{ x:, y:, w:, h: }~ or an object that responds to ~x~, ~y~, ~w~, and ~h~.
+** Processing line: ~3. ~Lines~ can be represented as an ~Array~ with four (or more) values ~[x, y, x2, y2]~, as a ~Hash~ ~{ x:, y:, x2:, y2: }~ or an object that responds to ~x~, ~y~, ~x2~, and ~y2~.~
+- Line was identified as a continuation of a list.
+*** True Line Result
+2. ~Points~ can be represent as an ~Array~ with two (or more) values ~[x, y]~, as a ~Hash~ ~{ x:, y:}~ or an object that responds to ~x~, and ~y~.
+** Processing line: ~4. ~Angles~ are represented as degrees (not radians).~
+- Line was identified as a continuation of a list.
+*** True Line Result
+3. ~Lines~ can be represented as an ~Array~ with four (or more) values ~[x, y, x2, y2]~, as a ~Hash~ ~{ x:, y:, x2:, y2: }~ or an object that responds to ~x~, ~y~, ~x2~, and ~y2~.
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+4. ~Angles~ are represented as degrees (not radians).
** Processing line: ~*** ~.inside_rect? rect_1, rect_2~~
- Header detected.
*** True Line Result
-This property contains geometric functions. Functions can be invoked via ~args.geometry.FUNCTION~.
+
*** True Line Result
*** ~.inside_rect? rect_1, rect_2~
** Processing line: ~Returns ~true~ if ~rect_1~ is inside ~rect_2~.~
@@ -6575,12 +6723,12 @@ Creates a solid black rectangle located at 100, 100. 160 pixels wide and 90 pixe
- End of paragraph detected.
*** True Line Result
-** Processing line: ~The value for the color and alpha is an number between ~0~ and ~255~. The~
+** Processing line: ~The value for the color and alpha is a number between ~0~ and ~255~. The~
** Processing line: ~alpha property is optional and will be set to ~255~ if not specified.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-The value for the color and alpha is an number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.
+The value for the color and alpha is a number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.
** Processing line: ~Creates a green solid rectangle with an opacity of 50%.~
** Processing line: ~~
- End of paragraph detected.
@@ -6706,12 +6854,12 @@ If you want a more readable invocation. You can use the following hash to create
*** True Line Result
** Processing line: ~You can also create a class with solid/border properties and render it as a primitive.~
-** Processing line: ~ALL properties must on the class. *Additionally*, a method called ~primitive_marker~~
+** Processing line: ~ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~~
** Processing line: ~must be defined on the class.~
** Processing line: ~~
- End of paragraph detected.
*** True Line Result
-You can also create a class with solid/border 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.
+You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class.
** Processing line: ~Here is an example:~
** Processing line: ~~
- End of paragraph detected.
@@ -6926,6 +7074,385 @@ You have to use ~args.outputs.borders~:
- End of paragraph detected.
*** True Line Result
+** Processing line: ~* DOCS: ~GTK::Outputs#sprites~~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+* DOCS: ~GTK::Outputs#sprites~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~Add primitives to this collection to render a sprite to the screen.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+Add primitives to this collection to render a sprite to the screen.
+** Processing line: ~** Rendering a sprite using an Array~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** Rendering a sprite using an Array
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~Creates a sprite of a white circle located at 100, 100. 160 pixels~
+** Processing line: ~wide and 90 pixels tall.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+Creates a sprite of a white circle located at 100, 100. 160 pixels wide and 90 pixels tall.
+** Processing line: ~#+begin_src~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # X Y WIDTH HEIGHT PATH~
+- Inside source: true
+*** True Line Result
+ # X Y WIDTH HEIGHT PATH
+** Processing line: ~ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png]~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png]
+** 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: ~** Rendering a sprite using an Array with colors and alpha~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** Rendering a sprite using an Array with colors and alpha
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~The value for the color and alpha is a number between ~0~ and ~255~. The~
+** Processing line: ~alpha property is optional and will be set to ~255~ if not specified.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+The value for the color and alpha is a number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.
+** Processing line: ~Creates a green circle sprite with an opacity of 50%.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+Creates a green circle sprite with an opacity of 50%.
+** Processing line: ~#+begin_src~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # X Y WIDTH HEIGHT PATH ANGLE ALPHA RED GREEN BLUE~
+- Inside source: true
+*** True Line Result
+ # X Y WIDTH HEIGHT PATH ANGLE ALPHA RED GREEN BLUE
+** Processing line: ~ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png", 0, 128, 0, 255, 0]~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png", 0, 128, 0, 255, 0]
+** 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: ~** Rendering a sprite using a Hash~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** Rendering a sprite using a Hash
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~If you want a more readable invocation. You can use the following hash to create a sprite.~
+** Processing line: ~Any parameters that are not specified will be given a default value. The keys of the hash can~
+** Processing line: ~be provided in any order.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+If you want a more readable invocation. You can use the following hash to create a sprite. Any parameters that are not specified will be given a default value. The keys of the hash can be provided in any order.
+** Processing line: ~#+begin_src~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ args.outputs.sprites << {~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << {
+** Processing line: ~ x: 0,~
+- Inside source: true
+*** True Line Result
+ x: 0,
+** Processing line: ~ y: 0,~
+- Inside source: true
+*** True Line Result
+ y: 0,
+** Processing line: ~ w: 100,~
+- Inside source: true
+*** True Line Result
+ w: 100,
+** Processing line: ~ h: 100,~
+- Inside source: true
+*** True Line Result
+ h: 100,
+** Processing line: ~ path: "sprites/circle/white.png",~
+- Inside source: true
+*** True Line Result
+ path: "sprites/circle/white.png",
+** Processing line: ~ angle: 0,~
+- Inside source: true
+*** True Line Result
+ angle: 0,
+** Processing line: ~ a: 255,~
+- Inside source: true
+*** True Line Result
+ a: 255,
+** Processing line: ~ r: 0,~
+- Inside source: true
+*** True Line Result
+ r: 0,
+** Processing line: ~ g: 255,~
+- Inside source: true
+*** True Line Result
+ g: 255,
+** Processing line: ~ b: 0~
+- Inside source: true
+*** True Line Result
+ b: 0
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** 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: ~** Rendering a solid using a Class~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+** Rendering a solid using a Class
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
+** Processing line: ~You can also create a class with solid/border properties and render it as a primitive.~
+** Processing line: ~ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~~
+** Processing line: ~must be defined on the class.~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class.
+** Processing line: ~Here is an example:~
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+Here is an example:
+** Processing line: ~#+begin_src~
+- Line was identified as the beginning of a code block.
+*** True Line Result
+
+*** True Line Result
+#+begin_src
+** Processing line: ~ # Create type with ALL sprite properties AND primitive_marker~
+- Inside source: true
+*** True Line Result
+ # Create type with ALL sprite properties AND primitive_marker
+** Processing line: ~ class Sprite~
+- Inside source: true
+*** True Line Result
+ class Sprite
+** Processing line: ~ attr_accessor :x, :y, :w, :h, :path, :angle, :angle_anchor_x, :angle_anchor_y, :tile_x, :tile_y, :tile_w, :tile_h, :source_x, :source_y, :source_w, :source_h, :flip_horizontally, :flip_vertically, :a, :r, :g, :b~
+- Inside source: true
+*** True Line Result
+ attr_accessor :x, :y, :w, :h, :path, :angle, :angle_anchor_x, :angle_anchor_y, :tile_x, :tile_y, :tile_w, :tile_h, :source_x, :source_y, :source_w, :source_h, :flip_horizontally, :flip_vertically, :a, :r, :g, :b
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def primitive_marker~
+- Inside source: true
+*** True Line Result
+ def primitive_marker
+** Processing line: ~ :sprite~
+- Inside source: true
+*** True Line Result
+ :sprite
+** 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: ~ # Inherit from type~
+- Inside source: true
+*** True Line Result
+ # Inherit from type
+** Processing line: ~ class Circle < Sprite~
+- Inside source: true
+*** True Line Result
+ class Circle < Sprite
+** Processing line: ~ # constructor~
+- Inside source: true
+*** True Line Result
+ # constructor
+** Processing line: ~ def initialize x, y, size, path~
+- Inside source: true
+*** True Line Result
+ def initialize x, y, size, path
+** Processing line: ~ self.x = x~
+- Inside source: true
+*** True Line Result
+ self.x = x
+** Processing line: ~ self.y = y~
+- Inside source: true
+*** True Line Result
+ self.y = y
+** Processing line: ~ self.w = size~
+- Inside source: true
+*** True Line Result
+ self.w = size
+** Processing line: ~ self.h = size~
+- Inside source: true
+*** True Line Result
+ self.h = size
+** Processing line: ~ self.path = path~
+- Inside source: true
+*** True Line Result
+ self.path = path
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ def serlialize~
+- Inside source: true
+*** True Line Result
+ def serlialize
+** Processing line: ~ {x:self.x, y:self.y, w:self.w, h:self.h, path:self.path}~
+- Inside source: true
+*** True Line Result
+ {x:self.x, y:self.y, w:self.w, h:self.h, path:self.path}
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def inspect~
+- Inside source: true
+*** True Line Result
+ def inspect
+** Processing line: ~ serlialize.to_s~
+- Inside source: true
+*** True Line Result
+ serlialize.to_s
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_s~
+- Inside source: true
+*** True Line Result
+ def to_s
+** Processing line: ~ serlialize.to_s~
+- Inside source: true
+*** True Line Result
+ serlialize.to_s
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # render circle sprite~
+- Inside source: true
+*** True Line Result
+ # render circle sprite
+** Processing line: ~ args.outputs.sprites << Circle.new(10, 10, 32,"sprites/circle/white.png")~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << Circle.new(10, 10, 32,"sprites/circle/white.png")
+** 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: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~* DOCS: ~GTK::Outputs#screenshots~~
- Header detected.
*** True Line Result
@@ -7163,34 +7690,34 @@ The ~GTK::MousePoint~ has the following properties.
- Line was identified as a list.
*** True Line Result
- ~y~: Integer representing the mouse's y.
-** Processing line: ~- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~w~: Width of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line was identified as a list.
*** True Line Result
- ~point~: Array with the ~x~ and ~y~ values.
-** Processing line: ~- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~h~: Height of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line was identified as a list.
*** True Line Result
-- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-** Processing line: ~- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- ~w~: Width of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+** Processing line: ~- ~left~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line was identified as a list.
*** True Line Result
-- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-** Processing line: ~- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- ~h~: Height of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+** Processing line: ~- ~right~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line was identified as a list.
*** True Line Result
-- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-** Processing line: ~- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- ~left~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+** Processing line: ~- ~top~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line was identified as a list.
*** True Line Result
-- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
-** Processing line: ~- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- ~right~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
+** Processing line: ~- ~bottom~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line was identified as a list.
*** True Line Result
-- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
+- ~top~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
** Processing line: ~- ~created_at~: The tick (~args.state.tick_count~) that this structure was created.~
- Line was identified as a list.
*** True Line Result
-- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).
+- ~bottom~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).
** Processing line: ~- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.~
- Line was identified as a list.
*** True Line Result
@@ -12924,10 +13451,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 255,
-** Processing line: ~ font: "manaspc.ttf" }.label~
+** Processing line: ~ font: "manaspc.ttf" }.label!~
- Inside source: true
*** True Line Result
- font: "manaspc.ttf" }.label
+ font: "manaspc.ttf" }.label!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -12980,10 +13507,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 255,
-** Processing line: ~ font: "manaspc.ttf" }.label~
+** Processing line: ~ font: "manaspc.ttf" }.label!~
- Inside source: true
*** True Line Result
- font: "manaspc.ttf" }.label
+ font: "manaspc.ttf" }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -13944,3074 +14471,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: ~*** Rendering Basics - Audio Mixer - main.rb~
-- Header detected.
-*** True Line Result
-
-*** True Line Result
-*** Rendering Basics - Audio Mixer - 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/01_rendering_basics/06_audio_mixer/app/main.rb~
-- Inside source: true
-*** True Line Result
- # ./samples/01_rendering_basics/06_audio_mixer/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: ~ $boxsize = 30~
-- Inside source: true
-*** True Line Result
- $boxsize = 30
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def render_sources args~
-- Inside source: true
-*** True Line Result
- def render_sources args
-** Processing line: ~ mouse_in_panel = (args.state.selected != 0) && args.inputs.mouse.position.inside_rect?([900, 450, 340, 250])~
-- Inside source: true
-*** True Line Result
- mouse_in_panel = (args.state.selected != 0) && args.inputs.mouse.position.inside_rect?([900, 450, 340, 250])
-** Processing line: ~ mouse_new_down = (args.state.mouse_held == 1)~
-- Inside source: true
-*** True Line Result
- mouse_new_down = (args.state.mouse_held == 1)
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if (mouse_new_down && !mouse_in_panel)~
-- Inside source: true
-*** True Line Result
- if (mouse_new_down && !mouse_in_panel)
-** Processing line: ~ args.state.selected = 0 # will reset below if we hit something.~
-- Inside source: true
-*** True Line Result
- args.state.selected = 0 # will reset below if we hit something.
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ args.audio.keys.each { |k|~
-- Inside source: true
-*** True Line Result
- args.audio.keys.each { |k|
-** Processing line: ~ s = args.audio[k]~
-- Inside source: true
-*** True Line Result
- s = args.audio[k]
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if (mouse_new_down) && !mouse_in_panel && args.inputs.mouse.position.inside_rect?([s[:screenx], s[:screeny], $boxsize, $boxsize])~
-- Inside source: true
-*** True Line Result
- if (mouse_new_down) && !mouse_in_panel && args.inputs.mouse.position.inside_rect?([s[:screenx], s[:screeny], $boxsize, $boxsize])
-** Processing line: ~ args.state.selected = k~
-- Inside source: true
-*** True Line Result
- args.state.selected = k
-** Processing line: ~ args.state.dragging_source = true~
-- Inside source: true
-*** True Line Result
- args.state.dragging_source = true
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ isselected = (k == args.state.selected)~
-- Inside source: true
-*** True Line Result
- isselected = (k == args.state.selected)
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if isselected && args.state.dragging_source~
-- Inside source: true
-*** True Line Result
- if isselected && args.state.dragging_source
-** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
-- Inside source: true
-*** True Line Result
- # you can hang anything on the audio hashes you want, so we store the
-** Processing line: ~ # actual screen position so it doesn't scale weirdly vs your mouse.~
-- Inside source: true
-*** True Line Result
- # actual screen position so it doesn't scale weirdly vs your mouse.
-** Processing line: ~ s[:screenx] = args.inputs.mouse.x - ($boxsize / 2)~
-- Inside source: true
-*** True Line Result
- s[:screenx] = args.inputs.mouse.x - ($boxsize / 2)
-** Processing line: ~ s[:screeny] = args.inputs.mouse.y - ($boxsize / 2)~
-- Inside source: true
-*** True Line Result
- s[:screeny] = args.inputs.mouse.y - ($boxsize / 2)
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ s[:screeny] = 50 if s[:screeny] < 50~
-- Inside source: true
-*** True Line Result
- s[:screeny] = 50 if s[:screeny] < 50
-** Processing line: ~ s[:screeny] = (719 - $boxsize) if s[:screeny] > (719 - $boxsize)~
-- Inside source: true
-*** True Line Result
- s[:screeny] = (719 - $boxsize) if s[:screeny] > (719 - $boxsize)
-** Processing line: ~ s[:screenx] = 0 if s[:screenx] < 0~
-- Inside source: true
-*** True Line Result
- s[:screenx] = 0 if s[:screenx] < 0
-** Processing line: ~ s[:screenx] = (1279 - $boxsize) if s[:screenx] > (1279 - $boxsize)~
-- Inside source: true
-*** True Line Result
- s[:screenx] = (1279 - $boxsize) if s[:screenx] > (1279 - $boxsize)
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ s[:x] = ((s[:screenx] / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
-- Inside source: true
-*** True Line Result
- s[:x] = ((s[:screenx] / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
-** Processing line: ~ s[:y] = ((s[:screeny] / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
-- Inside source: true
-*** True Line Result
- s[:y] = ((s[:screeny] / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]~
-- Inside source: true
-*** True Line Result
- color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]
-** Processing line: ~ args.outputs.primitives << [s[:screenx], s[:screeny], $boxsize, $boxsize, *color].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [s[:screenx], s[:screeny], $boxsize, $boxsize, *color].solid
-** 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_panel args~
-- Inside source: true
-*** True Line Result
- def render_panel args
-** Processing line: ~ s = args.audio[args.state.selected]~
-- Inside source: true
-*** True Line Result
- s = args.audio[args.state.selected]
-** Processing line: ~ return if s.nil?~
-- Inside source: true
-*** True Line Result
- return if s.nil?
-** Processing line: ~ mouse_down = (args.state.mouse_held > 0)~
-- Inside source: true
-*** True Line Result
- mouse_down = (args.state.mouse_held > 0)
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ args.outputs.primitives << [900, 450, 340, 250, 127, 127, 200, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [900, 450, 340, 250, 127, 127, 200, 255].solid
-** Processing line: ~ args.outputs.primitives << [1075, 690, "Source ##{args.state.selected}", 3, 1, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [1075, 690, "Source ##{args.state.selected}", 3, 1, 255, 255, 255].label
-** Processing line: ~ args.outputs.primitives << [910, 660, 1230, 660, 255, 255, 255].line~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 660, 1230, 660, 255, 255, 255].line
-** Processing line: ~ args.outputs.primitives << [910, 650, "screen: (#{s[:screenx].to_i}, #{s[:screeny].to_i})", 0, 0, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 650, "screen: (#{s[:screenx].to_i}, #{s[:screeny].to_i})", 0, 0, 255, 255, 255].label
-** Processing line: ~ args.outputs.primitives << [910, 625, "position: (#{s[:x].round(5).to_s[0..6]}, #{s[:y].round(5).to_s[0..6]})", 0, 0, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 625, "position: (#{s[:x].round(5).to_s[0..6]}, #{s[:y].round(5).to_s[0..6]})", 0, 0, 255, 255, 255].label
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ slider = [1022, 586, 200, 7]~
-- Inside source: true
-*** True Line Result
- slider = [1022, 586, 200, 7]
-** Processing line: ~ if mouse_down && args.inputs.mouse.position.inside_rect?(slider)~
-- Inside source: true
-*** True Line Result
- if mouse_down && args.inputs.mouse.position.inside_rect?(slider)
-** Processing line: ~ s[:pitch] = ((args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)) * 2.0~
-- Inside source: true
-*** True Line Result
- s[:pitch] = ((args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)) * 2.0
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ slidercolor = (s[:pitch] / 2.0) * 255~
-- Inside source: true
-*** True Line Result
- slidercolor = (s[:pitch] / 2.0) * 255
-** Processing line: ~ args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid
-** Processing line: ~ args.outputs.primitives << [910, 600, "pitch: #{s[:pitch].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 600, "pitch: #{s[:pitch].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ slider = [1022, 561, 200, 7]~
-- Inside source: true
-*** True Line Result
- slider = [1022, 561, 200, 7]
-** Processing line: ~ if mouse_down && args.inputs.mouse.position.inside_rect?(slider)~
-- Inside source: true
-*** True Line Result
- if mouse_down && args.inputs.mouse.position.inside_rect?(slider)
-** Processing line: ~ s[:gain] = (args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)~
-- Inside source: true
-*** True Line Result
- s[:gain] = (args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ slidercolor = s[:gain] * 255~
-- Inside source: true
-*** True Line Result
- slidercolor = s[:gain] * 255
-** Processing line: ~ args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid
-** Processing line: ~ args.outputs.primitives << [910, 575, "gain: #{s[:gain].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 575, "gain: #{s[:gain].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ checkbox = [1022, 533, 10, 12]~
-- Inside source: true
-*** True Line Result
- checkbox = [1022, 533, 10, 12]
-** Processing line: ~ if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)~
-- Inside source: true
-*** True Line Result
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)
-** Processing line: ~ s[:looping] = !s[:looping]~
-- Inside source: true
-*** True Line Result
- s[:looping] = !s[:looping]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ checkboxcolor = s[:looping] ? 255 : 0~
-- Inside source: true
-*** True Line Result
- checkboxcolor = s[:looping] ? 255 : 0
-** Processing line: ~ args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid
-** Processing line: ~ args.outputs.primitives << [910, 550, "looping:", 0, 0, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 550, "looping:", 0, 0, 255, 255, 255].label
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ checkbox = [1022, 508, 10, 12]~
-- Inside source: true
-*** True Line Result
- checkbox = [1022, 508, 10, 12]
-** Processing line: ~ if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)~
-- Inside source: true
-*** True Line Result
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)
-** Processing line: ~ s[:paused] = !s[:paused]~
-- Inside source: true
-*** True Line Result
- s[:paused] = !s[:paused]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ checkboxcolor = s[:paused] ? 255 : 0~
-- Inside source: true
-*** True Line Result
- checkboxcolor = s[:paused] ? 255 : 0
-** Processing line: ~ args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid
-** Processing line: ~ args.outputs.primitives << [910, 525, "paused:", 0, 0, 255, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [910, 525, "paused:", 0, 0, 255, 255, 255].label
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ button = [910, 460, 320, 20]~
-- Inside source: true
-*** True Line Result
- button = [910, 460, 320, 20]
-** Processing line: ~ if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(button)~
-- Inside source: true
-*** True Line Result
- if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(button)
-** Processing line: ~ args.audio.delete(args.state.selected)~
-- Inside source: true
-*** True Line Result
- args.audio.delete(args.state.selected)
-** Processing line: ~ args.state.selected = 0~
-- Inside source: true
-*** True Line Result
- args.state.selected = 0
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ args.outputs.primitives << [*button, 255, 0, 0, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [*button, 255, 0, 0, 255].solid
-** Processing line: ~ args.outputs.primitives << [button[0] + (button[2] / 2), button[1]+20, "DELETE SOURCE", 0, 1, 255, 255, 0].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [button[0] + (button[2] / 2), button[1]+20, "DELETE SOURCE", 0, 1, 255, 255, 0].label
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def spawn_new_sound args, num~
-- Inside source: true
-*** True Line Result
- def spawn_new_sound args, num
-** Processing line: ~ input = nil~
-- Inside source: true
-*** True Line Result
- input = nil
-** Processing line: ~ input = "sounds/#{num}.#{(num == 6) ? 'ogg' : 'wav'}"~
-- Inside source: true
-*** True Line Result
- input = "sounds/#{num}.#{(num == 6) ? 'ogg' : 'wav'}"
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Spawn randomly in an area that won't be covered by UI.~
-- Inside source: true
-*** True Line Result
- # Spawn randomly in an area that won't be covered by UI.
-** Processing line: ~ screenx = (rand * 600.0) + 200.0~
-- Inside source: true
-*** True Line Result
- screenx = (rand * 600.0) + 200.0
-** Processing line: ~ screeny = (rand * 400.0) + 100.0~
-- Inside source: true
-*** True Line Result
- screeny = (rand * 400.0) + 100.0
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ args.state.next_sound_index += 1~
-- Inside source: true
-*** True Line Result
- args.state.next_sound_index += 1
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
-- Inside source: true
-*** True Line Result
- # you can hang anything on the audio hashes you want, so we store the
-** Processing line: ~ # actual screen position in here for convenience.~
-- Inside source: true
-*** True Line Result
- # actual screen position in here for convenience.
-** Processing line: ~ args.audio[args.state.next_sound_index] = {~
-- Inside source: true
-*** True Line Result
- args.audio[args.state.next_sound_index] = {
-** Processing line: ~ input: input,~
-- Inside source: true
-*** True Line Result
- input: input,
-** Processing line: ~ screenx: screenx,~
-- Inside source: true
-*** True Line Result
- screenx: screenx,
-** Processing line: ~ screeny: screeny,~
-- Inside source: true
-*** True Line Result
- screeny: screeny,
-** Processing line: ~ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
-- Inside source: true
-*** True Line Result
- x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
-** Processing line: ~ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
-- Inside source: true
-*** True Line Result
- y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
-** Processing line: ~ z: 0.0,~
-- Inside source: true
-*** True Line Result
- z: 0.0,
-** Processing line: ~ gain: 1.0,~
-- Inside source: true
-*** True Line Result
- gain: 1.0,
-** Processing line: ~ pitch: 1.0,~
-- Inside source: true
-*** True Line Result
- pitch: 1.0,
-** Processing line: ~ looping: true,~
-- Inside source: true
-*** True Line Result
- looping: true,
-** Processing line: ~ paused: false~
-- Inside source: true
-*** True Line Result
- paused: false
-** Processing line: ~ }~
-- Inside source: true
-*** True Line Result
- }
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ args.state.selected = args.state.next_sound_index~
-- Inside source: true
-*** True Line Result
- args.state.selected = args.state.next_sound_index
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def render_launcher args~
-- Inside source: true
-*** True Line Result
- def render_launcher args
-** Processing line: ~ total = 6~
-- Inside source: true
-*** True Line Result
- total = 6
-** Processing line: ~ x = (1280 - (total * $boxsize * 3)) / 2~
-- Inside source: true
-*** True Line Result
- x = (1280 - (total * $boxsize * 3)) / 2
-** Processing line: ~ y = 10~
-- Inside source: true
-*** True Line Result
- y = 10
-** Processing line: ~ args.outputs.primitives << [0, 0, 1280, ((y*2) + $boxsize), 127, 127, 127, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [0, 0, 1280, ((y*2) + $boxsize), 127, 127, 127, 255].solid
-** Processing line: ~ for i in 1..total~
-- Inside source: true
-*** True Line Result
- for i in 1..total
-** Processing line: ~ args.outputs.primitives << [x, y, $boxsize, $boxsize, 255, 255, 255, 255].solid~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [x, y, $boxsize, $boxsize, 255, 255, 255, 255].solid
-** Processing line: ~ args.outputs.primitives << [x+8, y+28, i.to_s, 3, 0, 0, 0, 255, 255].label~
-- Inside source: true
-*** True Line Result
- args.outputs.primitives << [x+8, y+28, i.to_s, 3, 0, 0, 0, 255, 255].label
-** Processing line: ~ if args.inputs.mouse.click && args.inputs.mouse.click.point.inside_rect?([x, y, $boxsize, $boxsize])~
-- Inside source: true
-*** True Line Result
- if args.inputs.mouse.click && args.inputs.mouse.click.point.inside_rect?([x, y, $boxsize, $boxsize])
-** Processing line: ~ spawn_new_sound args, i~
-- Inside source: true
-*** True Line Result
- spawn_new_sound args, i
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ x = x + ($boxsize * 3)~
-- Inside source: true
-*** True Line Result
- x = x + ($boxsize * 3)
-** 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_ui args~
-- Inside source: true
-*** True Line Result
- def render_ui args
-** Processing line: ~ render_launcher args~
-- Inside source: true
-*** True Line Result
- render_launcher args
-** Processing line: ~ render_panel args~
-- Inside source: true
-*** True Line Result
- render_panel args
-** 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.mouse_held ||= 0~
-- Inside source: true
-*** True Line Result
- args.state.mouse_held ||= 0
-** Processing line: ~ args.state.dragging_source ||= false~
-- Inside source: true
-*** True Line Result
- args.state.dragging_source ||= false
-** Processing line: ~ args.state.selected ||= 0~
-- Inside source: true
-*** True Line Result
- args.state.selected ||= 0
-** Processing line: ~ args.state.next_sound_index ||= 0~
-- Inside source: true
-*** True Line Result
- args.state.next_sound_index ||= 0
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if args.inputs.mouse.up~
-- Inside source: true
-*** True Line Result
- if args.inputs.mouse.up
-** Processing line: ~ args.state.mouse_held = 0~
-- Inside source: true
-*** True Line Result
- args.state.mouse_held = 0
-** Processing line: ~ args.state.dragging_source = false~
-- Inside source: true
-*** True Line Result
- args.state.dragging_source = false
-** Processing line: ~ elsif args.inputs.mouse.down || (args.state.mouse_held > 0)~
-- Inside source: true
-*** True Line Result
- elsif args.inputs.mouse.down || (args.state.mouse_held > 0)
-** Processing line: ~ args.state.mouse_held += 1~
-- Inside source: true
-*** True Line Result
- args.state.mouse_held += 1
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** 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_sources args~
-- Inside source: true
-*** True Line Result
- render_sources args
-** Processing line: ~ render_ui args~
-- Inside source: true
-*** True Line Result
- render_ui args
-** 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: ~*** Rendering Basics - Sound Synthesis - main.rb~
-- Header detected.
-*** True Line Result
-
-*** True Line Result
-*** Rendering Basics - Sound Synthesis - 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/01_rendering_basics/07_sound_synthesis/app/main.rb~
-- Inside source: true
-*** True Line Result
- # ./samples/01_rendering_basics/07_sound_synthesis/app/main.rb
-** Processing line: ~ begin # region: top level tick methods~
-- Inside source: true
-*** True Line Result
- begin # region: top level tick methods
-** 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
- input args
-** Processing line: ~ process_audio_queue args~
-- Inside source: true
-*** True Line Result
- process_audio_queue args
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def defaults args~
-- Inside source: true
-*** True Line Result
- def defaults args
-** Processing line: ~ args.state.sine_waves ||= {}~
-- Inside source: true
-*** True Line Result
- args.state.sine_waves ||= {}
-** Processing line: ~ args.state.square_waves ||= {}~
-- Inside source: true
-*** True Line Result
- args.state.square_waves ||= {}
-** Processing line: ~ args.state.saw_tooth_waves ||= {}~
-- Inside source: true
-*** True Line Result
- args.state.saw_tooth_waves ||= {}
-** Processing line: ~ args.state.triangle_waves ||= {}~
-- Inside source: true
-*** True Line Result
- args.state.triangle_waves ||= {}
-** Processing line: ~ args.state.audio_queue ||= []~
-- Inside source: true
-*** True Line Result
- args.state.audio_queue ||= []
-** Processing line: ~ args.state.buttons ||= [~
-- Inside source: true
-*** True Line Result
- args.state.buttons ||= [
-** Processing line: ~ (frequency_buttons args),~
-- Inside source: true
-*** True Line Result
- (frequency_buttons args),
-** Processing line: ~ (sine_wave_note_buttons args),~
-- Inside source: true
-*** True Line Result
- (sine_wave_note_buttons args),
-** Processing line: ~ (bell_buttons args),~
-- Inside source: true
-*** True Line Result
- (bell_buttons args),
-** Processing line: ~ (square_wave_note_buttons args),~
-- Inside source: true
-*** True Line Result
- (square_wave_note_buttons args),
-** Processing line: ~ (saw_tooth_wave_note_buttons args),~
-- Inside source: true
-*** True Line Result
- (saw_tooth_wave_note_buttons args),
-** Processing line: ~ (triangle_wave_note_buttons args),~
-- Inside source: true
-*** True Line Result
- (triangle_wave_note_buttons args),
-** Processing line: ~ ].flatten~
-- Inside source: true
-*** True Line Result
- ].flatten
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def render args~
-- Inside source: true
-*** True Line Result
- def render args
-** Processing line: ~ args.outputs.borders << args.state.buttons.map { |b| b[:border] }~
-- Inside source: true
-*** True Line Result
- args.outputs.borders << args.state.buttons.map { |b| b[:border] }
-** Processing line: ~ args.outputs.labels << args.state.buttons.map { |b| b[:label] }~
-- Inside source: true
-*** True Line Result
- args.outputs.labels << args.state.buttons.map { |b| b[:label] }
-** Processing line: ~ args.outputs.labels << args.layout~
-- Inside source: true
-*** True Line Result
- args.outputs.labels << args.layout
-** Processing line: ~ .rect(row: 0, col: 11.5)~
-- Inside source: true
-*** True Line Result
- .rect(row: 0, col: 11.5)
-** Processing line: ~ .yield_self { |r| r.merge y: r.y + r.h }~
-- Inside source: true
-*** True Line Result
- .yield_self { |r| r.merge y: r.y + r.h }
-** Processing line: ~ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",~
-- Inside source: true
-*** True Line Result
- .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",
-** Processing line: ~ alignment_enum: 1)~
-- Inside source: true
-*** True Line Result
- alignment_enum: 1)
-** 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: ~ def input args~
-- Inside source: true
-*** True Line Result
- def input args
-** Processing line: ~ args.state.buttons.each do |b|~
-- Inside source: true
-*** True Line Result
- args.state.buttons.each do |b|
-** Processing line: ~ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])~
-- Inside source: true
-*** True Line Result
- if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])
-** Processing line: ~ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "~
-- Inside source: true
-*** True Line Result
- parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "
-** Processing line: ~ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"~
-- Inside source: true
-*** True Line Result
- args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"
-** Processing line: ~ send b[:method_to_call], args, b~
-- Inside source: true
-*** True Line Result
- send b[:method_to_call], args, b
-** 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 args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))~
-- Inside source: true
-*** True Line Result
- if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))
-** Processing line: ~ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'~
-- Inside source: true
-*** True Line Result
- args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'
-** 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_audio_queue args~
-- Inside source: true
-*** True Line Result
- def process_audio_queue args
-** Processing line: ~ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }~
-- Inside source: true
-*** True Line Result
- to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }
-** Processing line: ~ args.state.audio_queue -= to_queue~
-- Inside source: true
-*** True Line Result
- args.state.audio_queue -= to_queue
-** Processing line: ~ to_queue.each { |a| args.audio[a[:id]] = a }~
-- Inside source: true
-*** True Line Result
- to_queue.each { |a| args.audio[a[:id]] = a }
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ args.audio.find_all { |k, v| v[:decay_rate] }~
-- Inside source: true
-*** True Line Result
- args.audio.find_all { |k, v| v[:decay_rate] }
-** Processing line: ~ .each { |k, v| v[:gain] -= v[:decay_rate] }~
-- Inside source: true
-*** True Line Result
- .each { |k, v| v[:gain] -= v[:decay_rate] }
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ sounds_to_stop = args.audio~
-- Inside source: true
-*** True Line Result
- sounds_to_stop = args.audio
-** Processing line: ~ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }~
-- Inside source: true
-*** True Line Result
- .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }
-** Processing line: ~ .map { |k, v| k }~
-- Inside source: true
-*** True Line Result
- .map { |k, v| k }
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ sounds_to_stop.each { |k| args.audio.delete k }~
-- Inside source: true
-*** True Line Result
- sounds_to_stop.each { |k| args.audio.delete 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: ~ begin # region: button definitions, ui layout, callback functions~
-- Inside source: true
-*** True Line Result
- begin # region: button definitions, ui layout, callback functions
-** Processing line: ~ def button args, opts~
-- Inside source: true
-*** True Line Result
- def button args, opts
-** Processing line: ~ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))~
-- Inside source: true
-*** True Line Result
- button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~
-- Inside source: true
-*** True Line Result
- button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ label_offset_x = 5~
-- Inside source: true
-*** True Line Result
- label_offset_x = 5
-** Processing line: ~ label_offset_y = 30~
-- Inside source: true
-*** True Line Result
- label_offset_y = 30
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~
-- Inside source: true
-*** True Line Result
- button_def[:label] = button_def[:rect].merge text: opts[:text],
-** Processing line: ~ size_enum: -2.5,~
-- Inside source: true
-*** True Line Result
- size_enum: -2.5,
-** Processing line: ~ x: button_def[:rect].x + label_offset_x,~
-- Inside source: true
-*** True Line Result
- x: button_def[:rect].x + label_offset_x,
-** Processing line: ~ y: button_def[:rect].y + label_offset_y~
-- Inside source: true
-*** True Line Result
- y: button_def[:rect].y + label_offset_y
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ button_def~
-- Inside source: true
-*** True Line Result
- button_def
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def play_sine_wave args, sender~
-- Inside source: true
-*** True Line Result
- def play_sine_wave args, sender
-** Processing line: ~ queue_sine_wave args,~
-- Inside source: true
-*** True Line Result
- queue_sine_wave args,
-** Processing line: ~ frequency: sender[:frequency],~
-- Inside source: true
-*** True Line Result
- frequency: sender[:frequency],
-** Processing line: ~ duration: 1.seconds,~
-- Inside source: true
-*** True Line Result
- duration: 1.seconds,
-** Processing line: ~ fade_out: true~
-- Inside source: true
-*** True Line Result
- fade_out: true
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def play_note args, sender~
-- Inside source: true
-*** True Line Result
- def play_note args, sender
-** Processing line: ~ method_to_call = :queue_sine_wave~
-- Inside source: true
-*** True Line Result
- method_to_call = :queue_sine_wave
-** Processing line: ~ method_to_call = :queue_square_wave if sender[:type] == :square~
-- Inside source: true
-*** True Line Result
- method_to_call = :queue_square_wave if sender[:type] == :square
-** Processing line: ~ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth~
-- Inside source: true
-*** True Line Result
- method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth
-** Processing line: ~ method_to_call = :queue_triangle_wave if sender[:type] == :triangle~
-- Inside source: true
-*** True Line Result
- method_to_call = :queue_triangle_wave if sender[:type] == :triangle
-** Processing line: ~ method_to_call = :queue_bell if sender[:type] == :bell~
-- Inside source: true
-*** True Line Result
- method_to_call = :queue_bell if sender[:type] == :bell
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ send method_to_call, args,~
-- Inside source: true
-*** True Line Result
- send method_to_call, args,
-** Processing line: ~ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),~
-- Inside source: true
-*** True Line Result
- frequency: (frequency_for note: sender[:note], octave: sender[:octave]),
-** Processing line: ~ duration: 1.seconds,~
-- Inside source: true
-*** True Line Result
- duration: 1.seconds,
-** Processing line: ~ fade_out: true~
-- Inside source: true
-*** True Line Result
- fade_out: true
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def frequency_buttons args~
-- Inside source: true
-*** True Line Result
- def frequency_buttons args
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 4.0, col: 0, text: "300hz",~
-- Inside source: true
-*** True Line Result
- row: 4.0, col: 0, text: "300hz",
-** Processing line: ~ frequency: 300,~
-- Inside source: true
-*** True Line Result
- frequency: 300,
-** Processing line: ~ method_to_call: :play_sine_wave),~
-- Inside source: true
-*** True Line Result
- method_to_call: :play_sine_wave),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 5.0, col: 0, text: "400hz",~
-- Inside source: true
-*** True Line Result
- row: 5.0, col: 0, text: "400hz",
-** Processing line: ~ frequency: 400,~
-- Inside source: true
-*** True Line Result
- frequency: 400,
-** Processing line: ~ method_to_call: :play_sine_wave),~
-- Inside source: true
-*** True Line Result
- method_to_call: :play_sine_wave),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 6.0, col: 0, text: "500hz",~
-- Inside source: true
-*** True Line Result
- row: 6.0, col: 0, text: "500hz",
-** Processing line: ~ frequency: 500,~
-- Inside source: true
-*** True Line Result
- frequency: 500,
-** Processing line: ~ method_to_call: :play_sine_wave),~
-- Inside source: true
-*** True Line Result
- method_to_call: :play_sine_wave),
-** 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 sine_wave_note_buttons args~
-- Inside source: true
-*** True Line Result
- def sine_wave_note_buttons args
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 1.5, col: 2, text: "Sine C4",~
-- Inside source: true
-*** True Line Result
- row: 1.5, col: 2, text: "Sine C4",
-** Processing line: ~ note: :c, octave: 4, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 4, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 2.5, col: 2, text: "Sine D4",~
-- Inside source: true
-*** True Line Result
- row: 2.5, col: 2, text: "Sine D4",
-** Processing line: ~ note: :d, octave: 4, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :d, octave: 4, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 3.5, col: 2, text: "Sine E4",~
-- Inside source: true
-*** True Line Result
- row: 3.5, col: 2, text: "Sine E4",
-** Processing line: ~ note: :e, octave: 4, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :e, octave: 4, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 4.5, col: 2, text: "Sine F4",~
-- Inside source: true
-*** True Line Result
- row: 4.5, col: 2, text: "Sine F4",
-** Processing line: ~ note: :f, octave: 4, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :f, octave: 4, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 5.5, col: 2, text: "Sine G4",~
-- Inside source: true
-*** True Line Result
- row: 5.5, col: 2, text: "Sine G4",
-** Processing line: ~ note: :g, octave: 4, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :g, octave: 4, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 6.5, col: 2, text: "Sine A5",~
-- Inside source: true
-*** True Line Result
- row: 6.5, col: 2, text: "Sine A5",
-** Processing line: ~ note: :a, octave: 5, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :a, octave: 5, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 7.5, col: 2, text: "Sine B5",~
-- Inside source: true
-*** True Line Result
- row: 7.5, col: 2, text: "Sine B5",
-** Processing line: ~ note: :b, octave: 5, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :b, octave: 5, type: :sine, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 8.5, col: 2, text: "Sine C5",~
-- Inside source: true
-*** True Line Result
- row: 8.5, col: 2, text: "Sine C5",
-** Processing line: ~ note: :c, octave: 5, type: :sine, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 5, type: :sine, method_to_call: :play_note),
-** 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 square_wave_note_buttons args~
-- Inside source: true
-*** True Line Result
- def square_wave_note_buttons args
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 1.5, col: 6, text: "Square C4",~
-- Inside source: true
-*** True Line Result
- row: 1.5, col: 6, text: "Square C4",
-** Processing line: ~ note: :c, octave: 4, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 4, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 2.5, col: 6, text: "Square D4",~
-- Inside source: true
-*** True Line Result
- row: 2.5, col: 6, text: "Square D4",
-** Processing line: ~ note: :d, octave: 4, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :d, octave: 4, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 3.5, col: 6, text: "Square E4",~
-- Inside source: true
-*** True Line Result
- row: 3.5, col: 6, text: "Square E4",
-** Processing line: ~ note: :e, octave: 4, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :e, octave: 4, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 4.5, col: 6, text: "Square F4",~
-- Inside source: true
-*** True Line Result
- row: 4.5, col: 6, text: "Square F4",
-** Processing line: ~ note: :f, octave: 4, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :f, octave: 4, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 5.5, col: 6, text: "Square G4",~
-- Inside source: true
-*** True Line Result
- row: 5.5, col: 6, text: "Square G4",
-** Processing line: ~ note: :g, octave: 4, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :g, octave: 4, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 6.5, col: 6, text: "Square A5",~
-- Inside source: true
-*** True Line Result
- row: 6.5, col: 6, text: "Square A5",
-** Processing line: ~ note: :a, octave: 5, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :a, octave: 5, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 7.5, col: 6, text: "Square B5",~
-- Inside source: true
-*** True Line Result
- row: 7.5, col: 6, text: "Square B5",
-** Processing line: ~ note: :b, octave: 5, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :b, octave: 5, type: :square, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 8.5, col: 6, text: "Square C5",~
-- Inside source: true
-*** True Line Result
- row: 8.5, col: 6, text: "Square C5",
-** Processing line: ~ note: :c, octave: 5, type: :square, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 5, type: :square, method_to_call: :play_note),
-** Processing line: ~ ]~
-- Inside source: true
-*** True Line Result
- ]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ def saw_tooth_wave_note_buttons args~
-- Inside source: true
-*** True Line Result
- def saw_tooth_wave_note_buttons args
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 1.5, col: 8, text: "Saw C4",~
-- Inside source: true
-*** True Line Result
- row: 1.5, col: 8, text: "Saw C4",
-** Processing line: ~ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 2.5, col: 8, text: "Saw D4",~
-- Inside source: true
-*** True Line Result
- row: 2.5, col: 8, text: "Saw D4",
-** Processing line: ~ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 3.5, col: 8, text: "Saw E4",~
-- Inside source: true
-*** True Line Result
- row: 3.5, col: 8, text: "Saw E4",
-** Processing line: ~ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 4.5, col: 8, text: "Saw F4",~
-- Inside source: true
-*** True Line Result
- row: 4.5, col: 8, text: "Saw F4",
-** Processing line: ~ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 5.5, col: 8, text: "Saw G4",~
-- Inside source: true
-*** True Line Result
- row: 5.5, col: 8, text: "Saw G4",
-** Processing line: ~ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 6.5, col: 8, text: "Saw A5",~
-- Inside source: true
-*** True Line Result
- row: 6.5, col: 8, text: "Saw A5",
-** Processing line: ~ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 7.5, col: 8, text: "Saw B5",~
-- Inside source: true
-*** True Line Result
- row: 7.5, col: 8, text: "Saw B5",
-** Processing line: ~ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 8.5, col: 8, text: "Saw C5",~
-- Inside source: true
-*** True Line Result
- row: 8.5, col: 8, text: "Saw C5",
-** Processing line: ~ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),
-** 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 triangle_wave_note_buttons args~
-- Inside source: true
-*** True Line Result
- def triangle_wave_note_buttons args
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 1.5, col: 10, text: "Triangle C4",~
-- Inside source: true
-*** True Line Result
- row: 1.5, col: 10, text: "Triangle C4",
-** Processing line: ~ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 4, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 2.5, col: 10, text: "Triangle D4",~
-- Inside source: true
-*** True Line Result
- row: 2.5, col: 10, text: "Triangle D4",
-** Processing line: ~ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :d, octave: 4, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 3.5, col: 10, text: "Triangle E4",~
-- Inside source: true
-*** True Line Result
- row: 3.5, col: 10, text: "Triangle E4",
-** Processing line: ~ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :e, octave: 4, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 4.5, col: 10, text: "Triangle F4",~
-- Inside source: true
-*** True Line Result
- row: 4.5, col: 10, text: "Triangle F4",
-** Processing line: ~ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :f, octave: 4, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 5.5, col: 10, text: "Triangle G4",~
-- Inside source: true
-*** True Line Result
- row: 5.5, col: 10, text: "Triangle G4",
-** Processing line: ~ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :g, octave: 4, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 6.5, col: 10, text: "Triangle A5",~
-- Inside source: true
-*** True Line Result
- row: 6.5, col: 10, text: "Triangle A5",
-** Processing line: ~ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :a, octave: 5, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 7.5, col: 10, text: "Triangle B5",~
-- Inside source: true
-*** True Line Result
- row: 7.5, col: 10, text: "Triangle B5",
-** Processing line: ~ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :b, octave: 5, type: :triangle, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 8.5, col: 10, text: "Triangle C5",~
-- Inside source: true
-*** True Line Result
- row: 8.5, col: 10, text: "Triangle C5",
-** Processing line: ~ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 5, type: :triangle, method_to_call: :play_note),
-** 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 bell_buttons args~
-- Inside source: true
-*** True Line Result
- def bell_buttons args
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 1.5, col: 4, text: "Bell C4",~
-- Inside source: true
-*** True Line Result
- row: 1.5, col: 4, text: "Bell C4",
-** Processing line: ~ note: :c, octave: 4, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 4, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 2.5, col: 4, text: "Bell D4",~
-- Inside source: true
-*** True Line Result
- row: 2.5, col: 4, text: "Bell D4",
-** Processing line: ~ note: :d, octave: 4, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :d, octave: 4, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 3.5, col: 4, text: "Bell E4",~
-- Inside source: true
-*** True Line Result
- row: 3.5, col: 4, text: "Bell E4",
-** Processing line: ~ note: :e, octave: 4, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :e, octave: 4, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 4.5, col: 4, text: "Bell F4",~
-- Inside source: true
-*** True Line Result
- row: 4.5, col: 4, text: "Bell F4",
-** Processing line: ~ note: :f, octave: 4, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :f, octave: 4, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 5.5, col: 4, text: "Bell G4",~
-- Inside source: true
-*** True Line Result
- row: 5.5, col: 4, text: "Bell G4",
-** Processing line: ~ note: :g, octave: 4, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :g, octave: 4, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 6.5, col: 4, text: "Bell A5",~
-- Inside source: true
-*** True Line Result
- row: 6.5, col: 4, text: "Bell A5",
-** Processing line: ~ note: :a, octave: 5, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :a, octave: 5, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 7.5, col: 4, text: "Bell B5",~
-- Inside source: true
-*** True Line Result
- row: 7.5, col: 4, text: "Bell B5",
-** Processing line: ~ note: :b, octave: 5, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :b, octave: 5, type: :bell, method_to_call: :play_note),
-** Processing line: ~ (button args,~
-- Inside source: true
-*** True Line Result
- (button args,
-** Processing line: ~ row: 8.5, col: 4, text: "Bell C5",~
-- Inside source: true
-*** True Line Result
- row: 8.5, col: 4, text: "Bell C5",
-** Processing line: ~ note: :c, octave: 5, type: :bell, method_to_call: :play_note),~
-- Inside source: true
-*** True Line Result
- note: :c, octave: 5, type: :bell, method_to_call: :play_note),
-** 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: ~ begin # region: wave generation~
-- Inside source: true
-*** True Line Result
- begin # region: wave generation
-** Processing line: ~ begin # sine wave~
-- Inside source: true
-*** True Line Result
- begin # sine wave
-** Processing line: ~ def defaults_sine_wave_for~
-- Inside source: true
-*** True Line Result
- def defaults_sine_wave_for
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, sample_rate: 48000 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def sine_wave_for opts = {}~
-- Inside source: true
-*** True Line Result
- def sine_wave_for opts = {}
-** Processing line: ~ opts = defaults_sine_wave_for.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_sine_wave_for.merge opts
-** Processing line: ~ frequency = opts[:frequency]~
-- Inside source: true
-*** True Line Result
- frequency = opts[:frequency]
-** Processing line: ~ sample_rate = opts[:sample_rate]~
-- Inside source: true
-*** True Line Result
- sample_rate = opts[:sample_rate]
-** Processing line: ~ period_size = (sample_rate.fdiv frequency).ceil~
-- Inside source: true
-*** True Line Result
- period_size = (sample_rate.fdiv frequency).ceil
-** Processing line: ~ period_size.map_with_index do |i|~
-- Inside source: true
-*** True Line Result
- period_size.map_with_index do |i|
-** Processing line: ~ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)~
-- Inside source: true
-*** True Line Result
- Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)
-** Processing line: ~ end.to_a~
-- Inside source: true
-*** True Line Result
- end.to_a
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def defaults_queue_sine_wave~
-- Inside source: true
-*** True Line Result
- def defaults_queue_sine_wave
-** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def queue_sine_wave args, opts = {}~
-- Inside source: true
-*** True Line Result
- def queue_sine_wave args, opts = {}
-** Processing line: ~ opts = defaults_queue_sine_wave.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_queue_sine_wave.merge opts
-** Processing line: ~ frequency = opts[:frequency]~
-- Inside source: true
-*** True Line Result
- frequency = opts[:frequency]
-** Processing line: ~ sample_rate = 48000~
-- Inside source: true
-*** True Line Result
- sample_rate = 48000
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ proc = lambda do~
-- Inside source: true
-*** True Line Result
- proc = lambda do
-** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~
-- Inside source: true
-*** True Line Result
- generate_audio_data args.state.sine_waves[frequency], sample_rate
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ audio_state = new_audio_state args, opts~
-- Inside source: true
-*** True Line Result
- audio_state = new_audio_state args, opts
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-- Inside source: true
-*** True Line Result
- audio_state[:input] = [1, sample_rate, proc]
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: sine_wave~
-- Inside source: true
-*** True Line Result
- queue_audio args, audio_state: audio_state, wave: sine_wave
-** 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: ~ begin # region: square wave~
-- Inside source: true
-*** True Line Result
- begin # region: square wave
-** Processing line: ~ def defaults_square_wave_for~
-- Inside source: true
-*** True Line Result
- def defaults_square_wave_for
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, sample_rate: 48000 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def square_wave_for opts = {}~
-- Inside source: true
-*** True Line Result
- def square_wave_for opts = {}
-** Processing line: ~ opts = defaults_square_wave_for.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_square_wave_for.merge opts
-** Processing line: ~ sine_wave = sine_wave_for opts~
-- Inside source: true
-*** True Line Result
- sine_wave = sine_wave_for opts
-** Processing line: ~ sine_wave.map do |v|~
-- Inside source: true
-*** True Line Result
- sine_wave.map do |v|
-** Processing line: ~ if v >= 0~
-- Inside source: true
-*** True Line Result
- if v >= 0
-** Processing line: ~ 1.0~
-- Inside source: true
-*** True Line Result
- 1.0
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ -1.0~
-- Inside source: true
-*** True Line Result
- -1.0
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ end.to_a~
-- Inside source: true
-*** True Line Result
- end.to_a
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def defaults_queue_square_wave~
-- Inside source: true
-*** True Line Result
- def defaults_queue_square_wave
-** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def queue_square_wave args, opts = {}~
-- Inside source: true
-*** True Line Result
- def queue_square_wave args, opts = {}
-** Processing line: ~ opts = defaults_queue_square_wave.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_queue_square_wave.merge opts
-** Processing line: ~ frequency = opts[:frequency]~
-- Inside source: true
-*** True Line Result
- frequency = opts[:frequency]
-** Processing line: ~ sample_rate = 48000~
-- Inside source: true
-*** True Line Result
- sample_rate = 48000
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ proc = lambda do~
-- Inside source: true
-*** True Line Result
- proc = lambda do
-** Processing line: ~ generate_audio_data args.state.square_waves[frequency], sample_rate~
-- Inside source: true
-*** True Line Result
- generate_audio_data args.state.square_waves[frequency], sample_rate
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ audio_state = new_audio_state args, opts~
-- Inside source: true
-*** True Line Result
- audio_state = new_audio_state args, opts
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-- Inside source: true
-*** True Line Result
- audio_state[:input] = [1, sample_rate, proc]
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: square_wave~
-- Inside source: true
-*** True Line Result
- queue_audio args, audio_state: audio_state, wave: square_wave
-** 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: ~ begin # region: saw tooth wave~
-- Inside source: true
-*** True Line Result
- begin # region: saw tooth wave
-** Processing line: ~ def defaults_saw_tooth_wave_for~
-- Inside source: true
-*** True Line Result
- def defaults_saw_tooth_wave_for
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, sample_rate: 48000 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def saw_tooth_wave_for opts = {}~
-- Inside source: true
-*** True Line Result
- def saw_tooth_wave_for opts = {}
-** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_saw_tooth_wave_for.merge opts
-** Processing line: ~ sine_wave = sine_wave_for opts~
-- Inside source: true
-*** True Line Result
- sine_wave = sine_wave_for opts
-** Processing line: ~ period_size = sine_wave.length~
-- Inside source: true
-*** True Line Result
- period_size = sine_wave.length
-** Processing line: ~ sine_wave.map_with_index do |v, i|~
-- Inside source: true
-*** True Line Result
- sine_wave.map_with_index do |v, i|
-** Processing line: ~ (((i % period_size).fdiv period_size) * 2) - 1~
-- Inside source: true
-*** True Line Result
- (((i % period_size).fdiv period_size) * 2) - 1
-** 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 defaults_queue_saw_tooth_wave~
-- Inside source: true
-*** True Line Result
- def defaults_queue_saw_tooth_wave
-** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def queue_saw_tooth_wave args, opts = {}~
-- Inside source: true
-*** True Line Result
- def queue_saw_tooth_wave args, opts = {}
-** Processing line: ~ opts = defaults_queue_saw_tooth_wave.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_queue_saw_tooth_wave.merge opts
-** Processing line: ~ frequency = opts[:frequency]~
-- Inside source: true
-*** True Line Result
- frequency = opts[:frequency]
-** Processing line: ~ sample_rate = 48000~
-- Inside source: true
-*** True Line Result
- sample_rate = 48000
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ proc = lambda do~
-- Inside source: true
-*** True Line Result
- proc = lambda do
-** Processing line: ~ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate~
-- Inside source: true
-*** True Line Result
- generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ audio_state = new_audio_state args, opts~
-- Inside source: true
-*** True Line Result
- audio_state = new_audio_state args, opts
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-- Inside source: true
-*** True Line Result
- audio_state[:input] = [1, sample_rate, proc]
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave~
-- Inside source: true
-*** True Line Result
- queue_audio args, audio_state: audio_state, wave: saw_tooth_wave
-** 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: ~ begin # region: triangle wave~
-- Inside source: true
-*** True Line Result
- begin # region: triangle wave
-** Processing line: ~ def defaults_triangle_wave_for~
-- Inside source: true
-*** True Line Result
- def defaults_triangle_wave_for
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, sample_rate: 48000 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def triangle_wave_for opts = {}~
-- Inside source: true
-*** True Line Result
- def triangle_wave_for opts = {}
-** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_saw_tooth_wave_for.merge opts
-** Processing line: ~ sine_wave = sine_wave_for opts~
-- Inside source: true
-*** True Line Result
- sine_wave = sine_wave_for opts
-** Processing line: ~ period_size = sine_wave.length~
-- Inside source: true
-*** True Line Result
- period_size = sine_wave.length
-** Processing line: ~ sine_wave.map_with_index do |v, i|~
-- Inside source: true
-*** True Line Result
- sine_wave.map_with_index do |v, i|
-** Processing line: ~ ratio = (i.fdiv period_size)~
-- Inside source: true
-*** True Line Result
- ratio = (i.fdiv period_size)
-** Processing line: ~ if ratio <= 0.5~
-- Inside source: true
-*** True Line Result
- if ratio <= 0.5
-** Processing line: ~ (ratio * 4) - 1~
-- Inside source: true
-*** True Line Result
- (ratio * 4) - 1
-** Processing line: ~ else~
-- Inside source: true
-*** True Line Result
- else
-** Processing line: ~ ratio -= 0.5~
-- Inside source: true
-*** True Line Result
- ratio -= 0.5
-** Processing line: ~ 1 - (ratio * 4)~
-- Inside source: true
-*** True Line Result
- 1 - (ratio * 4)
-** 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 defaults_queue_triangle_wave~
-- Inside source: true
-*** True Line Result
- def defaults_queue_triangle_wave
-** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def queue_triangle_wave args, opts = {}~
-- Inside source: true
-*** True Line Result
- def queue_triangle_wave args, opts = {}
-** Processing line: ~ opts = defaults_queue_triangle_wave.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_queue_triangle_wave.merge opts
-** Processing line: ~ frequency = opts[:frequency]~
-- Inside source: true
-*** True Line Result
- frequency = opts[:frequency]
-** Processing line: ~ sample_rate = 48000~
-- Inside source: true
-*** True Line Result
- sample_rate = 48000
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate~
-- Inside source: true
-*** True Line Result
- args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ proc = lambda do~
-- Inside source: true
-*** True Line Result
- proc = lambda do
-** Processing line: ~ generate_audio_data args.state.triangle_waves[frequency], sample_rate~
-- Inside source: true
-*** True Line Result
- generate_audio_data args.state.triangle_waves[frequency], sample_rate
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ audio_state = new_audio_state args, opts~
-- Inside source: true
-*** True Line Result
- audio_state = new_audio_state args, opts
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-- Inside source: true
-*** True Line Result
- audio_state[:input] = [1, sample_rate, proc]
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: triangle_wave~
-- Inside source: true
-*** True Line Result
- queue_audio args, audio_state: audio_state, wave: triangle_wave
-** 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: ~ begin # region: bell~
-- Inside source: true
-*** True Line Result
- begin # region: bell
-** Processing line: ~ def defaults_queue_bell~
-- Inside source: true
-*** True Line Result
- def defaults_queue_bell
-** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 1.seconds, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def queue_bell args, opts = {}~
-- Inside source: true
-*** True Line Result
- def queue_bell args, opts = {}
-** Processing line: ~ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }~
-- Inside source: true
-*** True Line Result
- (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def bell_harmonics~
-- Inside source: true
-*** True Line Result
- def bell_harmonics
-** Processing line: ~ [~
-- Inside source: true
-*** True Line Result
- [
-** Processing line: ~ { frequency_ratio: 0.5, duration_ratio: 1.00 },~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 0.5, duration_ratio: 1.00 },
-** Processing line: ~ { frequency_ratio: 1.0, duration_ratio: 0.80 },~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 1.0, duration_ratio: 0.80 },
-** Processing line: ~ { frequency_ratio: 2.0, duration_ratio: 0.60 },~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 2.0, duration_ratio: 0.60 },
-** Processing line: ~ { frequency_ratio: 3.0, duration_ratio: 0.40 },~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 3.0, duration_ratio: 0.40 },
-** Processing line: ~ { frequency_ratio: 4.2, duration_ratio: 0.25 },~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 4.2, duration_ratio: 0.25 },
-** Processing line: ~ { frequency_ratio: 5.4, duration_ratio: 0.20 },~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 5.4, duration_ratio: 0.20 },
-** Processing line: ~ { frequency_ratio: 6.8, duration_ratio: 0.15 }~
-- Inside source: true
-*** True Line Result
- { frequency_ratio: 6.8, duration_ratio: 0.15 }
-** 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_bell_to_sine_waves~
-- Inside source: true
-*** True Line Result
- def defaults_bell_to_sine_waves
-** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 1.seconds, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def bell_to_sine_waves opts = {}~
-- Inside source: true
-*** True Line Result
- def bell_to_sine_waves opts = {}
-** Processing line: ~ opts = defaults_bell_to_sine_waves.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_bell_to_sine_waves.merge opts
-** Processing line: ~ bell_harmonics.map do |b|~
-- Inside source: true
-*** True Line Result
- bell_harmonics.map do |b|
-** Processing line: ~ {~
-- Inside source: true
-*** True Line Result
- {
-** Processing line: ~ frequency: opts[:frequency] * b[:frequency_ratio],~
-- Inside source: true
-*** True Line Result
- frequency: opts[:frequency] * b[:frequency_ratio],
-** Processing line: ~ duration: opts[:duration] * b[:duration_ratio],~
-- Inside source: true
-*** True Line Result
- duration: opts[:duration] * b[:duration_ratio],
-** Processing line: ~ queue_in: opts[:queue_in],~
-- Inside source: true
-*** True Line Result
- queue_in: opts[:queue_in],
-** Processing line: ~ gain: (1.fdiv bell_harmonics.length),~
-- Inside source: true
-*** True Line Result
- gain: (1.fdiv bell_harmonics.length),
-** Processing line: ~ fade_out: true~
-- Inside source: true
-*** True Line Result
- fade_out: true
-** 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~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ begin # audio entity construction~
-- Inside source: true
-*** True Line Result
- begin # audio entity construction
-** Processing line: ~ def generate_audio_data sine_wave, sample_rate~
-- Inside source: true
-*** True Line Result
- def generate_audio_data sine_wave, sample_rate
-** Processing line: ~ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil~
-- Inside source: true
-*** True Line Result
- sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil
-** Processing line: ~ copy_count = (sample_size.fdiv sine_wave.length).ceil~
-- Inside source: true
-*** True Line Result
- copy_count = (sample_size.fdiv sine_wave.length).ceil
-** Processing line: ~ sine_wave * copy_count~
-- Inside source: true
-*** True Line Result
- sine_wave * copy_count
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def defaults_new_audio_state~
-- Inside source: true
-*** True Line Result
- def defaults_new_audio_state
-** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
-- Inside source: true
-*** True Line Result
- { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def new_audio_state args, opts = {}~
-- Inside source: true
-*** True Line Result
- def new_audio_state args, opts = {}
-** Processing line: ~ opts = defaults_new_audio_state.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_new_audio_state.merge opts
-** Processing line: ~ decay_rate = 0~
-- Inside source: true
-*** True Line Result
- decay_rate = 0
-** Processing line: ~ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]~
-- Inside source: true
-*** True Line Result
- decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]
-** Processing line: ~ frequency = opts[:frequency]~
-- Inside source: true
-*** True Line Result
- frequency = opts[:frequency]
-** Processing line: ~ sample_rate = 48000~
-- Inside source: true
-*** True Line Result
- sample_rate = 48000
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ {~
-- Inside source: true
-*** True Line Result
- {
-** Processing line: ~ id: (new_id! args),~
-- Inside source: true
-*** True Line Result
- id: (new_id! args),
-** Processing line: ~ frequency: frequency,~
-- Inside source: true
-*** True Line Result
- frequency: frequency,
-** Processing line: ~ sample_rate: 48000,~
-- Inside source: true
-*** True Line Result
- sample_rate: 48000,
-** Processing line: ~ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],~
-- Inside source: true
-*** True Line Result
- stop_at: args.tick_count + opts[:queue_in] + opts[:duration],
-** Processing line: ~ gain: opts[:gain].to_f,~
-- Inside source: true
-*** True Line Result
- gain: opts[:gain].to_f,
-** Processing line: ~ queue_at: args.state.tick_count + opts[:queue_in],~
-- Inside source: true
-*** True Line Result
- queue_at: args.state.tick_count + opts[:queue_in],
-** Processing line: ~ decay_rate: decay_rate,~
-- Inside source: true
-*** True Line Result
- decay_rate: decay_rate,
-** Processing line: ~ pitch: 1.0,~
-- Inside source: true
-*** True Line Result
- pitch: 1.0,
-** Processing line: ~ looping: true,~
-- Inside source: true
-*** True Line Result
- looping: true,
-** Processing line: ~ paused: false~
-- Inside source: true
-*** True Line Result
- paused: false
-** 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 queue_audio args, opts = {}~
-- Inside source: true
-*** True Line Result
- def queue_audio args, opts = {}
-** Processing line: ~ graph_wave args, opts[:wave], opts[:audio_state][:frequency]~
-- Inside source: true
-*** True Line Result
- graph_wave args, opts[:wave], opts[:audio_state][:frequency]
-** Processing line: ~ args.state.audio_queue << opts[:audio_state]~
-- Inside source: true
-*** True Line Result
- args.state.audio_queue << opts[:audio_state]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def new_id! args~
-- Inside source: true
-*** True Line Result
- def new_id! args
-** Processing line: ~ args.state.audio_id ||= 0~
-- Inside source: true
-*** True Line Result
- args.state.audio_id ||= 0
-** Processing line: ~ args.state.audio_id += 1~
-- Inside source: true
-*** True Line Result
- args.state.audio_id += 1
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def graph_wave args, wave, frequency~
-- Inside source: true
-*** True Line Result
- def graph_wave args, wave, frequency
-** Processing line: ~ if args.state.tick_count != args.state.graphed_at~
-- Inside source: true
-*** True Line Result
- if args.state.tick_count != args.state.graphed_at
-** Processing line: ~ args.outputs.static_lines.clear~
-- Inside source: true
-*** True Line Result
- args.outputs.static_lines.clear
-** Processing line: ~ args.outputs.static_sprites.clear~
-- Inside source: true
-*** True Line Result
- args.outputs.static_sprites.clear
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ wave = wave~
-- Inside source: true
-*** True Line Result
- wave = wave
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ r, g, b = frequency.to_i % 85,~
-- Inside source: true
-*** True Line Result
- r, g, b = frequency.to_i % 85,
-** Processing line: ~ frequency.to_i % 170,~
-- Inside source: true
-*** True Line Result
- frequency.to_i % 170,
-** Processing line: ~ frequency.to_i % 255~
-- Inside source: true
-*** True Line Result
- frequency.to_i % 255
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ starting_rect = args.layout.rect(row: 5, col: 13)~
-- Inside source: true
-*** True Line Result
- starting_rect = args.layout.rect(row: 5, col: 13)
-** Processing line: ~ x_scale = 10~
-- Inside source: true
-*** True Line Result
- x_scale = 10
-** Processing line: ~ y_scale = 100~
-- Inside source: true
-*** True Line Result
- y_scale = 100
-** Processing line: ~ max_points = 25~
-- Inside source: true
-*** True Line Result
- max_points = 25
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ points = wave~
-- Inside source: true
-*** True Line Result
- points = wave
-** Processing line: ~ if wave.length > max_points~
-- Inside source: true
-*** True Line Result
- if wave.length > max_points
-** Processing line: ~ resolution = wave.length.idiv max_points~
-- Inside source: true
-*** True Line Result
- resolution = wave.length.idiv max_points
-** Processing line: ~ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }~
-- Inside source: true
-*** True Line Result
- points = wave.find_all.with_index { |y, i| (i % resolution == 0) }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ args.outputs.static_lines << points.map_with_index do |y, x|~
-- Inside source: true
-*** True Line Result
- args.outputs.static_lines << points.map_with_index do |y, x|
-** Processing line: ~ next_y = points[x + 1]~
-- Inside source: true
-*** True Line Result
- next_y = points[x + 1]
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ if next_y~
-- Inside source: true
-*** True Line Result
- if next_y
-** Processing line: ~ {~
-- Inside source: true
-*** True Line Result
- {
-** Processing line: ~ x: starting_rect.x + (x * x_scale),~
-- Inside source: true
-*** True Line Result
- x: starting_rect.x + (x * x_scale),
-** Processing line: ~ y: starting_rect.y + starting_rect.h.half + y_scale * y,~
-- Inside source: true
-*** True Line Result
- y: starting_rect.y + starting_rect.h.half + y_scale * y,
-** Processing line: ~ x2: starting_rect.x + ((x + 1) * x_scale),~
-- Inside source: true
-*** True Line Result
- x2: starting_rect.x + ((x + 1) * x_scale),
-** Processing line: ~ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,~
-- Inside source: true
-*** True Line Result
- y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,
-** Processing line: ~ r: r,~
-- Inside source: true
-*** True Line Result
- r: r,
-** Processing line: ~ g: g,~
-- Inside source: true
-*** True Line Result
- g: g,
-** Processing line: ~ b: b~
-- Inside source: true
-*** True Line Result
- b: b
-** 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: ~ args.outputs.static_sprites << points.map_with_index do |y, x|~
-- Inside source: true
-*** True Line Result
- args.outputs.static_sprites << points.map_with_index do |y, x|
-** Processing line: ~ {~
-- Inside source: true
-*** True Line Result
- {
-** Processing line: ~ x: (starting_rect.x + (x * x_scale)) - 2,~
-- Inside source: true
-*** True Line Result
- x: (starting_rect.x + (x * x_scale)) - 2,
-** Processing line: ~ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,~
-- Inside source: true
-*** True Line Result
- y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,
-** Processing line: ~ w: 4,~
-- Inside source: true
-*** True Line Result
- w: 4,
-** Processing line: ~ h: 4,~
-- Inside source: true
-*** True Line Result
- h: 4,
-** Processing line: ~ path: 'sprites/square-white.png',~
-- Inside source: true
-*** True Line Result
- path: 'sprites/square-white.png',
-** Processing line: ~ r: r,~
-- Inside source: true
-*** True Line Result
- r: r,
-** Processing line: ~ g: g,~
-- Inside source: true
-*** True Line Result
- g: g,
-** Processing line: ~ b: b~
-- Inside source: true
-*** True Line Result
- b: b
-** 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.state.graphed_at = args.state.tick_count~
-- Inside source: true
-*** True Line Result
- args.state.graphed_at = args.state.tick_count
-** 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: ~ begin # region: musical note mapping~
-- Inside source: true
-*** True Line Result
- begin # region: musical note mapping
-** Processing line: ~ def defaults_frequency_for~
-- Inside source: true
-*** True Line Result
- def defaults_frequency_for
-** Processing line: ~ { note: :a, octave: 5, sharp: false, flat: false }~
-- Inside source: true
-*** True Line Result
- { note: :a, octave: 5, sharp: false, flat: false }
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def frequency_for opts = {}~
-- Inside source: true
-*** True Line Result
- def frequency_for opts = {}
-** Processing line: ~ opts = defaults_frequency_for.merge opts~
-- Inside source: true
-*** True Line Result
- opts = defaults_frequency_for.merge opts
-** Processing line: ~ octave_offset_multiplier = opts[:octave] - 5~
-- Inside source: true
-*** True Line Result
- octave_offset_multiplier = opts[:octave] - 5
-** Processing line: ~ note = note_frequencies_octave_5[opts[:note]]~
-- Inside source: true
-*** True Line Result
- note = note_frequencies_octave_5[opts[:note]]
-** Processing line: ~ if octave_offset_multiplier < 0~
-- Inside source: true
-*** True Line Result
- if octave_offset_multiplier < 0
-** Processing line: ~ note = note * 1 / (octave_offset_multiplier.abs + 1)~
-- Inside source: true
-*** True Line Result
- note = note * 1 / (octave_offset_multiplier.abs + 1)
-** Processing line: ~ elsif octave_offset_multiplier > 0~
-- Inside source: true
-*** True Line Result
- elsif octave_offset_multiplier > 0
-** Processing line: ~ note = note * (octave_offset_multiplier.abs + 1) / 1~
-- Inside source: true
-*** True Line Result
- note = note * (octave_offset_multiplier.abs + 1) / 1
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~ note~
-- Inside source: true
-*** True Line Result
- note
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def note_frequencies_octave_5~
-- Inside source: true
-*** True Line Result
- def note_frequencies_octave_5
-** Processing line: ~ {~
-- Inside source: true
-*** True Line Result
- {
-** Processing line: ~ a: 440.0,~
-- Inside source: true
-*** True Line Result
- a: 440.0,
-** Processing line: ~ a_sharp: 466.16, b_flat: 466.16,~
-- Inside source: true
-*** True Line Result
- a_sharp: 466.16, b_flat: 466.16,
-** Processing line: ~ b: 493.88,~
-- Inside source: true
-*** True Line Result
- b: 493.88,
-** Processing line: ~ c: 523.25,~
-- Inside source: true
-*** True Line Result
- c: 523.25,
-** Processing line: ~ c_sharp: 554.37, d_flat: 587.33,~
-- Inside source: true
-*** True Line Result
- c_sharp: 554.37, d_flat: 587.33,
-** Processing line: ~ d: 587.33,~
-- Inside source: true
-*** True Line Result
- d: 587.33,
-** Processing line: ~ d_sharp: 622.25, e_flat: 659.25,~
-- Inside source: true
-*** True Line Result
- d_sharp: 622.25, e_flat: 659.25,
-** Processing line: ~ e: 659.25,~
-- Inside source: true
-*** True Line Result
- e: 659.25,
-** Processing line: ~ f: 698.25,~
-- Inside source: true
-*** True Line Result
- f: 698.25,
-** Processing line: ~ f_sharp: 739.99, g_flat: 739.99,~
-- Inside source: true
-*** True Line Result
- f_sharp: 739.99, g_flat: 739.99,
-** Processing line: ~ g: 783.99,~
-- Inside source: true
-*** True Line Result
- g: 783.99,
-** Processing line: ~ g_sharp: 830.61, a_flat: 830.61~
-- Inside source: true
-*** True Line Result
- g_sharp: 830.61, a_flat: 830.61
-** 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~
-- 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: ~*** Input Basics - Keyboard - main.rb~
- Header detected.
*** True Line Result
@@ -17136,18 +14595,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Notice how small_font accounts for all the remaining parameters
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 0), "Current game time: #{args.state.tick_count}", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 0), text: "Current game time: #{args.state.tick_count}", size_enum: -1 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [460, row_to_px(args, 0), "Current game time: #{args.state.tick_count}", small_font]
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 2), "Keyboard input: args.inputs.keyboard.key_up.h", small_font]~
+ args.outputs.labels << { x: 460, y: row_to_px(args, 0), text: "Current game time: #{args.state.tick_count}", size_enum: -1 }
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 2), text: "Keyboard input: args.inputs.keyboard.key_up.h", size_enum: -1 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [460, row_to_px(args, 2), "Keyboard input: args.inputs.keyboard.key_up.h", small_font]
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font]~
+ args.outputs.labels << { x: 460, y: row_to_px(args, 2), text: "Keyboard input: args.inputs.keyboard.key_up.h", size_enum: -1 }
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 3), text: "Press \"h\" on the keyboard.", size_enum: -1 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 3), text: "Press \"h\" on the keyboard.", size_enum: -1 }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -17188,18 +14647,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if args.state.h_pressed_at
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" was pressed at time: #{args.state.h_pressed_at}", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" was pressed at time: #{args.state.h_pressed_at}", size_enum: -1 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [460, row_to_px(args, 4), "\"h\" was pressed at time: #{args.state.h_pressed_at}", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" was pressed at time: #{args.state.h_pressed_at}", size_enum: -1 }
** Processing line: ~ else~
- Inside source: true
*** True Line Result
else
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" has never been pressed.", size_enum: -1 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]
+ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" has never been pressed.", size_enum: -1 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -17220,42 +14679,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def small_font~
-- Inside source: true
-*** True Line Result
- def small_font
-** Processing line: ~ # This method provides some values for the construction of labels~
-- Inside source: true
-*** True Line Result
- # This method provides some values for the construction of labels
-** Processing line: ~ # Specifically, Size, Alignment, & RGBA~
-- Inside source: true
-*** True Line Result
- # Specifically, Size, Alignment, & RGBA
-** Processing line: ~ # This makes it so that custom parameters don't have to be repeatedly typed.~
-- Inside source: true
-*** True Line Result
- # This makes it so that custom parameters don't have to be repeatedly typed.
-** Processing line: ~ # Additionally "small_font" provides programmers with more information than some numbers~
+** Processing line: ~ def row_to_px args, row_number, y_offset = 20~
- Inside source: true
*** True Line Result
- # Additionally "small_font" provides programmers with more information than some numbers
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
-- Inside source: true
-*** True Line Result
- [-2, 0, 0, 0, 0, 255]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def row_to_px args, row_number~
-- Inside source: true
-*** True Line Result
- def row_to_px args, row_number
+ def row_to_px args, row_number, y_offset = 20
** Processing line: ~ # This takes a row_number and converts it to pixels DragonRuby understands.~
- Inside source: true
*** True Line Result
@@ -17268,10 +14695,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Each row afterward is 20 units lower
-** Processing line: ~ args.grid.top.shift_down(5).shift_down(20 * row_number)~
+** Processing line: ~ args.grid.top - 5 - (y_offset * row_number)~
- Inside source: true
*** True Line Result
- args.grid.top.shift_down(5).shift_down(20 * row_number)
+ args.grid.top - 5 - (y_offset * row_number)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -17388,10 +14815,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ args.outputs.labels << [10, row_to_px(args, 6), "Advanced Help:", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 10, y: row_to_px(args, 6), text: "This is the api for the keys you've pressed:", size_enum: -1, r: 180 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [10, row_to_px(args, 6), "Advanced Help:", small_font]
+ args.outputs.labels << { x: 10, y: row_to_px(args, 6), text: "This is the api for the keys you've pressed:", size_enum: -1, r: 180 }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -17416,22 +14843,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ args.outputs.labels << [10 , row_to_px(args, 7), "args.inputs.keyboard", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 10 , y: row_to_px(args, 7), text: "args.inputs.keyboard", size_enum: -2 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [10 , row_to_px(args, 7), "args.inputs.keyboard", small_font]
-** Processing line: ~ args.outputs.labels << [330, row_to_px(args, 7), "args.inputs.keyboard.key_down", small_font]~
+ args.outputs.labels << { x: 10 , y: row_to_px(args, 7), text: "args.inputs.keyboard", size_enum: -2 }
+** Processing line: ~ args.outputs.labels << { x: 330, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_down", size_enum: -2 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [330, row_to_px(args, 7), "args.inputs.keyboard.key_down", small_font]
-** Processing line: ~ args.outputs.labels << [650, row_to_px(args, 7), "args.inputs.keyboard.key_held", small_font]~
+ args.outputs.labels << { x: 330, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_down", size_enum: -2 }
+** Processing line: ~ args.outputs.labels << { x: 650, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_held", size_enum: -2 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [650, row_to_px(args, 7), "args.inputs.keyboard.key_held", small_font]
-** Processing line: ~ args.outputs.labels << [990, row_to_px(args, 7), "args.inputs.keyboard.key_up", small_font]~
+ args.outputs.labels << { x: 650, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_held", size_enum: -2 }
+** Processing line: ~ args.outputs.labels << { x: 990, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_up", size_enum: -2 }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [990, row_to_px(args, 7), "args.inputs.keyboard.key_up", small_font]
+ args.outputs.labels << { x: 990, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_up", size_enum: -2 }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -17612,30 +15039,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
[
-** Processing line: ~ [x, row_to_px(args, idx - 2),~
-- Inside source: true
-*** True Line Result
- [x, row_to_px(args, idx - 2),
-** Processing line: ~ " .#{k} is #{current_value || "nil"}",~
-- Inside source: true
-*** True Line Result
- " .#{k} is #{current_value || "nil"}",
-** Processing line: ~ small_font],~
-- Inside source: true
-*** True Line Result
- small_font],
-** Processing line: ~ [x, row_to_px(args, idx - 1),~
-- Inside source: true
-*** True Line Result
- [x, row_to_px(args, idx - 1),
-** Processing line: ~ " was #{v}",~
+** Processing line: ~ { x: x, y: row_to_px(args, idx + 0, 16), text: " .#{k} is #{current_value || "nil"}", size_enum: -2 },~
- Inside source: true
*** True Line Result
- " was #{v}",
-** Processing line: ~ small_font]~
+ { x: x, y: row_to_px(args, idx + 0, 16), text: " .#{k} is #{current_value || "nil"}", size_enum: -2 },
+** Processing line: ~ { x: x, y: row_to_px(args, idx + 1, 16), text: " was #{v}", size_enum: -2 }~
- Inside source: true
*** True Line Result
- small_font]
+ { x: x, y: row_to_px(args, idx + 1, 16), text: " was #{v}", size_enum: -2 }
** Processing line: ~ ]~
- Inside source: true
*** True Line Result
@@ -17692,18 +15103,166 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
+** Processing line: ~ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [0, y - 50, 1280, 60].solid
-** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+** Processing line: ~ args.outputs.debug << { x: 640, y: y, text: text,~
- Inside source: true
*** True Line Result
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
-** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+ args.outputs.debug << { x: 640, y: y, text: text,
+** Processing line: ~ size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+** Processing line: ~ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)",~
+- Inside source: true
+*** True Line Result
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)",
+** Processing line: ~ size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
+- Inside source: true
+*** True Line Result
+ size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+** 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: ~*** Input Basics - Moving A Sprite - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Input Basics - Moving A Sprite - 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/02_input_basics/01_moving_a_sprite/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/02_input_basics/01_moving_a_sprite/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # create a player and set default values~
+- Inside source: true
+*** True Line Result
+ # create a player and set default values
+** Processing line: ~ # for the player's x, y, w (width), and h (height)~
+- Inside source: true
+*** True Line Result
+ # for the player's x, y, w (width), and h (height)
+** Processing line: ~ args.state.player.x ||= 100~
+- Inside source: true
+*** True Line Result
+ args.state.player.x ||= 100
+** Processing line: ~ args.state.player.y ||= 100~
+- Inside source: true
+*** True Line Result
+ args.state.player.y ||= 100
+** Processing line: ~ args.state.player.w ||= 50~
+- Inside source: true
+*** True Line Result
+ args.state.player.w ||= 50
+** Processing line: ~ args.state.player.h ||= 50~
+- Inside source: true
+*** True Line Result
+ args.state.player.h ||= 50
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # render the player to the screen~
+- Inside source: true
+*** True Line Result
+ # render the player to the screen
+** Processing line: ~ args.outputs.sprites << { x: args.state.player.x,~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << { x: args.state.player.x,
+** Processing line: ~ y: args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ y: args.state.player.y,
+** Processing line: ~ w: args.state.player.w,~
+- Inside source: true
+*** True Line Result
+ w: args.state.player.w,
+** Processing line: ~ h: args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ h: args.state.player.h,
+** Processing line: ~ path: 'sprites/square/green.png' }~
+- Inside source: true
+*** True Line Result
+ path: 'sprites/square/green.png' }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # move the player around using the keyboard~
+- Inside source: true
+*** True Line Result
+ # move the player around using the keyboard
+** Processing line: ~ if args.inputs.up~
+- Inside source: true
+*** True Line Result
+ if args.inputs.up
+** Processing line: ~ args.state.player.y += 10~
+- Inside source: true
+*** True Line Result
+ args.state.player.y += 10
+** Processing line: ~ elsif args.inputs.down~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.down
+** Processing line: ~ args.state.player.y -= 10~
+- Inside source: true
+*** True Line Result
+ args.state.player.y -= 10
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.left~
+- Inside source: true
+*** True Line Result
+ if args.inputs.left
+** Processing line: ~ args.state.player.x -= 10~
+- Inside source: true
+*** True Line Result
+ args.state.player.x -= 10
+** Processing line: ~ elsif args.inputs.right~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.right
+** Processing line: ~ args.state.player.x += 10~
+- Inside source: true
+*** True Line Result
+ args.state.player.x += 10
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -17712,6 +15271,14 @@ Follows is a source code listing for all files that have been open sourced. This
- 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
@@ -17988,26 +15555,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# and adds the customization parameters
-** Processing line: ~ [x, row_to_px(args, row), message, small_font]~
+** Processing line: ~ { x: x, y: row_to_px(args, row), text: message, alignment_enum: -2 }~
- Inside source: true
*** True Line Result
- [x, row_to_px(args, row), message, small_font]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def small_font~
-- Inside source: true
-*** True Line Result
- def small_font
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
-- Inside source: true
-*** True Line Result
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, alignment_enum: -2 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -18068,18 +15619,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
+** Processing line: ~ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [0, y - 50, 1280, 60].solid
-** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+** Processing line: ~ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
-** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+** Processing line: ~ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -18288,10 +15839,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ box = [785, 370, 50, 50, 0, 0, 170]~
+** Processing line: ~ box = { x: 785, y: 370, w: 50, h: 50, r: 0, g: 0, b: 170 }~
- Inside source: true
*** True Line Result
- box = [785, 370, 50, 50, 0, 0, 170]
+ box = { x: 785, y: 370, w: 50, h: 50, r: 0, g: 0, b: 170 }
** Processing line: ~ args.outputs.borders << box~
- Inside source: true
*** True Line Result
@@ -18376,26 +15927,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def small_label args, x, row, message
-** Processing line: ~ [x, row_to_px(args, row), message, small_font]~
+** Processing line: ~ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }~
- Inside source: true
*** True Line Result
- [x, row_to_px(args, row), message, small_font]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def small_font~
-- Inside source: true
-*** True Line Result
- def small_font
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
-- Inside source: true
-*** True Line Result
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -18456,18 +15991,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
+** Processing line: ~ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [0, y - 50, 1280, 60].solid
-** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
+ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!
+** Processing line: ~ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
-** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
+** Processing line: ~ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -18676,18 +16211,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if !args.state.box_collision_one
-** Processing line: ~ args.state.box_collision_one = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 180, 0, 0, 180]~
+** Processing line: ~ args.state.box_collision_one = { x: args.inputs.mouse.click.point.x - 25,~
+- Inside source: true
+*** True Line Result
+ args.state.box_collision_one = { x: args.inputs.mouse.click.point.x - 25,
+** Processing line: ~ y: args.inputs.mouse.click.point.y - 25,~
+- Inside source: true
+*** True Line Result
+ y: args.inputs.mouse.click.point.y - 25,
+** Processing line: ~ w: 125, h: 125,~
+- Inside source: true
+*** True Line Result
+ w: 125, h: 125,
+** Processing line: ~ r: 180, g: 0, b: 0, a: 180 }~
- Inside source: true
*** True Line Result
- args.state.box_collision_one = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 180, 0, 0, 180]
+ r: 180, g: 0, b: 0, a: 180 }
** Processing line: ~ elsif !args.state.box_collision_two~
- Inside source: true
*** True Line Result
elsif !args.state.box_collision_two
-** Processing line: ~ args.state.box_collision_two = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 0, 0, 180, 180]~
+** Processing line: ~ args.state.box_collision_two = { x: args.inputs.mouse.click.point.x - 25,~
- Inside source: true
*** True Line Result
- args.state.box_collision_two = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 0, 0, 180, 180]
+ args.state.box_collision_two = { x: args.inputs.mouse.click.point.x - 25,
+** Processing line: ~ y: args.inputs.mouse.click.point.y - 25,~
+- Inside source: true
+*** True Line Result
+ y: args.inputs.mouse.click.point.y - 25,
+** Processing line: ~ w: 125, h: 125,~
+- Inside source: true
+*** True Line Result
+ w: 125, h: 125,
+** Processing line: ~ r: 0, g: 0, b: 180, a: 180 }~
+- Inside source: true
+*** True Line Result
+ r: 0, g: 0, b: 180, a: 180 }
** Processing line: ~ else~
- Inside source: true
*** True Line Result
@@ -18792,26 +16351,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def small_label args, x, row, message
-** Processing line: ~ [x, row_to_px(args, row), message, small_font]~
-- Inside source: true
-*** True Line Result
- [x, row_to_px(args, row), message, small_font]
-** Processing line: ~ end~
-- Inside source: true
-*** True Line Result
- end
-** Processing line: ~~
+** Processing line: ~ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ def small_font~
-- Inside source: true
-*** True Line Result
- def small_font
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
-- Inside source: true
-*** True Line Result
- [-2, 0, 0, 0, 0, 255]
+ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -18824,10 +16367,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def row_to_px args, row_number
-** Processing line: ~ args.grid.top.shift_down(5).shift_down(20 * row_number)~
+** Processing line: ~ args.grid.top - 5 - (20 * row_number)~
- Inside source: true
*** True Line Result
- args.grid.top.shift_down(5).shift_down(20 * row_number)
+ args.grid.top - 5 - (20 * row_number)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19092,118 +16635,94 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ state.buttons << [100, 500, inputs.controller_one.key_held.l1, "L1"]~
+** Processing line: ~ state.buttons << { x: 100, y: 500, active: inputs.controller_one.key_held.l1, text: "L1"}~
- Inside source: true
*** True Line Result
- state.buttons << [100, 500, inputs.controller_one.key_held.l1, "L1"]
-** Processing line: ~ state.buttons << [100, 600, inputs.controller_one.key_held.l2, "L2"]~
+ state.buttons << { x: 100, y: 500, active: inputs.controller_one.key_held.l1, text: "L1"}
+** Processing line: ~ state.buttons << { x: 100, y: 600, active: inputs.controller_one.key_held.l2, text: "L2"}~
- Inside source: true
*** True Line Result
- state.buttons << [100, 600, inputs.controller_one.key_held.l2, "L2"]
-** Processing line: ~~
+ state.buttons << { x: 100, y: 600, active: inputs.controller_one.key_held.l2, text: "L2"}
+** Processing line: ~ state.buttons << { x: 1100, y: 500, active: inputs.controller_one.key_held.r1, text: "R1"}~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ state.buttons << [1100, 500, inputs.controller_one.key_held.r1, "R1"]~
+ state.buttons << { x: 1100, y: 500, active: inputs.controller_one.key_held.r1, text: "R1"}
+** Processing line: ~ state.buttons << { x: 1100, y: 600, active: inputs.controller_one.key_held.r2, text: "R2"}~
- Inside source: true
*** True Line Result
- state.buttons << [1100, 500, inputs.controller_one.key_held.r1, "R1"]
-** Processing line: ~ state.buttons << [1100, 600, inputs.controller_one.key_held.r2, "R2"]~
+ state.buttons << { x: 1100, y: 600, active: inputs.controller_one.key_held.r2, text: "R2"}
+** Processing line: ~ state.buttons << { x: 540, y: 450, active: inputs.controller_one.key_held.select, text: "Select"}~
- Inside source: true
*** True Line Result
- state.buttons << [1100, 600, inputs.controller_one.key_held.r2, "R2"]
-** Processing line: ~~
+ state.buttons << { x: 540, y: 450, active: inputs.controller_one.key_held.select, text: "Select"}
+** Processing line: ~ state.buttons << { x: 660, y: 450, active: inputs.controller_one.key_held.start, text: "Start"}~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ state.buttons << [540, 450, inputs.controller_one.key_held.select, "Select"]~
+ state.buttons << { x: 660, y: 450, active: inputs.controller_one.key_held.start, text: "Start"}
+** Processing line: ~ state.buttons << { x: 200, y: 300, active: inputs.controller_one.key_held.left, text: "Left"}~
- Inside source: true
*** True Line Result
- state.buttons << [540, 450, inputs.controller_one.key_held.select, "Select"]
-** Processing line: ~ state.buttons << [660, 450, inputs.controller_one.key_held.start, "Start"]~
+ state.buttons << { x: 200, y: 300, active: inputs.controller_one.key_held.left, text: "Left"}
+** Processing line: ~ state.buttons << { x: 300, y: 400, active: inputs.controller_one.key_held.up, text: "Up"}~
- Inside source: true
*** True Line Result
- state.buttons << [660, 450, inputs.controller_one.key_held.start, "Start"]
-** Processing line: ~~
+ state.buttons << { x: 300, y: 400, active: inputs.controller_one.key_held.up, text: "Up"}
+** Processing line: ~ state.buttons << { x: 400, y: 300, active: inputs.controller_one.key_held.right, text: "Right"}~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ state.buttons << [200, 300, inputs.controller_one.key_held.left, "Left"]~
-- Inside source: true
-*** True Line Result
- state.buttons << [200, 300, inputs.controller_one.key_held.left, "Left"]
-** Processing line: ~ state.buttons << [300, 400, inputs.controller_one.key_held.up, "Up"]~
-- Inside source: true
-*** True Line Result
- state.buttons << [300, 400, inputs.controller_one.key_held.up, "Up"]
-** Processing line: ~ state.buttons << [400, 300, inputs.controller_one.key_held.right, "Right"]~
-- Inside source: true
-*** True Line Result
- state.buttons << [400, 300, inputs.controller_one.key_held.right, "Right"]
-** Processing line: ~ state.buttons << [300, 200, inputs.controller_one.key_held.down, "Down"]~
-- Inside source: true
-*** True Line Result
- state.buttons << [300, 200, inputs.controller_one.key_held.down, "Down"]
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ state.buttons << [800, 300, inputs.controller_one.key_held.x, "X"]~
-- Inside source: true
-*** True Line Result
- state.buttons << [800, 300, inputs.controller_one.key_held.x, "X"]
-** Processing line: ~ state.buttons << [900, 400, inputs.controller_one.key_held.y, "Y"]~
+ state.buttons << { x: 400, y: 300, active: inputs.controller_one.key_held.right, text: "Right"}
+** Processing line: ~ state.buttons << { x: 300, y: 200, active: inputs.controller_one.key_held.down, text: "Down"}~
- Inside source: true
*** True Line Result
- state.buttons << [900, 400, inputs.controller_one.key_held.y, "Y"]
-** Processing line: ~ state.buttons << [1000, 300, inputs.controller_one.key_held.a, "A"]~
+ state.buttons << { x: 300, y: 200, active: inputs.controller_one.key_held.down, text: "Down"}
+** Processing line: ~ state.buttons << { x: 800, y: 300, active: inputs.controller_one.key_held.x, text: "X"}~
- Inside source: true
*** True Line Result
- state.buttons << [1000, 300, inputs.controller_one.key_held.a, "A"]
-** Processing line: ~ state.buttons << [900, 200, inputs.controller_one.key_held.b, "B"]~
+ state.buttons << { x: 800, y: 300, active: inputs.controller_one.key_held.x, text: "X"}
+** Processing line: ~ state.buttons << { x: 900, y: 400, active: inputs.controller_one.key_held.y, text: "Y"}~
- Inside source: true
*** True Line Result
- state.buttons << [900, 200, inputs.controller_one.key_held.b, "B"]
-** Processing line: ~~
+ state.buttons << { x: 900, y: 400, active: inputs.controller_one.key_held.y, text: "Y"}
+** Processing line: ~ state.buttons << { x: 1000, y: 300, active: inputs.controller_one.key_held.a, text: "A"}~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ state.buttons << [450 + inputs.controller_one.left_analog_x_perc * 100,~
+ state.buttons << { x: 1000, y: 300, active: inputs.controller_one.key_held.a, text: "A"}
+** Processing line: ~ state.buttons << { x: 900, y: 200, active: inputs.controller_one.key_held.b, text: "B"}~
- Inside source: true
*** True Line Result
- state.buttons << [450 + inputs.controller_one.left_analog_x_perc * 100,
-** Processing line: ~ 100 + inputs.controller_one.left_analog_y_perc * 100,~
+ state.buttons << { x: 900, y: 200, active: inputs.controller_one.key_held.b, text: "B"}
+** Processing line: ~ state.buttons << { x: 450 + inputs.controller_one.left_analog_x_perc * 100,~
- Inside source: true
*** True Line Result
- 100 + inputs.controller_one.left_analog_y_perc * 100,
-** Processing line: ~ inputs.controller_one.key_held.l3,~
+ state.buttons << { x: 450 + inputs.controller_one.left_analog_x_perc * 100,
+** Processing line: ~ y: 100 + inputs.controller_one.left_analog_y_perc * 100,~
- Inside source: true
*** True Line Result
- inputs.controller_one.key_held.l3,
-** Processing line: ~ "L3"]~
+ y: 100 + inputs.controller_one.left_analog_y_perc * 100,
+** Processing line: ~ active: inputs.controller_one.key_held.l3,~
- Inside source: true
*** True Line Result
- "L3"]
-** Processing line: ~~
+ active: inputs.controller_one.key_held.l3,
+** Processing line: ~ text: "L3" }~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ state.buttons << [750 + inputs.controller_one.right_analog_x_perc * 100,~
+ text: "L3" }
+** Processing line: ~ state.buttons << { x: 750 + inputs.controller_one.right_analog_x_perc * 100,~
- Inside source: true
*** True Line Result
- state.buttons << [750 + inputs.controller_one.right_analog_x_perc * 100,
-** Processing line: ~ 100 + inputs.controller_one.right_analog_y_perc * 100,~
+ state.buttons << { x: 750 + inputs.controller_one.right_analog_x_perc * 100,
+** Processing line: ~ y: 100 + inputs.controller_one.right_analog_y_perc * 100,~
- Inside source: true
*** True Line Result
- 100 + inputs.controller_one.right_analog_y_perc * 100,
-** Processing line: ~ inputs.controller_one.key_held.r3,~
+ y: 100 + inputs.controller_one.right_analog_y_perc * 100,
+** Processing line: ~ active: inputs.controller_one.key_held.r3,~
- Inside source: true
*** True Line Result
- inputs.controller_one.key_held.r3,
-** Processing line: ~ "R3"]~
+ active: inputs.controller_one.key_held.r3,
+** Processing line: ~ text: "R3" }~
- Inside source: true
*** True Line Result
- "R3"]
+ text: "R3" }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19228,22 +16747,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def render
-** Processing line: ~ state.buttons.each do |x, y, active, text|~
+** Processing line: ~ state.buttons.each do |b|~
- Inside source: true
*** True Line Result
- state.buttons.each do |x, y, active, text|
-** Processing line: ~ rect = [x, y, 75, 75]~
+ state.buttons.each do |b|
+** Processing line: ~ rect = { x: b.x, y: b.y, w: 75, h: 75 }~
- Inside source: true
*** True Line Result
- rect = [x, y, 75, 75]
+ rect = { x: b.x, y: b.y, w: 75, h: 75 }
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ if active # if button is pressed~
+** Processing line: ~ if b.active # if button is pressed~
- Inside source: true
*** True Line Result
- if active # if button is pressed
+ if b.active # if button is pressed
** Processing line: ~ outputs.solids << rect # rect is output as solid (filled in)~
- Inside source: true
*** True Line Result
@@ -19268,10 +16787,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Outputs the text of each button using labels.
-** Processing line: ~ outputs.labels << [x, y + 95, text] # add 95 to place label above button~
+** Processing line: ~ outputs.labels << { x: b.x, y: b.y + 95, text: b.text } # add 95 to place label above button~
- Inside source: true
*** True Line Result
- outputs.labels << [x, y + 95, text] # add 95 to place label above button
+ outputs.labels << { x: b.x, y: b.y + 95, text: b.text } # add 95 to place label above button
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19280,22 +16799,22 @@ 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 << [10, 60, "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)"]~
+** Processing line: ~ outputs.labels << { x: 10, y: 60, text: "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)" }~
- Inside source: true
*** True Line Result
- outputs.labels << [10, 60, "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)"]
-** Processing line: ~ outputs.labels << [10, 30, "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)"]~
+ outputs.labels << { x: 10, y: 60, text: "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)" }
+** Processing line: ~ outputs.labels << { x: 10, y: 30, text: "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)" }~
- Inside source: true
*** True Line Result
- outputs.labels << [10, 30, "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)"]
-** Processing line: ~ outputs.labels << [900, 60, "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)"]~
+ outputs.labels << { x: 10, y: 30, text: "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)" }
+** Processing line: ~ outputs.labels << { x: 900, y: 60, text: "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)" }~
- Inside source: true
*** True Line Result
- outputs.labels << [900, 60, "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)"]
-** Processing line: ~ outputs.labels << [900, 30, "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)"]~
+ outputs.labels << { x: 900, y: 60, text: "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)" }
+** Processing line: ~ outputs.labels << { x: 900, y: 30, text: "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)" }~
- Inside source: true
*** True Line Result
- outputs.labels << [900, 30, "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)"]
+ outputs.labels << { x: 900, y: 30, text: "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)" }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19500,10 +17019,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if !args.inputs.finger_one.nil?
-** Processing line: ~ args.outputs.primitives << [640, 650, "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).", 5, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.primitives << { x: 640, y: 650, text: "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).",~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << { x: 640, y: 650, text: "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).",
+** Processing line: ~ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.primitives << [640, 650, "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).", 5, 1, 255, 255, 255].label
+ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19512,10 +17035,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if !args.inputs.finger_two.nil?
-** Processing line: ~ args.outputs.primitives << [640, 600, "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).", 5, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.primitives << { x: 640, y: 600, text: "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).",~
- Inside source: true
*** True Line Result
- args.outputs.primitives << [640, 600, "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).", 5, 1, 255, 255, 255].label
+ args.outputs.primitives << { x: 640, y: 600, text: "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).",
+** Processing line: ~ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
+- Inside source: true
+*** True Line Result
+ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19596,14 +17123,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
b = (color & 0x0000FF)
-** Processing line: ~ args.outputs.primitives << [v.x - (size / 2), v.y + (size / 2), size, size, r, g, b, 255].solid~
+** Processing line: ~ args.outputs.primitives << { x: v.x - (size / 2), y: v.y + (size / 2), w: size, h: size, r: r, g: g, b: b, a: 255 }.solid!~
- Inside source: true
*** True Line Result
- args.outputs.primitives << [v.x - (size / 2), v.y + (size / 2), size, size, r, g, b, 255].solid
-** Processing line: ~ args.outputs.primitives << [v.x, v.y + size, k.to_s, 0, 1, 0, 0, 0].label~
+ args.outputs.primitives << { x: v.x - (size / 2), y: v.y + (size / 2), w: size, h: size, r: r, g: g, b: b, a: 255 }.solid!
+** Processing line: ~ args.outputs.primitives << { x: v.x, y: v.y + size, text: k.to_s, alignment_enum: 1 }.label!~
- Inside source: true
*** True Line Result
- args.outputs.primitives << [v.x, v.y + size, k.to_s, 0, 1, 0, 0, 0].label
+ args.outputs.primitives << { x: v.x, y: v.y + size, text: k.to_s, alignment_enum: 1 }.label!
** Processing line: ~ }~
- Inside source: true
*** True Line Result
@@ -19616,10 +17143,6 @@ 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: ~#+end_src~
- Line was identified as the end of a code block.
*** True Line Result
@@ -19776,6 +17299,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def tick args
+** Processing line: ~ # uncomment the line below to see animation play out in slow motion~
+- Inside source: true
+*** True Line Result
+ # uncomment the line below to see animation play out in slow motion
+** Processing line: ~ # args.gtk.slowmo! 6~
+- Inside source: true
+*** True Line Result
+ # args.gtk.slowmo! 6
** Processing line: ~ looping_animation args~
- Inside source: true
*** True Line Result
@@ -19904,10 +17435,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Now that we have `sprite_index, we can present the correct file.
-** Processing line: ~ args.outputs.sprites << [100, 100, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]~
+** Processing line: ~ args.outputs.sprites << { x: 100, y: 100, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }~
- Inside source: true
*** True Line Result
- args.outputs.sprites << [100, 100, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]
+ args.outputs.sprites << { x: 100, y: 100, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -19916,10 +17447,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Try changing the numbers below to see how the animation changes:
-** Processing line: ~ args.outputs.sprites << [100, 200, 100, 100, "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png"]~
+** Processing line: ~ args.outputs.sprites << { x: 100, y: 200, w: 100, h: 100, path: "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png" }~
- Inside source: true
*** True Line Result
- args.outputs.sprites << [100, 200, 100, 100, "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png"]
+ args.outputs.sprites << { x: 100, y: 200, w: 100, h: 100, path: "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png" }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -19944,10 +17475,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# This is just a label the shows instructions within the game.
-** Processing line: ~ args.outputs.labels << [220, 350, "(press f to animate)"]~
+** Processing line: ~ args.outputs.labels << { x: 220, y: 350, text: "(press f to animate)" }~
- Inside source: true
*** True Line Result
- args.outputs.labels << [220, 350, "(press f to animate)"]
+ args.outputs.labels << { x: 220, y: 350, text: "(press f to animate)" }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -19964,10 +17495,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Print the frame that "f" was pressed on.
-** Processing line: ~ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.inputs.keyboard.key_down.f}"~
+** Processing line: ~ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.state.tick_count}"~
- Inside source: true
*** True Line Result
- puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.inputs.keyboard.key_down.f}"
+ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.state.tick_count}"
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -20096,10 +17627,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# Present the sprite.
-** Processing line: ~ args.outputs.sprites << [100, 300, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]~
+** Processing line: ~ args.outputs.sprites << { x: 100, y: 300, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }~
- Inside source: true
*** True Line Result
- args.outputs.sprites << [100, 300, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]
+ args.outputs.sprites << { x: 100, y: 300, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -28104,18 +25635,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if state.mouse_held
-** Processing line: ~ outputs.primitives << mouse_overlay.border~
+** Processing line: ~ outputs.primitives << mouse_overlay.border!~
- Inside source: true
*** True Line Result
- outputs.primitives << mouse_overlay.border
+ outputs.primitives << mouse_overlay.border!
** Processing line: ~ else~
- Inside source: true
*** True Line Result
else
-** Processing line: ~ outputs.primitives << mouse_overlay.solid~
+** Processing line: ~ outputs.primitives << mouse_overlay.solid!~
- Inside source: true
*** True Line Result
- outputs.primitives << mouse_overlay.solid
+ outputs.primitives << mouse_overlay.solid!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -45396,6 +42927,4030 @@ 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 - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Audio - Audio Mixer - 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_audio/01_audio_mixer/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_audio/01_audio_mixer/app/main.rb
+** Processing line: ~ # these are the properties that you can sent on args.audio~
+- Inside source: true
+*** True Line Result
+ # these are the properties that you can sent on args.audio
+** Processing line: ~ def spawn_new_sound args, name, path~
+- Inside source: true
+*** True Line Result
+ def spawn_new_sound args, name, path
+** Processing line: ~ # Spawn randomly in an area that won't be covered by UI.~
+- Inside source: true
+*** True Line Result
+ # Spawn randomly in an area that won't be covered by UI.
+** Processing line: ~ screenx = (rand * 600.0) + 200.0~
+- Inside source: true
+*** True Line Result
+ screenx = (rand * 600.0) + 200.0
+** Processing line: ~ screeny = (rand * 400.0) + 100.0~
+- Inside source: true
+*** True Line Result
+ screeny = (rand * 400.0) + 100.0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ id = new_sound_id! args~
+- Inside source: true
+*** True Line Result
+ id = new_sound_id! args
+** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
+- Inside source: true
+*** True Line Result
+ # you can hang anything on the audio hashes you want, so we store the
+** Processing line: ~ # actual screen position in here for convenience.~
+- Inside source: true
+*** True Line Result
+ # actual screen position in here for convenience.
+** Processing line: ~ args.audio[id] = {~
+- Inside source: true
+*** True Line Result
+ args.audio[id] = {
+** Processing line: ~ name: name,~
+- Inside source: true
+*** True Line Result
+ name: name,
+** Processing line: ~ input: path,~
+- Inside source: true
+*** True Line Result
+ input: path,
+** Processing line: ~ screenx: screenx,~
+- Inside source: true
+*** True Line Result
+ screenx: screenx,
+** Processing line: ~ screeny: screeny,~
+- Inside source: true
+*** True Line Result
+ screeny: screeny,
+** Processing line: ~ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
+- Inside source: true
+*** True Line Result
+ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
+** Processing line: ~ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
+- Inside source: true
+*** True Line Result
+ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range
+** Processing line: ~ z: 0.0,~
+- Inside source: true
+*** True Line Result
+ z: 0.0,
+** Processing line: ~ gain: 1.0,~
+- Inside source: true
+*** True Line Result
+ gain: 1.0,
+** Processing line: ~ pitch: 1.0,~
+- Inside source: true
+*** True Line Result
+ pitch: 1.0,
+** Processing line: ~ looping: true,~
+- Inside source: true
+*** True Line Result
+ looping: true,
+** Processing line: ~ paused: false~
+- Inside source: true
+*** True Line Result
+ paused: false
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.selected = id~
+- Inside source: true
+*** True Line Result
+ args.state.selected = id
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # these are values you can change on the ~args.audio~ data structure~
+- Inside source: true
+*** True Line Result
+ # these are values you can change on the ~args.audio~ data structure
+** Processing line: ~ def input_panel args~
+- Inside source: true
+*** True Line Result
+ def input_panel args
+** Processing line: ~ return unless args.state.panel~
+- Inside source: true
+*** True Line Result
+ return unless args.state.panel
+** Processing line: ~ return if args.state.dragging~
+- Inside source: true
+*** True Line Result
+ return if args.state.dragging
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ audio_entry = args.audio[args.state.selected]~
+- Inside source: true
+*** True Line Result
+ audio_entry = args.audio[args.state.selected]
+** Processing line: ~ results = args.state.panel~
+- Inside source: true
+*** True Line Result
+ results = args.state.panel
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.pitch_slider_rect.rect)~
+- Inside source: true
+*** True Line Result
+ if args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.pitch_slider_rect.rect)
+** Processing line: ~ audio_entry.pitch = 2.0 * ((args.inputs.mouse.x - results.pitch_slider_rect.x).to_f / (results.pitch_slider_rect.w - 1.0))~
+- Inside source: true
+*** True Line Result
+ audio_entry.pitch = 2.0 * ((args.inputs.mouse.x - results.pitch_slider_rect.x).to_f / (results.pitch_slider_rect.w - 1.0))
+** Processing line: ~ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.playtime_slider_rect.rect)~
+- Inside source: true
+*** True Line Result
+ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.playtime_slider_rect.rect)
+** Processing line: ~ audio_entry.playtime = audio_entry.length_ * ((args.inputs.mouse.x - results.playtime_slider_rect.x).to_f / (results.playtime_slider_rect.w - 1.0))~
+- Inside source: true
+*** True Line Result
+ audio_entry.playtime = audio_entry.length_ * ((args.inputs.mouse.x - results.playtime_slider_rect.x).to_f / (results.playtime_slider_rect.w - 1.0))
+** Processing line: ~ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.gain_slider_rect.rect)~
+- Inside source: true
+*** True Line Result
+ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.gain_slider_rect.rect)
+** Processing line: ~ audio_entry.gain = (args.inputs.mouse.x - results.gain_slider_rect.x).to_f / (results.gain_slider_rect.w - 1.0)~
+- Inside source: true
+*** True Line Result
+ audio_entry.gain = (args.inputs.mouse.x - results.gain_slider_rect.x).to_f / (results.gain_slider_rect.w - 1.0)
+** Processing line: ~ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.looping_checkbox_rect.rect)~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.looping_checkbox_rect.rect)
+** Processing line: ~ audio_entry.looping = !audio_entry.looping~
+- Inside source: true
+*** True Line Result
+ audio_entry.looping = !audio_entry.looping
+** Processing line: ~ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.paused_checkbox_rect.rect)~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.paused_checkbox_rect.rect)
+** Processing line: ~ audio_entry.paused = !audio_entry.paused~
+- Inside source: true
+*** True Line Result
+ audio_entry.paused = !audio_entry.paused
+** Processing line: ~ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.delete_button_rect.rect)~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.delete_button_rect.rect)
+** Processing line: ~ args.audio.delete args.state.selected~
+- Inside source: true
+*** True Line Result
+ args.audio.delete args.state.selected
+** 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_sources args~
+- Inside source: true
+*** True Line Result
+ def render_sources args
+** Processing line: ~ args.outputs.primitives << args.audio.keys.map do |k|~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << args.audio.keys.map do |k|
+** Processing line: ~ s = args.audio[k]~
+- Inside source: true
+*** True Line Result
+ s = args.audio[k]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ isselected = (k == args.state.selected)~
+- Inside source: true
+*** True Line Result
+ isselected = (k == args.state.selected)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]~
+- Inside source: true
+*** True Line Result
+ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ [s.screenx, s.screeny, args.state.boxsize, args.state.boxsize, *color].solid,~
+- Inside source: true
+*** True Line Result
+ [s.screenx, s.screeny, args.state.boxsize, args.state.boxsize, *color].solid,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ x: s.screenx + args.state.boxsize.half,~
+- Inside source: true
+*** True Line Result
+ x: s.screenx + args.state.boxsize.half,
+** Processing line: ~ y: s.screeny,~
+- Inside source: true
+*** True Line Result
+ y: s.screeny,
+** Processing line: ~ text: s.name,~
+- Inside source: true
+*** True Line Result
+ text: s.name,
+** Processing line: ~ r: 255,~
+- Inside source: true
+*** True Line Result
+ r: 255,
+** Processing line: ~ g: 255,~
+- Inside source: true
+*** True Line Result
+ g: 255,
+** Processing line: ~ b: 255,~
+- Inside source: true
+*** True Line Result
+ b: 255,
+** Processing line: ~ alignment_enum: 1~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 1
+** Processing line: ~ }.label!~
+- Inside source: true
+*** True Line Result
+ }.label!
+** 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 playtime_str t~
+- Inside source: true
+*** True Line Result
+ def playtime_str t
+** Processing line: ~ minutes = (t / 60.0).floor~
+- Inside source: true
+*** True Line Result
+ minutes = (t / 60.0).floor
+** Processing line: ~ seconds = t - (minutes * 60.0).to_f~
+- Inside source: true
+*** True Line Result
+ 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]~
+- Inside source: true
+*** True Line Result
+ return minutes.to_s + ':' + seconds.floor.to_s + ((seconds - seconds.floor).to_s + "000")[1..3]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def label_with_drop_shadow x, y, text~
+- Inside source: true
+*** True Line Result
+ def label_with_drop_shadow x, y, text
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ { x: x + 1, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,~
+- Inside source: true
+*** True Line Result
+ { x: x + 1, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,
+** Processing line: ~ { x: x + 2, y: y + 0, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,~
+- Inside source: true
+*** True Line Result
+ { x: x + 2, y: y + 0, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,
+** Processing line: ~ { x: x + 0, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 200, g: 200, b: 200 }.label!~
+- Inside source: true
+*** True Line Result
+ { x: x + 0, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 200, g: 200, b: 200 }.label!
+** 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 check_box opts = {}~
+- Inside source: true
+*** True Line Result
+ def check_box opts = {}
+** Processing line: ~ checkbox_template = opts.args.layout.rect(w: 0.5, h: 0.5, col: 2)~
+- Inside source: true
+*** True Line Result
+ checkbox_template = opts.args.layout.rect(w: 0.5, h: 0.5, col: 2)
+** Processing line: ~ final_rect = checkbox_template.center_inside_rect_y(opts.args.layout.rect(row: opts.row, col: opts.col))~
+- Inside source: true
+*** True Line Result
+ final_rect = checkbox_template.center_inside_rect_y(opts.args.layout.rect(row: opts.row, col: opts.col))
+** Processing line: ~ color = { r: 0, g: 0, b: 0 }~
+- Inside source: true
+*** True Line Result
+ color = { r: 0, g: 0, b: 0 }
+** Processing line: ~ color = { r: 255, g: 255, b: 255 } if opts.checked~
+- Inside source: true
+*** True Line Result
+ color = { r: 255, g: 255, b: 255 } if opts.checked
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ rect: final_rect,~
+- Inside source: true
+*** True Line Result
+ rect: final_rect,
+** Processing line: ~ primitives: [~
+- Inside source: true
+*** True Line Result
+ primitives: [
+** Processing line: ~ (final_rect.to_solid color)~
+- Inside source: true
+*** True Line Result
+ (final_rect.to_solid color)
+** 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 progress_bar opts = {}~
+- Inside source: true
+*** True Line Result
+ def progress_bar opts = {}
+** Processing line: ~ outer_rect = opts.args.layout.rect(row: opts.row, col: opts.col, w: 5, h: 1)~
+- Inside source: true
+*** True Line Result
+ outer_rect = opts.args.layout.rect(row: opts.row, col: opts.col, w: 5, h: 1)
+** Processing line: ~ color = opts.percentage * 255~
+- Inside source: true
+*** True Line Result
+ color = opts.percentage * 255
+** Processing line: ~ baseline_progress_bar = opts.args~
+- Inside source: true
+*** True Line Result
+ baseline_progress_bar = opts.args
+** Processing line: ~ .layout~
+- Inside source: true
+*** True Line Result
+ .layout
+** Processing line: ~ .rect(w: 5, h: 0.5)~
+- Inside source: true
+*** True Line Result
+ .rect(w: 5, h: 0.5)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ final_rect = baseline_progress_bar.center_inside_rect(outer_rect)~
+- Inside source: true
+*** True Line Result
+ final_rect = baseline_progress_bar.center_inside_rect(outer_rect)
+** Processing line: ~ center = final_rect.rect_center_point~
+- Inside source: true
+*** True Line Result
+ center = final_rect.rect_center_point
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ rect: final_rect,~
+- Inside source: true
+*** True Line Result
+ rect: final_rect,
+** Processing line: ~ primitives: [~
+- Inside source: true
+*** True Line Result
+ primitives: [
+** Processing line: ~ final_rect.merge(r: color, g: color, b: color, a: 128).solid!,~
+- Inside source: true
+*** True Line Result
+ final_rect.merge(r: color, g: color, b: color, a: 128).solid!,
+** Processing line: ~ label_with_drop_shadow(center.x, center.y, opts.text)~
+- Inside source: true
+*** True Line Result
+ label_with_drop_shadow(center.x, center.y, opts.text)
+** 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 panel_primitives args, audio_entry~
+- Inside source: true
+*** True Line Result
+ def panel_primitives args, audio_entry
+** Processing line: ~ results = { primitives: [] }~
+- Inside source: true
+*** True Line Result
+ results = { primitives: [] }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ return results unless audio_entry~
+- Inside source: true
+*** True Line Result
+ return results unless audio_entry
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # this uses DRGTK's layout apis to layout the controls~
+- Inside source: true
+*** True Line Result
+ # this uses DRGTK's layout apis to layout the controls
+** Processing line: ~ # imagine the screen is split into equal cells (24 cells across, 12 cells up and down)~
+- Inside source: true
+*** True Line Result
+ # imagine the screen is split into equal cells (24 cells across, 12 cells up and down)
+** Processing line: ~ # args.layout.rect returns a hash which we merge values with to create primitives~
+- Inside source: true
+*** True Line Result
+ # args.layout.rect returns a hash which we merge values with to create primitives
+** Processing line: ~ # using args.layout.rect removes the need for pixel pushing~
+- Inside source: true
+*** True Line Result
+ # using args.layout.rect removes the need for pixel pushing
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # args.outputs.debug << args.layout.debug_primitives(r: 255, g: 255, b: 255)~
+- Inside source: true
+*** True Line Result
+ # args.outputs.debug << args.layout.debug_primitives(r: 255, g: 255, b: 255)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ white_color = { r: 255, g: 255, b: 255 }~
+- Inside source: true
+*** True Line Result
+ white_color = { r: 255, g: 255, b: 255 }
+** Processing line: ~ label_style = white_color.merge(vertical_alignment_enum: 1)~
+- Inside source: true
+*** True Line Result
+ label_style = white_color.merge(vertical_alignment_enum: 1)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # panel background~
+- Inside source: true
+*** True Line Result
+ # panel background
+** Processing line: ~ results.primitives << args.layout.rect(row: 0, col: 0, w: 7, h: 6, include_col_gutter: true, include_row_gutter: true)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.rect(row: 0, col: 0, w: 7, h: 6, include_col_gutter: true, include_row_gutter: true)
+** Processing line: ~ .border!(r: 255, g: 255, b: 255)~
+- Inside source: true
+*** True Line Result
+ .border!(r: 255, g: 255, b: 255)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # title~
+- Inside source: true
+*** True Line Result
+ # title
+** Processing line: ~ results.primitives << args.layout.point(row: 0, col: 3.5, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 0, col: 3.5, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "Source #{args.state.selected} (#{args.audio[args.state.selected].name})",~
+- Inside source: true
+*** True Line Result
+ .merge(text: "Source #{args.state.selected} (#{args.audio[args.state.selected].name})",
+** Processing line: ~ size_enum: 3,~
+- Inside source: true
+*** True Line Result
+ size_enum: 3,
+** Processing line: ~ alignment_enum: 1)~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 1)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # seperator line~
+- Inside source: true
+*** True Line Result
+ # seperator line
+** Processing line: ~ results.primitives << args.layout.rect(row: 1, col: 0, w: 7, h: 0)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.rect(row: 1, col: 0, w: 7, h: 0)
+** Processing line: ~ .line!(white_color)~
+- Inside source: true
+*** True Line Result
+ .line!(white_color)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # screen location~
+- Inside source: true
+*** True Line Result
+ # screen location
+** Processing line: ~ results.primitives << args.layout.point(row: 1.0, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 1.0, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "screen:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "screen:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 1.0, col: 2, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 1.0, col: 2, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "(#{audio_entry.screenx.to_i}, #{audio_entry.screeny.to_i})")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "(#{audio_entry.screenx.to_i}, #{audio_entry.screeny.to_i})")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # position~
+- Inside source: true
+*** True Line Result
+ # position
+** Processing line: ~ results.primitives << args.layout.point(row: 1.5, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 1.5, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "position:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "position:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 1.5, col: 2, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 1.5, col: 2, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "(#{audio_entry[:x].round(5).to_s[0..6]}, #{audio_entry[:y].round(5).to_s[0..6]})")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "(#{audio_entry[:x].round(5).to_s[0..6]}, #{audio_entry[:y].round(5).to_s[0..6]})")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 2.0, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 2.0, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "pitch:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "pitch:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.pitch_slider_rect = progress_bar(row: 2.0, col: 2,~
+- Inside source: true
+*** True Line Result
+ results.pitch_slider_rect = progress_bar(row: 2.0, col: 2,
+** Processing line: ~ percentage: audio_entry.pitch / 2.0,~
+- Inside source: true
+*** True Line Result
+ percentage: audio_entry.pitch / 2.0,
+** Processing line: ~ text: "#{audio_entry.pitch.to_sf}",~
+- Inside source: true
+*** True Line Result
+ text: "#{audio_entry.pitch.to_sf}",
+** Processing line: ~ args: args)~
+- Inside source: true
+*** True Line Result
+ args: args)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << results.pitch_slider_rect.primitives~
+- Inside source: true
+*** True Line Result
+ results.primitives << results.pitch_slider_rect.primitives
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 2.5, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 2.5, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "playtime:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "playtime:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.playtime_slider_rect = progress_bar(args: args,~
+- Inside source: true
+*** True Line Result
+ results.playtime_slider_rect = progress_bar(args: args,
+** Processing line: ~ row: 2.5,~
+- Inside source: true
+*** True Line Result
+ row: 2.5,
+** Processing line: ~ col: 2,~
+- Inside source: true
+*** True Line Result
+ col: 2,
+** Processing line: ~ percentage: audio_entry.playtime / audio_entry.length_,~
+- Inside source: true
+*** True Line Result
+ percentage: audio_entry.playtime / audio_entry.length_,
+** Processing line: ~ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")~
+- Inside source: true
+*** True Line Result
+ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << results.playtime_slider_rect.primitives~
+- Inside source: true
+*** True Line Result
+ results.primitives << results.playtime_slider_rect.primitives
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 3.0, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 3.0, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "gain:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "gain:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.gain_slider_rect = progress_bar(args: args,~
+- Inside source: true
+*** True Line Result
+ results.gain_slider_rect = progress_bar(args: args,
+** Processing line: ~ row: 3.0,~
+- Inside source: true
+*** True Line Result
+ row: 3.0,
+** Processing line: ~ col: 2,~
+- Inside source: true
+*** True Line Result
+ col: 2,
+** Processing line: ~ percentage: audio_entry.gain,~
+- Inside source: true
+*** True Line Result
+ percentage: audio_entry.gain,
+** Processing line: ~ text: "#{audio_entry.gain.to_sf}")~
+- Inside source: true
+*** True Line Result
+ text: "#{audio_entry.gain.to_sf}")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << results.gain_slider_rect.primitives~
+- Inside source: true
+*** True Line Result
+ results.primitives << results.gain_slider_rect.primitives
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 3.5, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 3.5, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "looping:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "looping:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)~
+- Inside source: true
+*** True Line Result
+ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.looping_checkbox_rect = check_box(args: args, row: 3.5, col: 2, checked: audio_entry.looping)~
+- Inside source: true
+*** True Line Result
+ results.looping_checkbox_rect = check_box(args: args, row: 3.5, col: 2, checked: audio_entry.looping)
+** Processing line: ~ results.primitives << results.looping_checkbox_rect.primitives~
+- Inside source: true
+*** True Line Result
+ results.primitives << results.looping_checkbox_rect.primitives
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 4.0, col: 0, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 4.0, col: 0, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "paused:")~
+- Inside source: true
+*** True Line Result
+ .merge(text: "paused:")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)~
+- Inside source: true
+*** True Line Result
+ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.paused_checkbox_rect = check_box(args: args, row: 4.0, col: 2, checked: !audio_entry.paused)~
+- Inside source: true
+*** True Line Result
+ results.paused_checkbox_rect = check_box(args: args, row: 4.0, col: 2, checked: !audio_entry.paused)
+** Processing line: ~ results.primitives << results.paused_checkbox_rect.primitives~
+- Inside source: true
+*** True Line Result
+ results.primitives << results.paused_checkbox_rect.primitives
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.delete_button_rect = { rect: args.layout.rect(row: 5, col: 0, w: 7, h: 1) }~
+- Inside source: true
+*** True Line Result
+ results.delete_button_rect = { rect: args.layout.rect(row: 5, col: 0, w: 7, h: 1) }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << results.delete_button_rect.to_solid(r: 180)~
+- Inside source: true
+*** True Line Result
+ results.primitives << results.delete_button_rect.to_solid(r: 180)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ results.primitives << args.layout.point(row: 5, col: 3.5, row_anchor: 0.5)~
+- Inside source: true
+*** True Line Result
+ results.primitives << args.layout.point(row: 5, col: 3.5, row_anchor: 0.5)
+** Processing line: ~ .merge(label_style)~
+- Inside source: true
+*** True Line Result
+ .merge(label_style)
+** Processing line: ~ .merge(text: "DELETE", alignment_enum: 1)~
+- Inside source: true
+*** True Line Result
+ .merge(text: "DELETE", alignment_enum: 1)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ return results~
+- Inside source: true
+*** True Line Result
+ return results
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_panel args~
+- Inside source: true
+*** True Line Result
+ def render_panel args
+** Processing line: ~ args.state.panel = nil~
+- Inside source: true
+*** True Line Result
+ args.state.panel = nil
+** Processing line: ~ audio_entry = args.audio[args.state.selected]~
+- Inside source: true
+*** True Line Result
+ audio_entry = args.audio[args.state.selected]
+** Processing line: ~ return unless audio_entry~
+- Inside source: true
+*** True Line Result
+ return unless audio_entry
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ mouse_down = (args.state.mouse_held >= 0)~
+- Inside source: true
+*** True Line Result
+ mouse_down = (args.state.mouse_held >= 0)
+** Processing line: ~ args.state.panel = panel_primitives args, audio_entry~
+- Inside source: true
+*** True Line Result
+ args.state.panel = panel_primitives args, audio_entry
+** Processing line: ~ args.outputs.primitives << args.state.panel.primitives~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << args.state.panel.primitives
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def new_sound_id! args~
+- Inside source: true
+*** True Line Result
+ def new_sound_id! args
+** Processing line: ~ args.state.sound_id ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.sound_id ||= 0
+** Processing line: ~ args.state.sound_id += 1~
+- Inside source: true
+*** True Line Result
+ args.state.sound_id += 1
+** Processing line: ~ args.state.sound_id~
+- Inside source: true
+*** True Line Result
+ args.state.sound_id
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_launcher args~
+- Inside source: true
+*** True Line Result
+ def render_launcher args
+** Processing line: ~ args.outputs.primitives << args.state.spawn_sound_buttons.map(&:primitives)~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << args.state.spawn_sound_buttons.map(&:primitives)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render_ui args~
+- Inside source: true
+*** True Line Result
+ def render_ui args
+** Processing line: ~ render_launcher args~
+- Inside source: true
+*** True Line Result
+ render_launcher args
+** Processing line: ~ render_panel args~
+- Inside source: true
+*** True Line Result
+ render_panel args
+** 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: ~ 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
+ input args
+** 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.audio[args.state.selected]~
+- Inside source: true
+*** True Line Result
+ if !args.audio[args.state.selected]
+** Processing line: ~ args.state.selected = nil~
+- Inside source: true
+*** True Line Result
+ args.state.selected = nil
+** Processing line: ~ args.state.dragging = nil~
+- Inside source: true
+*** True Line Result
+ args.state.dragging = nil
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # spawn button and node interaction~
+- Inside source: true
+*** True Line Result
+ # spawn button and node interaction
+** Processing line: ~ if args.inputs.mouse.click~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.click
+** Processing line: ~ spawn_sound_button = args.state.spawn_sound_buttons.find { |b| args.inputs.mouse.inside_rect? b.rect }~
+- Inside source: true
+*** True Line Result
+ spawn_sound_button = args.state.spawn_sound_buttons.find { |b| args.inputs.mouse.inside_rect? b.rect }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ audio_click_key, audio_click_value = args.audio.find do |k, v|~
+- Inside source: true
+*** True Line Result
+ audio_click_key, audio_click_value = args.audio.find do |k, v|
+** Processing line: ~ args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]~
+- Inside source: true
+*** True Line Result
+ args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if spawn_sound_button~
+- Inside source: true
+*** True Line Result
+ if spawn_sound_button
+** Processing line: ~ args.state.selected = nil~
+- Inside source: true
+*** True Line Result
+ args.state.selected = nil
+** Processing line: ~ spawn_new_sound args, spawn_sound_button.name, spawn_sound_button.path~
+- Inside source: true
+*** True Line Result
+ spawn_new_sound args, spawn_sound_button.name, spawn_sound_button.path
+** Processing line: ~ elsif audio_click_key~
+- Inside source: true
+*** True Line Result
+ elsif audio_click_key
+** Processing line: ~ args.state.selected = audio_click_key~
+- Inside source: true
+*** True Line Result
+ args.state.selected = audio_click_key
+** 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 args.state.mouse_state == :held && args.state.selected~
+- Inside source: true
+*** True Line Result
+ if args.state.mouse_state == :held && args.state.selected
+** Processing line: ~ v = args.audio[args.state.selected]~
+- Inside source: true
+*** True Line Result
+ v = args.audio[args.state.selected]
+** Processing line: ~ if args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]
+** Processing line: ~ args.state.dragging = args.state.selected~
+- Inside source: true
+*** True Line Result
+ args.state.dragging = args.state.selected
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.state.dragging~
+- Inside source: true
+*** True Line Result
+ if args.state.dragging
+** Processing line: ~ s = args.audio[args.state.selected]~
+- Inside source: true
+*** True Line Result
+ s = args.audio[args.state.selected]
+** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
+- Inside source: true
+*** True Line Result
+ # you can hang anything on the audio hashes you want, so we store the
+** Processing line: ~ # actual screen position so it doesn't scale weirdly vs your mouse.~
+- Inside source: true
+*** True Line Result
+ # actual screen position so it doesn't scale weirdly vs your mouse.
+** Processing line: ~ s.screenx = args.inputs.mouse.x - (args.state.boxsize / 2)~
+- Inside source: true
+*** True Line Result
+ s.screenx = args.inputs.mouse.x - (args.state.boxsize / 2)
+** Processing line: ~ s.screeny = args.inputs.mouse.y - (args.state.boxsize / 2)~
+- Inside source: true
+*** True Line Result
+ s.screeny = args.inputs.mouse.y - (args.state.boxsize / 2)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ s.screeny = 50 if s.screeny < 50~
+- Inside source: true
+*** True Line Result
+ s.screeny = 50 if s.screeny < 50
+** Processing line: ~ s.screeny = (719 - args.state.boxsize) if s.screeny > (719 - args.state.boxsize)~
+- Inside source: true
+*** True Line Result
+ s.screeny = (719 - args.state.boxsize) if s.screeny > (719 - args.state.boxsize)
+** Processing line: ~ s.screenx = 0 if s.screenx < 0~
+- Inside source: true
+*** True Line Result
+ s.screenx = 0 if s.screenx < 0
+** Processing line: ~ s.screenx = (1279 - args.state.boxsize) if s.screenx > (1279 - args.state.boxsize)~
+- Inside source: true
+*** True Line Result
+ s.screenx = (1279 - args.state.boxsize) if s.screenx > (1279 - args.state.boxsize)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ s.x = ((s.screenx / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
+- Inside source: true
+*** True Line Result
+ s.x = ((s.screenx / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
+** Processing line: ~ s.y = ((s.screeny / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
+- Inside source: true
+*** True Line Result
+ s.y = ((s.screeny / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ elsif args.state.mouse_state == :released~
+- Inside source: true
+*** True Line Result
+ elsif args.state.mouse_state == :released
+** Processing line: ~ args.state.dragging = nil~
+- Inside source: true
+*** True Line Result
+ args.state.dragging = nil
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ input_panel args~
+- Inside source: true
+*** True Line Result
+ input_panel args
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def defaults args~
+- Inside source: true
+*** True Line Result
+ def defaults args
+** Processing line: ~ args.state.mouse_state ||= :released~
+- Inside source: true
+*** True Line Result
+ args.state.mouse_state ||= :released
+** Processing line: ~ args.state.dragging_source ||= false~
+- Inside source: true
+*** True Line Result
+ args.state.dragging_source ||= false
+** Processing line: ~ args.state.selected ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.selected ||= 0
+** Processing line: ~ args.state.next_sound_index ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.next_sound_index ||= 0
+** Processing line: ~ args.state.boxsize ||= 30~
+- Inside source: true
+*** True Line Result
+ args.state.boxsize ||= 30
+** Processing line: ~ args.state.sound_files ||= [~
+- Inside source: true
+*** True Line Result
+ args.state.sound_files ||= [
+** Processing line: ~ { name: :tada, path: "sounds/tada.wav" },~
+- Inside source: true
+*** True Line Result
+ { name: :tada, path: "sounds/tada.wav" },
+** Processing line: ~ { name: :splash, path: "sounds/splash.wav" },~
+- Inside source: true
+*** True Line Result
+ { name: :splash, path: "sounds/splash.wav" },
+** Processing line: ~ { name: :drum, path: "sounds/drum.wav" },~
+- Inside source: true
+*** True Line Result
+ { name: :drum, path: "sounds/drum.wav" },
+** Processing line: ~ { name: :spring, path: "sounds/spring.wav" },~
+- Inside source: true
+*** True Line Result
+ { name: :spring, path: "sounds/spring.wav" },
+** Processing line: ~ { name: :music, path: "sounds/music.ogg" }~
+- Inside source: true
+*** True Line Result
+ { name: :music, path: "sounds/music.ogg" }
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # generate buttons based off the sound collection above~
+- Inside source: true
+*** True Line Result
+ # generate buttons based off the sound collection above
+** Processing line: ~ args.state.spawn_sound_buttons ||= begin~
+- Inside source: true
+*** True Line Result
+ args.state.spawn_sound_buttons ||= begin
+** Processing line: ~ # create a group of buttons~
+- Inside source: true
+*** True Line Result
+ # create a group of buttons
+** Processing line: ~ # column centered (using col_offset to calculate the column offset)~
+- Inside source: true
+*** True Line Result
+ # column centered (using col_offset to calculate the column offset)
+** Processing line: ~ # where each item is 2 columns apart~
+- Inside source: true
+*** True Line Result
+ # where each item is 2 columns apart
+** Processing line: ~ rects = args.layout.rect_group row: 11,~
+- Inside source: true
+*** True Line Result
+ rects = args.layout.rect_group row: 11,
+** Processing line: ~ col_offset: {~
+- Inside source: true
+*** True Line Result
+ col_offset: {
+** Processing line: ~ count: args.state.sound_files.length,~
+- Inside source: true
+*** True Line Result
+ count: args.state.sound_files.length,
+** Processing line: ~ w: 2~
+- Inside source: true
+*** True Line Result
+ w: 2
+** Processing line: ~ },~
+- Inside source: true
+*** True Line Result
+ },
+** Processing line: ~ dcol: 2,~
+- Inside source: true
+*** True Line Result
+ dcol: 2,
+** Processing line: ~ w: 2,~
+- Inside source: true
+*** True Line Result
+ w: 2,
+** Processing line: ~ h: 1,~
+- Inside source: true
+*** True Line Result
+ h: 1,
+** Processing line: ~ group: args.state.sound_files~
+- Inside source: true
+*** True Line Result
+ group: args.state.sound_files
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # now that you have the rects~
+- Inside source: true
+*** True Line Result
+ # now that you have the rects
+** Processing line: ~ # construct the metadata for the buttons~
+- Inside source: true
+*** True Line Result
+ # construct the metadata for the buttons
+** Processing line: ~ rects.map do |rect|~
+- Inside source: true
+*** True Line Result
+ rects.map do |rect|
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ rect: rect,~
+- Inside source: true
+*** True Line Result
+ rect: rect,
+** Processing line: ~ name: rect.name,~
+- Inside source: true
+*** True Line Result
+ name: rect.name,
+** Processing line: ~ path: rect.path,~
+- Inside source: true
+*** True Line Result
+ path: rect.path,
+** Processing line: ~ primitives: [~
+- Inside source: true
+*** True Line Result
+ primitives: [
+** Processing line: ~ rect.to_border(r: 255, g: 255, b: 255),~
+- Inside source: true
+*** True Line Result
+ rect.to_border(r: 255, g: 255, b: 255),
+** Processing line: ~ rect.to_label(x: rect.center_x,~
+- Inside source: true
+*** True Line Result
+ rect.to_label(x: rect.center_x,
+** Processing line: ~ y: rect.center_y,~
+- Inside source: true
+*** True Line Result
+ y: rect.center_y,
+** Processing line: ~ text: "#{rect.name}",~
+- Inside source: true
+*** True Line Result
+ text: "#{rect.name}",
+** Processing line: ~ alignment_enum: 1,~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 1,
+** Processing line: ~ vertical_alignment_enum: 1,~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 1,
+** Processing line: ~ r: 255, g: 255, b: 255)~
+- Inside source: true
+*** True Line Result
+ r: 255, g: 255, b: 255)
+** 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: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.mouse.up~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.up
+** Processing line: ~ args.state.mouse_state = :released~
+- Inside source: true
+*** True Line Result
+ args.state.mouse_state = :released
+** Processing line: ~ args.state.dragging_source = false~
+- Inside source: true
+*** True Line Result
+ args.state.dragging_source = false
+** Processing line: ~ elsif args.inputs.mouse.down~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.mouse.down
+** Processing line: ~ args.state.mouse_state = :held~
+- Inside source: true
+*** True Line Result
+ args.state.mouse_state = :held
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** 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: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render args~
+- Inside source: true
+*** True Line Result
+ def render args
+** Processing line: ~ render_ui args~
+- Inside source: true
+*** True Line Result
+ render_ui args
+** Processing line: ~ render_sources args~
+- Inside source: true
+*** True Line Result
+ render_sources args
+** 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 Audio - Audio Mixer - server_ip_address.txt~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Audio - Audio Mixer - server_ip_address.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/app/server_ip_address.txt~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_audio/01_audio_mixer/app/server_ip_address.txt
+** Processing line: ~ 192.168.1.65~
+- Inside source: true
+*** True Line Result
+ 192.168.1.65
+** 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 - 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
+
+*** True Line Result
+*** Advanced Audio - Sound Synthesis - 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_audio/02_sound_synthesis/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_audio/02_sound_synthesis/app/main.rb
+** Processing line: ~ begin # region: top level tick methods~
+- Inside source: true
+*** True Line Result
+ begin # region: top level tick methods
+** 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
+ input args
+** Processing line: ~ process_audio_queue args~
+- Inside source: true
+*** True Line Result
+ process_audio_queue args
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def defaults args~
+- Inside source: true
+*** True Line Result
+ def defaults args
+** Processing line: ~ args.state.sine_waves ||= {}~
+- Inside source: true
+*** True Line Result
+ args.state.sine_waves ||= {}
+** Processing line: ~ args.state.square_waves ||= {}~
+- Inside source: true
+*** True Line Result
+ args.state.square_waves ||= {}
+** Processing line: ~ args.state.saw_tooth_waves ||= {}~
+- Inside source: true
+*** True Line Result
+ args.state.saw_tooth_waves ||= {}
+** Processing line: ~ args.state.triangle_waves ||= {}~
+- Inside source: true
+*** True Line Result
+ args.state.triangle_waves ||= {}
+** Processing line: ~ args.state.audio_queue ||= []~
+- Inside source: true
+*** True Line Result
+ args.state.audio_queue ||= []
+** Processing line: ~ args.state.buttons ||= [~
+- Inside source: true
+*** True Line Result
+ args.state.buttons ||= [
+** Processing line: ~ (frequency_buttons args),~
+- Inside source: true
+*** True Line Result
+ (frequency_buttons args),
+** Processing line: ~ (sine_wave_note_buttons args),~
+- Inside source: true
+*** True Line Result
+ (sine_wave_note_buttons args),
+** Processing line: ~ (bell_buttons args),~
+- Inside source: true
+*** True Line Result
+ (bell_buttons args),
+** Processing line: ~ (square_wave_note_buttons args),~
+- Inside source: true
+*** True Line Result
+ (square_wave_note_buttons args),
+** Processing line: ~ (saw_tooth_wave_note_buttons args),~
+- Inside source: true
+*** True Line Result
+ (saw_tooth_wave_note_buttons args),
+** Processing line: ~ (triangle_wave_note_buttons args),~
+- Inside source: true
+*** True Line Result
+ (triangle_wave_note_buttons args),
+** Processing line: ~ ].flatten~
+- Inside source: true
+*** True Line Result
+ ].flatten
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def render args~
+- Inside source: true
+*** True Line Result
+ def render args
+** Processing line: ~ args.outputs.borders << args.state.buttons.map { |b| b[:border] }~
+- Inside source: true
+*** True Line Result
+ args.outputs.borders << args.state.buttons.map { |b| b[:border] }
+** Processing line: ~ args.outputs.labels << args.state.buttons.map { |b| b[:label] }~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << args.state.buttons.map { |b| b[:label] }
+** Processing line: ~ args.outputs.labels << args.layout~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << args.layout
+** Processing line: ~ .rect(row: 0, col: 11.5)~
+- Inside source: true
+*** True Line Result
+ .rect(row: 0, col: 11.5)
+** Processing line: ~ .yield_self { |r| r.merge y: r.y + r.h }~
+- Inside source: true
+*** True Line Result
+ .yield_self { |r| r.merge y: r.y + r.h }
+** Processing line: ~ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",~
+- Inside source: true
+*** True Line Result
+ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",
+** Processing line: ~ alignment_enum: 1)~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 1)
+** 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: ~ def input args~
+- Inside source: true
+*** True Line Result
+ def input args
+** Processing line: ~ args.state.buttons.each do |b|~
+- Inside source: true
+*** True Line Result
+ args.state.buttons.each do |b|
+** Processing line: ~ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])
+** Processing line: ~ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "~
+- Inside source: true
+*** True Line Result
+ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "
+** Processing line: ~ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"~
+- Inside source: true
+*** True Line Result
+ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"
+** Processing line: ~ send b[:method_to_call], args, b~
+- Inside source: true
+*** True Line Result
+ send b[:method_to_call], args, b
+** 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 args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))
+** Processing line: ~ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'~
+- Inside source: true
+*** True Line Result
+ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'
+** 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_audio_queue args~
+- Inside source: true
+*** True Line Result
+ def process_audio_queue args
+** Processing line: ~ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }~
+- Inside source: true
+*** True Line Result
+ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }
+** Processing line: ~ args.state.audio_queue -= to_queue~
+- Inside source: true
+*** True Line Result
+ args.state.audio_queue -= to_queue
+** Processing line: ~ to_queue.each { |a| args.audio[a[:id]] = a }~
+- Inside source: true
+*** True Line Result
+ to_queue.each { |a| args.audio[a[:id]] = a }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.audio.find_all { |k, v| v[:decay_rate] }~
+- Inside source: true
+*** True Line Result
+ args.audio.find_all { |k, v| v[:decay_rate] }
+** Processing line: ~ .each { |k, v| v[:gain] -= v[:decay_rate] }~
+- Inside source: true
+*** True Line Result
+ .each { |k, v| v[:gain] -= v[:decay_rate] }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ sounds_to_stop = args.audio~
+- Inside source: true
+*** True Line Result
+ sounds_to_stop = args.audio
+** Processing line: ~ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }~
+- Inside source: true
+*** True Line Result
+ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }
+** Processing line: ~ .map { |k, v| k }~
+- Inside source: true
+*** True Line Result
+ .map { |k, v| k }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ sounds_to_stop.each { |k| args.audio.delete k }~
+- Inside source: true
+*** True Line Result
+ sounds_to_stop.each { |k| args.audio.delete 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: ~ begin # region: button definitions, ui layout, callback functions~
+- Inside source: true
+*** True Line Result
+ begin # region: button definitions, ui layout, callback functions
+** Processing line: ~ def button args, opts~
+- Inside source: true
+*** True Line Result
+ def button args, opts
+** Processing line: ~ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))~
+- Inside source: true
+*** True Line Result
+ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~
+- Inside source: true
+*** True Line Result
+ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ label_offset_x = 5~
+- Inside source: true
+*** True Line Result
+ label_offset_x = 5
+** Processing line: ~ label_offset_y = 30~
+- Inside source: true
+*** True Line Result
+ label_offset_y = 30
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~
+- Inside source: true
+*** True Line Result
+ button_def[:label] = button_def[:rect].merge text: opts[:text],
+** Processing line: ~ size_enum: -2.5,~
+- Inside source: true
+*** True Line Result
+ size_enum: -2.5,
+** Processing line: ~ x: button_def[:rect].x + label_offset_x,~
+- Inside source: true
+*** True Line Result
+ x: button_def[:rect].x + label_offset_x,
+** Processing line: ~ y: button_def[:rect].y + label_offset_y~
+- Inside source: true
+*** True Line Result
+ y: button_def[:rect].y + label_offset_y
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ button_def~
+- Inside source: true
+*** True Line Result
+ button_def
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def play_sine_wave args, sender~
+- Inside source: true
+*** True Line Result
+ def play_sine_wave args, sender
+** Processing line: ~ queue_sine_wave args,~
+- Inside source: true
+*** True Line Result
+ queue_sine_wave args,
+** Processing line: ~ frequency: sender[:frequency],~
+- Inside source: true
+*** True Line Result
+ frequency: sender[:frequency],
+** Processing line: ~ duration: 1.seconds,~
+- Inside source: true
+*** True Line Result
+ duration: 1.seconds,
+** Processing line: ~ fade_out: true~
+- Inside source: true
+*** True Line Result
+ fade_out: true
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def play_note args, sender~
+- Inside source: true
+*** True Line Result
+ def play_note args, sender
+** Processing line: ~ method_to_call = :queue_sine_wave~
+- Inside source: true
+*** True Line Result
+ method_to_call = :queue_sine_wave
+** Processing line: ~ method_to_call = :queue_square_wave if sender[:type] == :square~
+- Inside source: true
+*** True Line Result
+ method_to_call = :queue_square_wave if sender[:type] == :square
+** Processing line: ~ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth~
+- Inside source: true
+*** True Line Result
+ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth
+** Processing line: ~ method_to_call = :queue_triangle_wave if sender[:type] == :triangle~
+- Inside source: true
+*** True Line Result
+ method_to_call = :queue_triangle_wave if sender[:type] == :triangle
+** Processing line: ~ method_to_call = :queue_bell if sender[:type] == :bell~
+- Inside source: true
+*** True Line Result
+ method_to_call = :queue_bell if sender[:type] == :bell
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ send method_to_call, args,~
+- Inside source: true
+*** True Line Result
+ send method_to_call, args,
+** Processing line: ~ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),~
+- Inside source: true
+*** True Line Result
+ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),
+** Processing line: ~ duration: 1.seconds,~
+- Inside source: true
+*** True Line Result
+ duration: 1.seconds,
+** Processing line: ~ fade_out: true~
+- Inside source: true
+*** True Line Result
+ fade_out: true
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def frequency_buttons args~
+- Inside source: true
+*** True Line Result
+ def frequency_buttons args
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 4.0, col: 0, text: "300hz",~
+- Inside source: true
+*** True Line Result
+ row: 4.0, col: 0, text: "300hz",
+** Processing line: ~ frequency: 300,~
+- Inside source: true
+*** True Line Result
+ frequency: 300,
+** Processing line: ~ method_to_call: :play_sine_wave),~
+- Inside source: true
+*** True Line Result
+ method_to_call: :play_sine_wave),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 5.0, col: 0, text: "400hz",~
+- Inside source: true
+*** True Line Result
+ row: 5.0, col: 0, text: "400hz",
+** Processing line: ~ frequency: 400,~
+- Inside source: true
+*** True Line Result
+ frequency: 400,
+** Processing line: ~ method_to_call: :play_sine_wave),~
+- Inside source: true
+*** True Line Result
+ method_to_call: :play_sine_wave),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 6.0, col: 0, text: "500hz",~
+- Inside source: true
+*** True Line Result
+ row: 6.0, col: 0, text: "500hz",
+** Processing line: ~ frequency: 500,~
+- Inside source: true
+*** True Line Result
+ frequency: 500,
+** Processing line: ~ method_to_call: :play_sine_wave),~
+- Inside source: true
+*** True Line Result
+ method_to_call: :play_sine_wave),
+** 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 sine_wave_note_buttons args~
+- Inside source: true
+*** True Line Result
+ def sine_wave_note_buttons args
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 1.5, col: 2, text: "Sine C4",~
+- Inside source: true
+*** True Line Result
+ row: 1.5, col: 2, text: "Sine C4",
+** Processing line: ~ note: :c, octave: 4, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 4, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 2.5, col: 2, text: "Sine D4",~
+- Inside source: true
+*** True Line Result
+ row: 2.5, col: 2, text: "Sine D4",
+** Processing line: ~ note: :d, octave: 4, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :d, octave: 4, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 3.5, col: 2, text: "Sine E4",~
+- Inside source: true
+*** True Line Result
+ row: 3.5, col: 2, text: "Sine E4",
+** Processing line: ~ note: :e, octave: 4, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :e, octave: 4, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 4.5, col: 2, text: "Sine F4",~
+- Inside source: true
+*** True Line Result
+ row: 4.5, col: 2, text: "Sine F4",
+** Processing line: ~ note: :f, octave: 4, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :f, octave: 4, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 5.5, col: 2, text: "Sine G4",~
+- Inside source: true
+*** True Line Result
+ row: 5.5, col: 2, text: "Sine G4",
+** Processing line: ~ note: :g, octave: 4, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :g, octave: 4, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 6.5, col: 2, text: "Sine A5",~
+- Inside source: true
+*** True Line Result
+ row: 6.5, col: 2, text: "Sine A5",
+** Processing line: ~ note: :a, octave: 5, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :a, octave: 5, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 7.5, col: 2, text: "Sine B5",~
+- Inside source: true
+*** True Line Result
+ row: 7.5, col: 2, text: "Sine B5",
+** Processing line: ~ note: :b, octave: 5, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :b, octave: 5, type: :sine, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 8.5, col: 2, text: "Sine C5",~
+- Inside source: true
+*** True Line Result
+ row: 8.5, col: 2, text: "Sine C5",
+** Processing line: ~ note: :c, octave: 5, type: :sine, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 5, type: :sine, method_to_call: :play_note),
+** 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 square_wave_note_buttons args~
+- Inside source: true
+*** True Line Result
+ def square_wave_note_buttons args
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 1.5, col: 6, text: "Square C4",~
+- Inside source: true
+*** True Line Result
+ row: 1.5, col: 6, text: "Square C4",
+** Processing line: ~ note: :c, octave: 4, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 4, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 2.5, col: 6, text: "Square D4",~
+- Inside source: true
+*** True Line Result
+ row: 2.5, col: 6, text: "Square D4",
+** Processing line: ~ note: :d, octave: 4, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :d, octave: 4, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 3.5, col: 6, text: "Square E4",~
+- Inside source: true
+*** True Line Result
+ row: 3.5, col: 6, text: "Square E4",
+** Processing line: ~ note: :e, octave: 4, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :e, octave: 4, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 4.5, col: 6, text: "Square F4",~
+- Inside source: true
+*** True Line Result
+ row: 4.5, col: 6, text: "Square F4",
+** Processing line: ~ note: :f, octave: 4, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :f, octave: 4, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 5.5, col: 6, text: "Square G4",~
+- Inside source: true
+*** True Line Result
+ row: 5.5, col: 6, text: "Square G4",
+** Processing line: ~ note: :g, octave: 4, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :g, octave: 4, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 6.5, col: 6, text: "Square A5",~
+- Inside source: true
+*** True Line Result
+ row: 6.5, col: 6, text: "Square A5",
+** Processing line: ~ note: :a, octave: 5, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :a, octave: 5, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 7.5, col: 6, text: "Square B5",~
+- Inside source: true
+*** True Line Result
+ row: 7.5, col: 6, text: "Square B5",
+** Processing line: ~ note: :b, octave: 5, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :b, octave: 5, type: :square, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 8.5, col: 6, text: "Square C5",~
+- Inside source: true
+*** True Line Result
+ row: 8.5, col: 6, text: "Square C5",
+** Processing line: ~ note: :c, octave: 5, type: :square, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 5, type: :square, method_to_call: :play_note),
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ def saw_tooth_wave_note_buttons args~
+- Inside source: true
+*** True Line Result
+ def saw_tooth_wave_note_buttons args
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 1.5, col: 8, text: "Saw C4",~
+- Inside source: true
+*** True Line Result
+ row: 1.5, col: 8, text: "Saw C4",
+** Processing line: ~ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 2.5, col: 8, text: "Saw D4",~
+- Inside source: true
+*** True Line Result
+ row: 2.5, col: 8, text: "Saw D4",
+** Processing line: ~ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 3.5, col: 8, text: "Saw E4",~
+- Inside source: true
+*** True Line Result
+ row: 3.5, col: 8, text: "Saw E4",
+** Processing line: ~ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 4.5, col: 8, text: "Saw F4",~
+- Inside source: true
+*** True Line Result
+ row: 4.5, col: 8, text: "Saw F4",
+** Processing line: ~ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 5.5, col: 8, text: "Saw G4",~
+- Inside source: true
+*** True Line Result
+ row: 5.5, col: 8, text: "Saw G4",
+** Processing line: ~ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 6.5, col: 8, text: "Saw A5",~
+- Inside source: true
+*** True Line Result
+ row: 6.5, col: 8, text: "Saw A5",
+** Processing line: ~ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 7.5, col: 8, text: "Saw B5",~
+- Inside source: true
+*** True Line Result
+ row: 7.5, col: 8, text: "Saw B5",
+** Processing line: ~ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 8.5, col: 8, text: "Saw C5",~
+- Inside source: true
+*** True Line Result
+ row: 8.5, col: 8, text: "Saw C5",
+** Processing line: ~ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),
+** 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 triangle_wave_note_buttons args~
+- Inside source: true
+*** True Line Result
+ def triangle_wave_note_buttons args
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 1.5, col: 10, text: "Triangle C4",~
+- Inside source: true
+*** True Line Result
+ row: 1.5, col: 10, text: "Triangle C4",
+** Processing line: ~ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 2.5, col: 10, text: "Triangle D4",~
+- Inside source: true
+*** True Line Result
+ row: 2.5, col: 10, text: "Triangle D4",
+** Processing line: ~ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 3.5, col: 10, text: "Triangle E4",~
+- Inside source: true
+*** True Line Result
+ row: 3.5, col: 10, text: "Triangle E4",
+** Processing line: ~ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 4.5, col: 10, text: "Triangle F4",~
+- Inside source: true
+*** True Line Result
+ row: 4.5, col: 10, text: "Triangle F4",
+** Processing line: ~ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 5.5, col: 10, text: "Triangle G4",~
+- Inside source: true
+*** True Line Result
+ row: 5.5, col: 10, text: "Triangle G4",
+** Processing line: ~ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 6.5, col: 10, text: "Triangle A5",~
+- Inside source: true
+*** True Line Result
+ row: 6.5, col: 10, text: "Triangle A5",
+** Processing line: ~ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 7.5, col: 10, text: "Triangle B5",~
+- Inside source: true
+*** True Line Result
+ row: 7.5, col: 10, text: "Triangle B5",
+** Processing line: ~ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 8.5, col: 10, text: "Triangle C5",~
+- Inside source: true
+*** True Line Result
+ row: 8.5, col: 10, text: "Triangle C5",
+** Processing line: ~ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),
+** 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 bell_buttons args~
+- Inside source: true
+*** True Line Result
+ def bell_buttons args
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 1.5, col: 4, text: "Bell C4",~
+- Inside source: true
+*** True Line Result
+ row: 1.5, col: 4, text: "Bell C4",
+** Processing line: ~ note: :c, octave: 4, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 4, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 2.5, col: 4, text: "Bell D4",~
+- Inside source: true
+*** True Line Result
+ row: 2.5, col: 4, text: "Bell D4",
+** Processing line: ~ note: :d, octave: 4, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :d, octave: 4, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 3.5, col: 4, text: "Bell E4",~
+- Inside source: true
+*** True Line Result
+ row: 3.5, col: 4, text: "Bell E4",
+** Processing line: ~ note: :e, octave: 4, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :e, octave: 4, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 4.5, col: 4, text: "Bell F4",~
+- Inside source: true
+*** True Line Result
+ row: 4.5, col: 4, text: "Bell F4",
+** Processing line: ~ note: :f, octave: 4, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :f, octave: 4, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 5.5, col: 4, text: "Bell G4",~
+- Inside source: true
+*** True Line Result
+ row: 5.5, col: 4, text: "Bell G4",
+** Processing line: ~ note: :g, octave: 4, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :g, octave: 4, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 6.5, col: 4, text: "Bell A5",~
+- Inside source: true
+*** True Line Result
+ row: 6.5, col: 4, text: "Bell A5",
+** Processing line: ~ note: :a, octave: 5, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :a, octave: 5, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 7.5, col: 4, text: "Bell B5",~
+- Inside source: true
+*** True Line Result
+ row: 7.5, col: 4, text: "Bell B5",
+** Processing line: ~ note: :b, octave: 5, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :b, octave: 5, type: :bell, method_to_call: :play_note),
+** Processing line: ~ (button args,~
+- Inside source: true
+*** True Line Result
+ (button args,
+** Processing line: ~ row: 8.5, col: 4, text: "Bell C5",~
+- Inside source: true
+*** True Line Result
+ row: 8.5, col: 4, text: "Bell C5",
+** Processing line: ~ note: :c, octave: 5, type: :bell, method_to_call: :play_note),~
+- Inside source: true
+*** True Line Result
+ note: :c, octave: 5, type: :bell, method_to_call: :play_note),
+** 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: ~ begin # region: wave generation~
+- Inside source: true
+*** True Line Result
+ begin # region: wave generation
+** Processing line: ~ begin # sine wave~
+- Inside source: true
+*** True Line Result
+ begin # sine wave
+** Processing line: ~ def defaults_sine_wave_for~
+- Inside source: true
+*** True Line Result
+ def defaults_sine_wave_for
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, sample_rate: 48000 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def sine_wave_for opts = {}~
+- Inside source: true
+*** True Line Result
+ def sine_wave_for opts = {}
+** Processing line: ~ opts = defaults_sine_wave_for.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_sine_wave_for.merge opts
+** Processing line: ~ frequency = opts[:frequency]~
+- Inside source: true
+*** True Line Result
+ frequency = opts[:frequency]
+** Processing line: ~ sample_rate = opts[:sample_rate]~
+- Inside source: true
+*** True Line Result
+ sample_rate = opts[:sample_rate]
+** Processing line: ~ period_size = (sample_rate.fdiv frequency).ceil~
+- Inside source: true
+*** True Line Result
+ period_size = (sample_rate.fdiv frequency).ceil
+** Processing line: ~ period_size.map_with_index do |i|~
+- Inside source: true
+*** True Line Result
+ period_size.map_with_index do |i|
+** Processing line: ~ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)~
+- Inside source: true
+*** True Line Result
+ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)
+** Processing line: ~ end.to_a~
+- Inside source: true
+*** True Line Result
+ end.to_a
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def defaults_queue_sine_wave~
+- Inside source: true
+*** True Line Result
+ def defaults_queue_sine_wave
+** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def queue_sine_wave args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def queue_sine_wave args, opts = {}
+** Processing line: ~ opts = defaults_queue_sine_wave.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_queue_sine_wave.merge opts
+** Processing line: ~ frequency = opts[:frequency]~
+- Inside source: true
+*** True Line Result
+ frequency = opts[:frequency]
+** Processing line: ~ sample_rate = 48000~
+- Inside source: true
+*** True Line Result
+ sample_rate = 48000
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ proc = lambda do~
+- Inside source: true
+*** True Line Result
+ proc = lambda do
+** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~
+- Inside source: true
+*** True Line Result
+ generate_audio_data args.state.sine_waves[frequency], sample_rate
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ audio_state = new_audio_state args, opts~
+- Inside source: true
+*** True Line Result
+ audio_state = new_audio_state args, opts
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+- Inside source: true
+*** True Line Result
+ audio_state[:input] = [1, sample_rate, proc]
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: sine_wave~
+- Inside source: true
+*** True Line Result
+ queue_audio args, audio_state: audio_state, wave: sine_wave
+** 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: ~ begin # region: square wave~
+- Inside source: true
+*** True Line Result
+ begin # region: square wave
+** Processing line: ~ def defaults_square_wave_for~
+- Inside source: true
+*** True Line Result
+ def defaults_square_wave_for
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, sample_rate: 48000 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def square_wave_for opts = {}~
+- Inside source: true
+*** True Line Result
+ def square_wave_for opts = {}
+** Processing line: ~ opts = defaults_square_wave_for.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_square_wave_for.merge opts
+** Processing line: ~ sine_wave = sine_wave_for opts~
+- Inside source: true
+*** True Line Result
+ sine_wave = sine_wave_for opts
+** Processing line: ~ sine_wave.map do |v|~
+- Inside source: true
+*** True Line Result
+ sine_wave.map do |v|
+** Processing line: ~ if v >= 0~
+- Inside source: true
+*** True Line Result
+ if v >= 0
+** Processing line: ~ 1.0~
+- Inside source: true
+*** True Line Result
+ 1.0
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ -1.0~
+- Inside source: true
+*** True Line Result
+ -1.0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end.to_a~
+- Inside source: true
+*** True Line Result
+ end.to_a
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def defaults_queue_square_wave~
+- Inside source: true
+*** True Line Result
+ def defaults_queue_square_wave
+** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def queue_square_wave args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def queue_square_wave args, opts = {}
+** Processing line: ~ opts = defaults_queue_square_wave.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_queue_square_wave.merge opts
+** Processing line: ~ frequency = opts[:frequency]~
+- Inside source: true
+*** True Line Result
+ frequency = opts[:frequency]
+** Processing line: ~ sample_rate = 48000~
+- Inside source: true
+*** True Line Result
+ sample_rate = 48000
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ proc = lambda do~
+- Inside source: true
+*** True Line Result
+ proc = lambda do
+** Processing line: ~ generate_audio_data args.state.square_waves[frequency], sample_rate~
+- Inside source: true
+*** True Line Result
+ generate_audio_data args.state.square_waves[frequency], sample_rate
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ audio_state = new_audio_state args, opts~
+- Inside source: true
+*** True Line Result
+ audio_state = new_audio_state args, opts
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+- Inside source: true
+*** True Line Result
+ audio_state[:input] = [1, sample_rate, proc]
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: square_wave~
+- Inside source: true
+*** True Line Result
+ queue_audio args, audio_state: audio_state, wave: square_wave
+** 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: ~ begin # region: saw tooth wave~
+- Inside source: true
+*** True Line Result
+ begin # region: saw tooth wave
+** Processing line: ~ def defaults_saw_tooth_wave_for~
+- Inside source: true
+*** True Line Result
+ def defaults_saw_tooth_wave_for
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, sample_rate: 48000 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def saw_tooth_wave_for opts = {}~
+- Inside source: true
+*** True Line Result
+ def saw_tooth_wave_for opts = {}
+** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_saw_tooth_wave_for.merge opts
+** Processing line: ~ sine_wave = sine_wave_for opts~
+- Inside source: true
+*** True Line Result
+ sine_wave = sine_wave_for opts
+** Processing line: ~ period_size = sine_wave.length~
+- Inside source: true
+*** True Line Result
+ period_size = sine_wave.length
+** Processing line: ~ sine_wave.map_with_index do |v, i|~
+- Inside source: true
+*** True Line Result
+ sine_wave.map_with_index do |v, i|
+** Processing line: ~ (((i % period_size).fdiv period_size) * 2) - 1~
+- Inside source: true
+*** True Line Result
+ (((i % period_size).fdiv period_size) * 2) - 1
+** 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 defaults_queue_saw_tooth_wave~
+- Inside source: true
+*** True Line Result
+ def defaults_queue_saw_tooth_wave
+** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def queue_saw_tooth_wave args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def queue_saw_tooth_wave args, opts = {}
+** Processing line: ~ opts = defaults_queue_saw_tooth_wave.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_queue_saw_tooth_wave.merge opts
+** Processing line: ~ frequency = opts[:frequency]~
+- Inside source: true
+*** True Line Result
+ frequency = opts[:frequency]
+** Processing line: ~ sample_rate = 48000~
+- Inside source: true
+*** True Line Result
+ sample_rate = 48000
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ proc = lambda do~
+- Inside source: true
+*** True Line Result
+ proc = lambda do
+** Processing line: ~ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate~
+- Inside source: true
+*** True Line Result
+ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ audio_state = new_audio_state args, opts~
+- Inside source: true
+*** True Line Result
+ audio_state = new_audio_state args, opts
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+- Inside source: true
+*** True Line Result
+ audio_state[:input] = [1, sample_rate, proc]
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave~
+- Inside source: true
+*** True Line Result
+ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave
+** 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: ~ begin # region: triangle wave~
+- Inside source: true
+*** True Line Result
+ begin # region: triangle wave
+** Processing line: ~ def defaults_triangle_wave_for~
+- Inside source: true
+*** True Line Result
+ def defaults_triangle_wave_for
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, sample_rate: 48000 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def triangle_wave_for opts = {}~
+- Inside source: true
+*** True Line Result
+ def triangle_wave_for opts = {}
+** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_saw_tooth_wave_for.merge opts
+** Processing line: ~ sine_wave = sine_wave_for opts~
+- Inside source: true
+*** True Line Result
+ sine_wave = sine_wave_for opts
+** Processing line: ~ period_size = sine_wave.length~
+- Inside source: true
+*** True Line Result
+ period_size = sine_wave.length
+** Processing line: ~ sine_wave.map_with_index do |v, i|~
+- Inside source: true
+*** True Line Result
+ sine_wave.map_with_index do |v, i|
+** Processing line: ~ ratio = (i.fdiv period_size)~
+- Inside source: true
+*** True Line Result
+ ratio = (i.fdiv period_size)
+** Processing line: ~ if ratio <= 0.5~
+- Inside source: true
+*** True Line Result
+ if ratio <= 0.5
+** Processing line: ~ (ratio * 4) - 1~
+- Inside source: true
+*** True Line Result
+ (ratio * 4) - 1
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ ratio -= 0.5~
+- Inside source: true
+*** True Line Result
+ ratio -= 0.5
+** Processing line: ~ 1 - (ratio * 4)~
+- Inside source: true
+*** True Line Result
+ 1 - (ratio * 4)
+** 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 defaults_queue_triangle_wave~
+- Inside source: true
+*** True Line Result
+ def defaults_queue_triangle_wave
+** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def queue_triangle_wave args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def queue_triangle_wave args, opts = {}
+** Processing line: ~ opts = defaults_queue_triangle_wave.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_queue_triangle_wave.merge opts
+** Processing line: ~ frequency = opts[:frequency]~
+- Inside source: true
+*** True Line Result
+ frequency = opts[:frequency]
+** Processing line: ~ sample_rate = 48000~
+- Inside source: true
+*** True Line Result
+ sample_rate = 48000
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate~
+- Inside source: true
+*** True Line Result
+ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ proc = lambda do~
+- Inside source: true
+*** True Line Result
+ proc = lambda do
+** Processing line: ~ generate_audio_data args.state.triangle_waves[frequency], sample_rate~
+- Inside source: true
+*** True Line Result
+ generate_audio_data args.state.triangle_waves[frequency], sample_rate
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ audio_state = new_audio_state args, opts~
+- Inside source: true
+*** True Line Result
+ audio_state = new_audio_state args, opts
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+- Inside source: true
+*** True Line Result
+ audio_state[:input] = [1, sample_rate, proc]
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: triangle_wave~
+- Inside source: true
+*** True Line Result
+ queue_audio args, audio_state: audio_state, wave: triangle_wave
+** 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: ~ begin # region: bell~
+- Inside source: true
+*** True Line Result
+ begin # region: bell
+** Processing line: ~ def defaults_queue_bell~
+- Inside source: true
+*** True Line Result
+ def defaults_queue_bell
+** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 1.seconds, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def queue_bell args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def queue_bell args, opts = {}
+** Processing line: ~ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }~
+- Inside source: true
+*** True Line Result
+ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def bell_harmonics~
+- Inside source: true
+*** True Line Result
+ def bell_harmonics
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ { frequency_ratio: 0.5, duration_ratio: 1.00 },~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 0.5, duration_ratio: 1.00 },
+** Processing line: ~ { frequency_ratio: 1.0, duration_ratio: 0.80 },~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 1.0, duration_ratio: 0.80 },
+** Processing line: ~ { frequency_ratio: 2.0, duration_ratio: 0.60 },~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 2.0, duration_ratio: 0.60 },
+** Processing line: ~ { frequency_ratio: 3.0, duration_ratio: 0.40 },~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 3.0, duration_ratio: 0.40 },
+** Processing line: ~ { frequency_ratio: 4.2, duration_ratio: 0.25 },~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 4.2, duration_ratio: 0.25 },
+** Processing line: ~ { frequency_ratio: 5.4, duration_ratio: 0.20 },~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 5.4, duration_ratio: 0.20 },
+** Processing line: ~ { frequency_ratio: 6.8, duration_ratio: 0.15 }~
+- Inside source: true
+*** True Line Result
+ { frequency_ratio: 6.8, duration_ratio: 0.15 }
+** 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_bell_to_sine_waves~
+- Inside source: true
+*** True Line Result
+ def defaults_bell_to_sine_waves
+** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 1.seconds, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def bell_to_sine_waves opts = {}~
+- Inside source: true
+*** True Line Result
+ def bell_to_sine_waves opts = {}
+** Processing line: ~ opts = defaults_bell_to_sine_waves.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_bell_to_sine_waves.merge opts
+** Processing line: ~ bell_harmonics.map do |b|~
+- Inside source: true
+*** True Line Result
+ bell_harmonics.map do |b|
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ frequency: opts[:frequency] * b[:frequency_ratio],~
+- Inside source: true
+*** True Line Result
+ frequency: opts[:frequency] * b[:frequency_ratio],
+** Processing line: ~ duration: opts[:duration] * b[:duration_ratio],~
+- Inside source: true
+*** True Line Result
+ duration: opts[:duration] * b[:duration_ratio],
+** Processing line: ~ queue_in: opts[:queue_in],~
+- Inside source: true
+*** True Line Result
+ queue_in: opts[:queue_in],
+** Processing line: ~ gain: (1.fdiv bell_harmonics.length),~
+- Inside source: true
+*** True Line Result
+ gain: (1.fdiv bell_harmonics.length),
+** Processing line: ~ fade_out: true~
+- Inside source: true
+*** True Line Result
+ fade_out: true
+** 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~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ begin # audio entity construction~
+- Inside source: true
+*** True Line Result
+ begin # audio entity construction
+** Processing line: ~ def generate_audio_data sine_wave, sample_rate~
+- Inside source: true
+*** True Line Result
+ def generate_audio_data sine_wave, sample_rate
+** Processing line: ~ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil~
+- Inside source: true
+*** True Line Result
+ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil
+** Processing line: ~ copy_count = (sample_size.fdiv sine_wave.length).ceil~
+- Inside source: true
+*** True Line Result
+ copy_count = (sample_size.fdiv sine_wave.length).ceil
+** Processing line: ~ sine_wave * copy_count~
+- Inside source: true
+*** True Line Result
+ sine_wave * copy_count
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def defaults_new_audio_state~
+- Inside source: true
+*** True Line Result
+ def defaults_new_audio_state
+** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
+- Inside source: true
+*** True Line Result
+ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def new_audio_state args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def new_audio_state args, opts = {}
+** Processing line: ~ opts = defaults_new_audio_state.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_new_audio_state.merge opts
+** Processing line: ~ decay_rate = 0~
+- Inside source: true
+*** True Line Result
+ decay_rate = 0
+** Processing line: ~ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]~
+- Inside source: true
+*** True Line Result
+ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]
+** Processing line: ~ frequency = opts[:frequency]~
+- Inside source: true
+*** True Line Result
+ frequency = opts[:frequency]
+** Processing line: ~ sample_rate = 48000~
+- Inside source: true
+*** True Line Result
+ sample_rate = 48000
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ id: (new_id! args),~
+- Inside source: true
+*** True Line Result
+ id: (new_id! args),
+** Processing line: ~ frequency: frequency,~
+- Inside source: true
+*** True Line Result
+ frequency: frequency,
+** Processing line: ~ sample_rate: 48000,~
+- Inside source: true
+*** True Line Result
+ sample_rate: 48000,
+** Processing line: ~ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],~
+- Inside source: true
+*** True Line Result
+ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],
+** Processing line: ~ gain: opts[:gain].to_f,~
+- Inside source: true
+*** True Line Result
+ gain: opts[:gain].to_f,
+** Processing line: ~ queue_at: args.state.tick_count + opts[:queue_in],~
+- Inside source: true
+*** True Line Result
+ queue_at: args.state.tick_count + opts[:queue_in],
+** Processing line: ~ decay_rate: decay_rate,~
+- Inside source: true
+*** True Line Result
+ decay_rate: decay_rate,
+** Processing line: ~ pitch: 1.0,~
+- Inside source: true
+*** True Line Result
+ pitch: 1.0,
+** Processing line: ~ looping: true,~
+- Inside source: true
+*** True Line Result
+ looping: true,
+** Processing line: ~ paused: false~
+- Inside source: true
+*** True Line Result
+ paused: false
+** 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 queue_audio args, opts = {}~
+- Inside source: true
+*** True Line Result
+ def queue_audio args, opts = {}
+** Processing line: ~ graph_wave args, opts[:wave], opts[:audio_state][:frequency]~
+- Inside source: true
+*** True Line Result
+ graph_wave args, opts[:wave], opts[:audio_state][:frequency]
+** Processing line: ~ args.state.audio_queue << opts[:audio_state]~
+- Inside source: true
+*** True Line Result
+ args.state.audio_queue << opts[:audio_state]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def new_id! args~
+- Inside source: true
+*** True Line Result
+ def new_id! args
+** Processing line: ~ args.state.audio_id ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.audio_id ||= 0
+** Processing line: ~ args.state.audio_id += 1~
+- Inside source: true
+*** True Line Result
+ args.state.audio_id += 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def graph_wave args, wave, frequency~
+- Inside source: true
+*** True Line Result
+ def graph_wave args, wave, frequency
+** Processing line: ~ if args.state.tick_count != args.state.graphed_at~
+- Inside source: true
+*** True Line Result
+ if args.state.tick_count != args.state.graphed_at
+** Processing line: ~ args.outputs.static_lines.clear~
+- Inside source: true
+*** True Line Result
+ args.outputs.static_lines.clear
+** Processing line: ~ args.outputs.static_sprites.clear~
+- Inside source: true
+*** True Line Result
+ args.outputs.static_sprites.clear
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ wave = wave~
+- Inside source: true
+*** True Line Result
+ wave = wave
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ r, g, b = frequency.to_i % 85,~
+- Inside source: true
+*** True Line Result
+ r, g, b = frequency.to_i % 85,
+** Processing line: ~ frequency.to_i % 170,~
+- Inside source: true
+*** True Line Result
+ frequency.to_i % 170,
+** Processing line: ~ frequency.to_i % 255~
+- Inside source: true
+*** True Line Result
+ frequency.to_i % 255
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ starting_rect = args.layout.rect(row: 5, col: 13)~
+- Inside source: true
+*** True Line Result
+ starting_rect = args.layout.rect(row: 5, col: 13)
+** Processing line: ~ x_scale = 10~
+- Inside source: true
+*** True Line Result
+ x_scale = 10
+** Processing line: ~ y_scale = 100~
+- Inside source: true
+*** True Line Result
+ y_scale = 100
+** Processing line: ~ max_points = 25~
+- Inside source: true
+*** True Line Result
+ max_points = 25
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ points = wave~
+- Inside source: true
+*** True Line Result
+ points = wave
+** Processing line: ~ if wave.length > max_points~
+- Inside source: true
+*** True Line Result
+ if wave.length > max_points
+** Processing line: ~ resolution = wave.length.idiv max_points~
+- Inside source: true
+*** True Line Result
+ resolution = wave.length.idiv max_points
+** Processing line: ~ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }~
+- Inside source: true
+*** True Line Result
+ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.static_lines << points.map_with_index do |y, x|~
+- Inside source: true
+*** True Line Result
+ args.outputs.static_lines << points.map_with_index do |y, x|
+** Processing line: ~ next_y = points[x + 1]~
+- Inside source: true
+*** True Line Result
+ next_y = points[x + 1]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if next_y~
+- Inside source: true
+*** True Line Result
+ if next_y
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ x: starting_rect.x + (x * x_scale),~
+- Inside source: true
+*** True Line Result
+ x: starting_rect.x + (x * x_scale),
+** Processing line: ~ y: starting_rect.y + starting_rect.h.half + y_scale * y,~
+- Inside source: true
+*** True Line Result
+ y: starting_rect.y + starting_rect.h.half + y_scale * y,
+** Processing line: ~ x2: starting_rect.x + ((x + 1) * x_scale),~
+- Inside source: true
+*** True Line Result
+ x2: starting_rect.x + ((x + 1) * x_scale),
+** Processing line: ~ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,~
+- Inside source: true
+*** True Line Result
+ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,
+** Processing line: ~ r: r,~
+- Inside source: true
+*** True Line Result
+ r: r,
+** Processing line: ~ g: g,~
+- Inside source: true
+*** True Line Result
+ g: g,
+** Processing line: ~ b: b~
+- Inside source: true
+*** True Line Result
+ b: b
+** 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: ~ args.outputs.static_sprites << points.map_with_index do |y, x|~
+- Inside source: true
+*** True Line Result
+ args.outputs.static_sprites << points.map_with_index do |y, x|
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ x: (starting_rect.x + (x * x_scale)) - 2,~
+- Inside source: true
+*** True Line Result
+ x: (starting_rect.x + (x * x_scale)) - 2,
+** Processing line: ~ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,~
+- Inside source: true
+*** True Line Result
+ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,
+** Processing line: ~ w: 4,~
+- Inside source: true
+*** True Line Result
+ w: 4,
+** Processing line: ~ h: 4,~
+- Inside source: true
+*** True Line Result
+ h: 4,
+** Processing line: ~ path: 'sprites/square-white.png',~
+- Inside source: true
+*** True Line Result
+ path: 'sprites/square-white.png',
+** Processing line: ~ r: r,~
+- Inside source: true
+*** True Line Result
+ r: r,
+** Processing line: ~ g: g,~
+- Inside source: true
+*** True Line Result
+ g: g,
+** Processing line: ~ b: b~
+- Inside source: true
+*** True Line Result
+ b: b
+** 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.state.graphed_at = args.state.tick_count~
+- Inside source: true
+*** True Line Result
+ args.state.graphed_at = args.state.tick_count
+** 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: ~ begin # region: musical note mapping~
+- Inside source: true
+*** True Line Result
+ begin # region: musical note mapping
+** Processing line: ~ def defaults_frequency_for~
+- Inside source: true
+*** True Line Result
+ def defaults_frequency_for
+** Processing line: ~ { note: :a, octave: 5, sharp: false, flat: false }~
+- Inside source: true
+*** True Line Result
+ { note: :a, octave: 5, sharp: false, flat: false }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def frequency_for opts = {}~
+- Inside source: true
+*** True Line Result
+ def frequency_for opts = {}
+** Processing line: ~ opts = defaults_frequency_for.merge opts~
+- Inside source: true
+*** True Line Result
+ opts = defaults_frequency_for.merge opts
+** Processing line: ~ octave_offset_multiplier = opts[:octave] - 5~
+- Inside source: true
+*** True Line Result
+ octave_offset_multiplier = opts[:octave] - 5
+** Processing line: ~ note = note_frequencies_octave_5[opts[:note]]~
+- Inside source: true
+*** True Line Result
+ note = note_frequencies_octave_5[opts[:note]]
+** Processing line: ~ if octave_offset_multiplier < 0~
+- Inside source: true
+*** True Line Result
+ if octave_offset_multiplier < 0
+** Processing line: ~ note = note * 1 / (octave_offset_multiplier.abs + 1)~
+- Inside source: true
+*** True Line Result
+ note = note * 1 / (octave_offset_multiplier.abs + 1)
+** Processing line: ~ elsif octave_offset_multiplier > 0~
+- Inside source: true
+*** True Line Result
+ elsif octave_offset_multiplier > 0
+** Processing line: ~ note = note * (octave_offset_multiplier.abs + 1) / 1~
+- Inside source: true
+*** True Line Result
+ note = note * (octave_offset_multiplier.abs + 1) / 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ note~
+- Inside source: true
+*** True Line Result
+ note
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def note_frequencies_octave_5~
+- Inside source: true
+*** True Line Result
+ def note_frequencies_octave_5
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ a: 440.0,~
+- Inside source: true
+*** True Line Result
+ a: 440.0,
+** Processing line: ~ a_sharp: 466.16, b_flat: 466.16,~
+- Inside source: true
+*** True Line Result
+ a_sharp: 466.16, b_flat: 466.16,
+** Processing line: ~ b: 493.88,~
+- Inside source: true
+*** True Line Result
+ b: 493.88,
+** Processing line: ~ c: 523.25,~
+- Inside source: true
+*** True Line Result
+ c: 523.25,
+** Processing line: ~ c_sharp: 554.37, d_flat: 587.33,~
+- Inside source: true
+*** True Line Result
+ c_sharp: 554.37, d_flat: 587.33,
+** Processing line: ~ d: 587.33,~
+- Inside source: true
+*** True Line Result
+ d: 587.33,
+** Processing line: ~ d_sharp: 622.25, e_flat: 659.25,~
+- Inside source: true
+*** True Line Result
+ d_sharp: 622.25, e_flat: 659.25,
+** Processing line: ~ e: 659.25,~
+- Inside source: true
+*** True Line Result
+ e: 659.25,
+** Processing line: ~ f: 698.25,~
+- Inside source: true
+*** True Line Result
+ f: 698.25,
+** Processing line: ~ f_sharp: 739.99, g_flat: 739.99,~
+- Inside source: true
+*** True Line Result
+ f_sharp: 739.99, g_flat: 739.99,
+** Processing line: ~ g: 783.99,~
+- Inside source: true
+*** True Line Result
+ g: 783.99,
+** Processing line: ~ g_sharp: 830.61, a_flat: 830.61~
+- Inside source: true
+*** True Line Result
+ g_sharp: 830.61, a_flat: 830.61
+** 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~
+- 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: ~*** Advanced Rendering - Simple Render Targets - main.rb~
- Header detected.
*** True Line Result
@@ -49224,10 +50779,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
angle_anchor_y: 0.5
-** Processing line: ~ }.sprite~
+** Processing line: ~ }.sprite!~
- Inside source: true
*** True Line Result
- }.sprite
+ }.sprite!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -49280,10 +50835,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
font: "fonts/manaspc.ttf" # font style
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
- Inside source: true
*** True Line Result
- }.label
+ }.label!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -49328,10 +50883,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 255 # transparency
-** Processing line: ~ }.solid~
+** Processing line: ~ }.solid!~
- Inside source: true
*** True Line Result
- }.solid
+ }.solid!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -49380,10 +50935,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 255 # transparency
-** Processing line: ~ }.border~
+** Processing line: ~ }.border!~
- Inside source: true
*** True Line Result
- }.border
+ }.border!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -49428,10 +50983,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 255 # transparency
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
- Inside source: true
*** True Line Result
- }.line
+ }.line!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -49640,6 +51195,406 @@ 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 - Simple Camera - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Rendering - Simple Camera - 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/07_simple_camera/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_rendering/07_simple_camera/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ # variables you can play around with~
+- Inside source: true
+*** True Line Result
+ # variables you can play around with
+** Processing line: ~ args.state.world.w ||= 1280~
+- Inside source: true
+*** True Line Result
+ args.state.world.w ||= 1280
+** Processing line: ~ args.state.world.h ||= 720~
+- Inside source: true
+*** True Line Result
+ args.state.world.h ||= 720
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.player.x ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.x ||= 0
+** Processing line: ~ args.state.player.y ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.y ||= 0
+** Processing line: ~ args.state.player.size ||= 32~
+- Inside source: true
+*** True Line Result
+ args.state.player.size ||= 32
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.enemy.x ||= 700~
+- Inside source: true
+*** True Line Result
+ args.state.enemy.x ||= 700
+** Processing line: ~ args.state.enemy.y ||= 700~
+- Inside source: true
+*** True Line Result
+ args.state.enemy.y ||= 700
+** Processing line: ~ args.state.enemy.size ||= 16~
+- Inside source: true
+*** True Line Result
+ args.state.enemy.size ||= 16
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.camera.x ||= 640~
+- Inside source: true
+*** True Line Result
+ args.state.camera.x ||= 640
+** Processing line: ~ args.state.camera.y ||= 300~
+- Inside source: true
+*** True Line Result
+ args.state.camera.y ||= 300
+** Processing line: ~ args.state.camera.scale ||= 1.0~
+- Inside source: true
+*** True Line Result
+ args.state.camera.scale ||= 1.0
+** Processing line: ~ args.state.camera.show_empty_space ||= :yes~
+- Inside source: true
+*** True Line Result
+ args.state.camera.show_empty_space ||= :yes
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # instructions~
+- Inside source: true
+*** True Line Result
+ # instructions
+** Processing line: ~ args.outputs.primitives << { x: 0, y: 80.from_top, w: 360, h: 80, r: 0, g: 0, b: 0, a: 128 }.solid!~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << { x: 0, y: 80.from_top, w: 360, h: 80, r: 0, g: 0, b: 0, a: 128 }.solid!
+** Processing line: ~ args.outputs.primitives << { x: 10, y: 10.from_top, text: "arrow keys to move around", r: 255, g: 255, b: 255}.label!~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << { x: 10, y: 10.from_top, text: "arrow keys to move around", r: 255, g: 255, b: 255}.label!
+** Processing line: ~ args.outputs.primitives << { x: 10, y: 30.from_top, text: "+/- to change zoom of camera", r: 255, g: 255, b: 255}.label!~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << { x: 10, y: 30.from_top, text: "+/- to change zoom of camera", r: 255, g: 255, b: 255}.label!
+** Processing line: ~ args.outputs.primitives << { x: 10, y: 50.from_top, text: "tab to change camera edge behavior", r: 255, g: 255, b: 255}.label!~
+- Inside source: true
+*** True Line Result
+ args.outputs.primitives << { x: 10, y: 50.from_top, text: "tab to change camera edge behavior", r: 255, g: 255, b: 255}.label!
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # render scene~
+- Inside source: true
+*** True Line Result
+ # render scene
+** Processing line: ~ args.outputs[:scene].w = args.state.world.w~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].w = args.state.world.w
+** Processing line: ~ args.outputs[:scene].h = args.state.world.h~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].h = args.state.world.h
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs[:scene].solids << { x: 0, y: 0, w: args.state.world.w, h: args.state.world.h, r: 20, g: 60, b: 80 }~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].solids << { x: 0, y: 0, w: args.state.world.w, h: args.state.world.h, r: 20, g: 60, b: 80 }
+** Processing line: ~ args.outputs[:scene].solids << { x: args.state.player.x, y: args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].solids << { x: args.state.player.x, y: args.state.player.y,
+** Processing line: ~ w: args.state.player.size, h: args.state.player.size, r: 80, g: 155, b: 80 }~
+- Inside source: true
+*** True Line Result
+ w: args.state.player.size, h: args.state.player.size, r: 80, g: 155, b: 80 }
+** Processing line: ~ args.outputs[:scene].solids << { x: args.state.enemy.x, y: args.state.enemy.y,~
+- Inside source: true
+*** True Line Result
+ args.outputs[:scene].solids << { x: args.state.enemy.x, y: args.state.enemy.y,
+** Processing line: ~ w: args.state.enemy.size, h: args.state.enemy.size, r: 155, g: 80, b: 80 }~
+- Inside source: true
+*** True Line Result
+ w: args.state.enemy.size, h: args.state.enemy.size, r: 155, g: 80, b: 80 }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # render camera~
+- Inside source: true
+*** True Line Result
+ # render camera
+** Processing line: ~ scene_position = calc_scene_position args~
+- Inside source: true
+*** True Line Result
+ scene_position = calc_scene_position args
+** Processing line: ~ args.outputs.sprites << { x: scene_position.x,~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << { x: scene_position.x,
+** Processing line: ~ y: scene_position.y,~
+- Inside source: true
+*** True Line Result
+ y: scene_position.y,
+** Processing line: ~ w: scene_position.w,~
+- Inside source: true
+*** True Line Result
+ w: scene_position.w,
+** Processing line: ~ h: scene_position.h,~
+- Inside source: true
+*** True Line Result
+ h: scene_position.h,
+** Processing line: ~ path: :scene }~
+- Inside source: true
+*** True Line Result
+ path: :scene }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # move player~
+- Inside source: true
+*** True Line Result
+ # move player
+** Processing line: ~ if args.inputs.directional_angle~
+- Inside source: true
+*** True Line Result
+ if args.inputs.directional_angle
+** Processing line: ~ args.state.player.x += args.inputs.directional_angle.vector_x * 5~
+- Inside source: true
+*** True Line Result
+ args.state.player.x += args.inputs.directional_angle.vector_x * 5
+** Processing line: ~ args.state.player.y += args.inputs.directional_angle.vector_y * 5~
+- Inside source: true
+*** True Line Result
+ args.state.player.y += args.inputs.directional_angle.vector_y * 5
+** Processing line: ~ args.state.player.x = args.state.player.x.clamp(0, args.state.world.w - args.state.player.size)~
+- Inside source: true
+*** True Line Result
+ args.state.player.x = args.state.player.x.clamp(0, args.state.world.w - args.state.player.size)
+** Processing line: ~ args.state.player.y = args.state.player.y.clamp(0, args.state.world.h - args.state.player.size)~
+- Inside source: true
+*** True Line Result
+ args.state.player.y = args.state.player.y.clamp(0, args.state.world.h - args.state.player.size)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # +/- to zoom in and out~
+- Inside source: true
+*** True Line Result
+ # +/- to zoom in and out
+** Processing line: ~ if args.inputs.keyboard.plus && args.state.tick_count.zmod?(3)~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.plus && args.state.tick_count.zmod?(3)
+** Processing line: ~ args.state.camera.scale += 0.05~
+- Inside source: true
+*** True Line Result
+ args.state.camera.scale += 0.05
+** Processing line: ~ elsif args.inputs.keyboard.hyphen && args.state.tick_count.zmod?(3)~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.keyboard.hyphen && args.state.tick_count.zmod?(3)
+** Processing line: ~ args.state.camera.scale -= 0.05~
+- Inside source: true
+*** True Line Result
+ args.state.camera.scale -= 0.05
+** Processing line: ~ elsif args.inputs.keyboard.key_down.tab~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.keyboard.key_down.tab
+** Processing line: ~ if args.state.camera.show_empty_space == :yes~
+- Inside source: true
+*** True Line Result
+ if args.state.camera.show_empty_space == :yes
+** Processing line: ~ args.state.camera.show_empty_space = :no~
+- Inside source: true
+*** True Line Result
+ args.state.camera.show_empty_space = :no
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ args.state.camera.show_empty_space = :yes~
+- Inside source: true
+*** True Line Result
+ args.state.camera.show_empty_space = :yes
+** 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: ~ args.state.camera.scale = args.state.camera.scale.greater(0.1)~
+- Inside source: true
+*** True Line Result
+ args.state.camera.scale = args.state.camera.scale.greater(0.1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_scene_position args~
+- Inside source: true
+*** True Line Result
+ def calc_scene_position args
+** Processing line: ~ result = { x: args.state.camera.x - (args.state.player.x * args.state.camera.scale),~
+- Inside source: true
+*** True Line Result
+ result = { x: args.state.camera.x - (args.state.player.x * args.state.camera.scale),
+** Processing line: ~ y: args.state.camera.y - (args.state.player.y * args.state.camera.scale),~
+- Inside source: true
+*** True Line Result
+ y: args.state.camera.y - (args.state.player.y * args.state.camera.scale),
+** Processing line: ~ w: args.state.world.w * args.state.camera.scale,~
+- Inside source: true
+*** True Line Result
+ w: args.state.world.w * args.state.camera.scale,
+** Processing line: ~ h: args.state.world.h * args.state.camera.scale,~
+- Inside source: true
+*** True Line Result
+ h: args.state.world.h * args.state.camera.scale,
+** Processing line: ~ scale: args.state.camera.scale }~
+- Inside source: true
+*** True Line Result
+ scale: args.state.camera.scale }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ return result if args.state.camera.show_empty_space == :yes~
+- Inside source: true
+*** True Line Result
+ return result if args.state.camera.show_empty_space == :yes
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if result.w < args.grid.w~
+- Inside source: true
+*** True Line Result
+ if result.w < args.grid.w
+** Processing line: ~ result.merge!(x: (args.grid.w - result.w).half)~
+- Inside source: true
+*** True Line Result
+ result.merge!(x: (args.grid.w - result.w).half)
+** Processing line: ~ elsif (args.state.player.x * result.scale) < args.grid.w.half~
+- Inside source: true
+*** True Line Result
+ elsif (args.state.player.x * result.scale) < args.grid.w.half
+** Processing line: ~ result.merge!(x: 10)~
+- Inside source: true
+*** True Line Result
+ result.merge!(x: 10)
+** Processing line: ~ elsif (result.x + result.w) < args.grid.w~
+- Inside source: true
+*** True Line Result
+ elsif (result.x + result.w) < args.grid.w
+** Processing line: ~ result.merge!(x: - result.w + (args.grid.w - 10))~
+- Inside source: true
+*** True Line Result
+ result.merge!(x: - result.w + (args.grid.w - 10))
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if result.h < args.grid.h~
+- Inside source: true
+*** True Line Result
+ if result.h < args.grid.h
+** Processing line: ~ result.merge!(y: (args.grid.h - result.h).half)~
+- Inside source: true
+*** True Line Result
+ result.merge!(y: (args.grid.h - result.h).half)
+** Processing line: ~ elsif (result.y) > 10~
+- Inside source: true
+*** True Line Result
+ elsif (result.y) > 10
+** Processing line: ~ result.merge!(y: 10)~
+- Inside source: true
+*** True Line Result
+ result.merge!(y: 10)
+** Processing line: ~ elsif (result.y + result.h) < args.grid.h~
+- Inside source: true
+*** True Line Result
+ elsif (result.y + result.h) < args.grid.h
+** Processing line: ~ result.merge!(y: - result.h + (args.grid.h - 10))~
+- Inside source: true
+*** True Line Result
+ result.merge!(y: - result.h + (args.grid.h - 10))
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ result~
+- Inside source: true
+*** True Line Result
+ 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
+#+end_src
+** Processing line: ~~
+- End of paragraph detected.
+*** True Line Result
+
** Processing line: ~*** Advanced Rendering - Splitscreen Camera - main.rb~
- Header detected.
*** True Line Result
@@ -49652,10 +51607,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/07_advanced_rendering/07_splitscreen_camera/app/main.rb~
+** Processing line: ~ # ./samples/07_advanced_rendering/08_splitscreen_camera/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/07_advanced_rendering/07_splitscreen_camera/app/main.rb
+ # ./samples/07_advanced_rendering/08_splitscreen_camera/app/main.rb
** Processing line: ~ class CameraMovement~
- Inside source: true
*** True Line Result
@@ -51260,10 +53215,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/07_advanced_rendering/08_z_targeting_camera/app/main.rb~
+** Processing line: ~ # ./samples/07_advanced_rendering/09_z_targeting_camera/app/main.rb~
- Inside source: true
*** True Line Result
- # ./samples/07_advanced_rendering/08_z_targeting_camera/app/main.rb
+ # ./samples/07_advanced_rendering/09_z_targeting_camera/app/main.rb
** Processing line: ~ class Game~
- Inside source: true
*** True Line Result
@@ -51700,6 +53655,230 @@ 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 - Blend Modes - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Rendering - Blend Modes - 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/10_blend_modes/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/07_advanced_rendering/10_blend_modes/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 draw_blendmode args, mode~
+- Inside source: true
+*** True Line Result
+ def draw_blendmode args, mode
+** Processing line: ~ w = 160~
+- Inside source: true
+*** True Line Result
+ w = 160
+** Processing line: ~ h = w~
+- Inside source: true
+*** True Line Result
+ h = w
+** Processing line: ~ args.state.x += (1280-w) / (args.state.blendmodes.length + 1)~
+- Inside source: true
+*** True Line Result
+ args.state.x += (1280-w) / (args.state.blendmodes.length + 1)
+** Processing line: ~ x = args.state.x~
+- Inside source: true
+*** True Line Result
+ x = args.state.x
+** Processing line: ~ y = (720 - h) / 2~
+- Inside source: true
+*** True Line Result
+ y = (720 - h) / 2
+** Processing line: ~ s = 'sprites/blue-feathered.png'~
+- Inside source: true
+*** True Line Result
+ s = 'sprites/blue-feathered.png'
+** Processing line: ~ args.outputs.sprites << { blendmode_enum: mode.value, x: x, y: y, w: w, h: h, path: s }~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << { blendmode_enum: mode.value, x: x, y: y, w: w, h: h, path: s }
+** Processing line: ~ args.outputs.labels << [x + (w/2), y, mode.name.to_s, 1, 1, 255, 255, 255]~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << [x + (w/2), y, mode.name.to_s, 1, 1, 255, 255, 255]
+** 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: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Different blend modes do different things, depending on what they~
+- Inside source: true
+*** True Line Result
+ # Different blend modes do different things, depending on what they
+** Processing line: ~ # blend against (in this case, the pixels of the background color).~
+- Inside source: true
+*** True Line Result
+ # blend against (in this case, the pixels of the background color).
+** Processing line: ~ args.state.bg_element ||= 1~
+- Inside source: true
+*** True Line Result
+ args.state.bg_element ||= 1
+** Processing line: ~ args.state.bg_color ||= 255~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color ||= 255
+** Processing line: ~ args.state.bg_color_direction ||= 1~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color_direction ||= 1
+** Processing line: ~ bg_r = (args.state.bg_element == 1) ? args.state.bg_color : 0~
+- Inside source: true
+*** True Line Result
+ bg_r = (args.state.bg_element == 1) ? args.state.bg_color : 0
+** Processing line: ~ bg_g = (args.state.bg_element == 2) ? args.state.bg_color : 0~
+- Inside source: true
+*** True Line Result
+ bg_g = (args.state.bg_element == 2) ? args.state.bg_color : 0
+** Processing line: ~ bg_b = (args.state.bg_element == 3) ? args.state.bg_color : 0~
+- Inside source: true
+*** True Line Result
+ bg_b = (args.state.bg_element == 3) ? args.state.bg_color : 0
+** Processing line: ~ args.state.bg_color += args.state.bg_color_direction~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color += args.state.bg_color_direction
+** Processing line: ~ if (args.state.bg_color_direction > 0) && (args.state.bg_color >= 255)~
+- Inside source: true
+*** True Line Result
+ if (args.state.bg_color_direction > 0) && (args.state.bg_color >= 255)
+** Processing line: ~ args.state.bg_color_direction = -1~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color_direction = -1
+** Processing line: ~ args.state.bg_color = 255~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color = 255
+** Processing line: ~ elsif (args.state.bg_color_direction < 0) && (args.state.bg_color <= 0)~
+- Inside source: true
+*** True Line Result
+ elsif (args.state.bg_color_direction < 0) && (args.state.bg_color <= 0)
+** Processing line: ~ args.state.bg_color_direction = 1~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color_direction = 1
+** Processing line: ~ args.state.bg_color = 0~
+- Inside source: true
+*** True Line Result
+ args.state.bg_color = 0
+** Processing line: ~ args.state.bg_element += 1~
+- Inside source: true
+*** True Line Result
+ args.state.bg_element += 1
+** Processing line: ~ if args.state.bg_element >= 4~
+- Inside source: true
+*** True Line Result
+ if args.state.bg_element >= 4
+** Processing line: ~ args.state.bg_element = 1~
+- Inside source: true
+*** True Line Result
+ args.state.bg_element = 1
+** 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: ~ args.outputs.background_color = [ bg_r, bg_g, bg_b, 255 ]~
+- Inside source: true
+*** True Line Result
+ args.outputs.background_color = [ bg_r, bg_g, bg_b, 255 ]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.blendmodes ||= [~
+- Inside source: true
+*** True Line Result
+ args.state.blendmodes ||= [
+** Processing line: ~ { name: :none, value: 0 },~
+- Inside source: true
+*** True Line Result
+ { name: :none, value: 0 },
+** Processing line: ~ { name: :blend, value: 1 },~
+- Inside source: true
+*** True Line Result
+ { name: :blend, value: 1 },
+** Processing line: ~ { name: :add, value: 2 },~
+- Inside source: true
+*** True Line Result
+ { name: :add, value: 2 },
+** Processing line: ~ { name: :mod, value: 3 },~
+- Inside source: true
+*** True Line Result
+ { name: :mod, value: 3 },
+** Processing line: ~ { name: :mul, value: 4 }~
+- Inside source: true
+*** True Line Result
+ { name: :mul, value: 4 }
+** Processing line: ~ ]~
+- Inside source: true
+*** True Line Result
+ ]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.x = 0 # reset this, draw_blendmode will increment it.~
+- Inside source: true
+*** True Line Result
+ args.state.x = 0 # reset this, draw_blendmode will increment it.
+** Processing line: ~ args.state.blendmodes.each { |blendmode| draw_blendmode args, blendmode }~
+- Inside source: true
+*** True Line Result
+ args.state.blendmodes.each { |blendmode| draw_blendmode args, blendmode }
+** 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: ~*** Tweening Lerping Easing Functions - Easing Functions - main.rb~
- Header detected.
*** True Line Result
@@ -53688,10 +55867,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if Kernel.global_tick_count == 0
-** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~
+** Processing line: ~ puts ""~
- Inside source: true
*** True Line Result
- puts "* INFO - Please specify the number of sprites to render."
+ 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, Hashes"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Sprites, Hashes"
+** 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
@@ -53972,10 +56167,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if Kernel.global_tick_count == 0
-** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~
+** Processing line: ~ puts ""~
- Inside source: true
*** True Line Result
- puts "* INFO - Please specify the number of sprites to render."
+ 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, Open Entities"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Sprites, Open Entities"
+** 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
@@ -54272,10 +56483,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if Kernel.global_tick_count == 0
-** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~
+** 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, Strict Entities"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Sprites, Strict Entities"
+** 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."
+ 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
@@ -54504,6 +56731,26 @@ Follows is a source code listing for all files that have been open sourced. This
- 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, Classes"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Sprites, Classes"
+** 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
@@ -54736,6 +56983,26 @@ Follows is a source code listing for all files that have been open sourced. This
- 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: Static Sprites, Classes"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Static Sprites, Classes"
+** 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
@@ -54760,6 +57027,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
args.state.stars = args.state.star_count.map { |i| Star.new args.grid }
+** Processing line: ~ args.outputs.static_sprites << args.state.stars~
+- Inside source: true
+*** True Line Result
+ args.outputs.static_sprites << args.state.stars
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -54784,10 +57055,6 @@ Follows is a source code listing for all files that have been open sourced. This
- 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
@@ -55020,14 +57287,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# alpha, red_saturation, green_saturation, blue_saturation
-** Processing line: ~ # flip_horizontally, flip_vertically,~
+** Processing line: ~ # tile_x, tile_y, tile_w, tile_h,~
- Inside source: true
*** True Line Result
- # flip_horizontally, flip_vertically,
-** Processing line: ~ # tile_x, tile_y, tile_w, tile_h~
+ # tile_x, tile_y, tile_w, tile_h,
+** Processing line: ~ # flip_horizontally, flip_vertically,~
- Inside source: true
*** True Line Result
- # tile_x, tile_y, tile_w, tile_h
+ # flip_horizontally, flip_vertically,
** Processing line: ~ # angle_anchor_x, angle_anchor_y,~
- Inside source: true
*** True Line Result
@@ -55036,6 +57303,50 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# source_x, source_y, source_w, source_h
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # The argument order for ffi_draw.draw_sprite_4 is:~
+- Inside source: true
+*** True Line Result
+ # The argument order for ffi_draw.draw_sprite_4 is:
+** Processing line: ~ # x, y, w, h,~
+- Inside source: true
+*** True Line Result
+ # x, y, w, h,
+** Processing line: ~ # path,~
+- Inside source: true
+*** True Line Result
+ # path,
+** Processing line: ~ # angle,~
+- Inside source: true
+*** True Line Result
+ # angle,
+** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~
+- Inside source: true
+*** True Line Result
+ # alpha, red_saturation, green_saturation, blue_saturation
+** Processing line: ~ # tile_x, tile_y, tile_w, tile_h,~
+- Inside source: true
+*** True Line Result
+ # tile_x, tile_y, tile_w, tile_h,
+** Processing line: ~ # flip_horizontally, flip_vertically,~
+- Inside source: true
+*** True Line Result
+ # flip_horizontally, flip_vertically,
+** Processing line: ~ # angle_anchor_x, angle_anchor_y,~
+- Inside source: true
+*** True Line Result
+ # angle_anchor_x, angle_anchor_y,
+** Processing line: ~ # source_x, source_y, source_w, source_h,~
+- Inside source: true
+*** True Line Result
+ # source_x, source_y, source_w, source_h,
+** Processing line: ~ # blendmode_enum~
+- Inside source: true
+*** True Line Result
+ # blendmode_enum
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -55064,6 +57375,26 @@ Follows is a source code listing for all files that have been open sourced. This
- 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: Static Sprites, Classes, Draw Override"~
+- Inside source: true
+*** True Line Result
+ puts "* INFO: Static Sprites, Classes, Draw Override"
+** 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
@@ -55756,6 +58087,206 @@ 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 - Unit Tests - benchmark_api_tests.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Debugging - Unit Tests - benchmark_api_tests.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/03_unit_tests/benchmark_api_tests.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/10_advanced_debugging/03_unit_tests/benchmark_api_tests.rb
+** Processing line: ~ def test_benchmark_api args, assert~
+- Inside source: true
+*** True Line Result
+ def test_benchmark_api args, assert
+** Processing line: ~ result = args.gtk.benchmark iterations: 100,~
+- Inside source: true
+*** True Line Result
+ result = args.gtk.benchmark iterations: 100,
+** Processing line: ~ only_one: -> () {~
+- Inside source: true
+*** True Line Result
+ only_one: -> () {
+** Processing line: ~ r = 0~
+- Inside source: true
+*** True Line Result
+ r = 0
+** Processing line: ~ (1..100).each do |i|~
+- Inside source: true
+*** True Line Result
+ (1..100).each do |i|
+** Processing line: ~ r += 1~
+- Inside source: true
+*** True Line Result
+ r += 1
+** 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: ~ assert.equal! result.first_place.name, :only_one~
+- Inside source: true
+*** True Line Result
+ assert.equal! result.first_place.name, :only_one
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ result = args.gtk.benchmark iterations: 100,~
+- Inside source: true
+*** True Line Result
+ result = args.gtk.benchmark iterations: 100,
+** Processing line: ~ iterations_100: -> () {~
+- Inside source: true
+*** True Line Result
+ iterations_100: -> () {
+** Processing line: ~ r = 0~
+- Inside source: true
+*** True Line Result
+ r = 0
+** Processing line: ~ (1..100).each do |i|~
+- Inside source: true
+*** True Line Result
+ (1..100).each do |i|
+** Processing line: ~ r += 1~
+- Inside source: true
+*** True Line Result
+ r += 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ },~
+- Inside source: true
+*** True Line Result
+ },
+** Processing line: ~ iterations_50: -> () {~
+- Inside source: true
+*** True Line Result
+ iterations_50: -> () {
+** Processing line: ~ r = 0~
+- Inside source: true
+*** True Line Result
+ r = 0
+** Processing line: ~ (1..50).each do |i|~
+- Inside source: true
+*** True Line Result
+ (1..50).each do |i|
+** Processing line: ~ r += 1~
+- Inside source: true
+*** True Line Result
+ r += 1
+** 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: ~ assert.equal! result.first_place.name, :iterations_50~
+- Inside source: true
+*** True Line Result
+ assert.equal! result.first_place.name, :iterations_50
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ result = args.gtk.benchmark iterations: 1,~
+- Inside source: true
+*** True Line Result
+ result = args.gtk.benchmark iterations: 1,
+** Processing line: ~ iterations_100: -> () {~
+- Inside source: true
+*** True Line Result
+ iterations_100: -> () {
+** Processing line: ~ r = 0~
+- Inside source: true
+*** True Line Result
+ r = 0
+** Processing line: ~ (1..100).each do |i|~
+- Inside source: true
+*** True Line Result
+ (1..100).each do |i|
+** Processing line: ~ r += 1~
+- Inside source: true
+*** True Line Result
+ r += 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ },~
+- Inside source: true
+*** True Line Result
+ },
+** Processing line: ~ iterations_50: -> () {~
+- Inside source: true
+*** True Line Result
+ iterations_50: -> () {
+** Processing line: ~ r = 0~
+- Inside source: true
+*** True Line Result
+ r = 0
+** Processing line: ~ (1..50).each do |i|~
+- Inside source: true
+*** True Line Result
+ (1..50).each do |i|
+** Processing line: ~ r += 1~
+- Inside source: true
+*** True Line Result
+ r += 1
+** 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: ~ assert.equal! result.too_small_to_measure, true~
+- Inside source: true
+*** True Line Result
+ assert.equal! result.too_small_to_measure, true
+** 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 - Unit Tests - exception_raising_tests.rb~
- Header detected.
*** True Line Result
@@ -57868,6 +60399,554 @@ 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 - Unit Tests - pretty_format_tests.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Advanced Debugging - Unit Tests - pretty_format_tests.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/03_unit_tests/pretty_format_tests.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/10_advanced_debugging/03_unit_tests/pretty_format_tests.rb
+** Processing line: ~ def H opts~
+- Inside source: true
+*** True Line Result
+ def H opts
+** Processing line: ~ opts~
+- Inside source: true
+*** True Line Result
+ opts
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def A *opts~
+- Inside source: true
+*** True Line Result
+ def A *opts
+** Processing line: ~ opts~
+- Inside source: true
+*** True Line Result
+ opts
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def assert_format args, assert, hash, expected~
+- Inside source: true
+*** True Line Result
+ def assert_format args, assert, hash, expected
+** Processing line: ~ actual = args.fn.pretty_format hash~
+- Inside source: true
+*** True Line Result
+ actual = args.fn.pretty_format hash
+** Processing line: ~ assert.are_equal! actual, expected~
+- Inside source: true
+*** True Line Result
+ assert.are_equal! actual, expected
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def test_pretty_print args, assert~
+- Inside source: true
+*** True Line Result
+ def test_pretty_print args, assert
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # hash with single value~
+- Inside source: true
+*** True Line Result
+ # hash with single value
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (H first_name: "John")~
+- Inside source: true
+*** True Line Result
+ input = (H first_name: "John")
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ {:first_name "John"}~
+- Inside source: true
+*** True Line Result
+ {:first_name "John"}
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # hash with two values~
+- Inside source: true
+*** True Line Result
+ # hash with two values
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (H first_name: "John", last_name: "Smith")~
+- Inside source: true
+*** True Line Result
+ input = (H first_name: "John", last_name: "Smith")
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ {:first_name "John"~
+- Inside source: true
+*** True Line Result
+ {:first_name "John"
+** Processing line: ~ :last_name "Smith"}~
+- Inside source: true
+*** True Line Result
+ :last_name "Smith"}
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # hash with inner hash~
+- Inside source: true
+*** True Line Result
+ # hash with inner hash
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (H first_name: "John",~
+- Inside source: true
+*** True Line Result
+ input = (H first_name: "John",
+** Processing line: ~ last_name: "Smith",~
+- Inside source: true
+*** True Line Result
+ last_name: "Smith",
+** Processing line: ~ middle_initial: "I",~
+- Inside source: true
+*** True Line Result
+ middle_initial: "I",
+** Processing line: ~ so: (H first_name: "Pocahontas",~
+- Inside source: true
+*** True Line Result
+ so: (H first_name: "Pocahontas",
+** Processing line: ~ last_name: "Tsenacommacah"),~
+- Inside source: true
+*** True Line Result
+ last_name: "Tsenacommacah"),
+** Processing line: ~ friends: (A (H first_name: "Side", last_name: "Kick"),~
+- Inside source: true
+*** True Line Result
+ friends: (A (H first_name: "Side", last_name: "Kick"),
+** Processing line: ~ (H first_name: "Tim", last_name: "Wizard")))~
+- Inside source: true
+*** True Line Result
+ (H first_name: "Tim", last_name: "Wizard")))
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ {:first_name "John"~
+- Inside source: true
+*** True Line Result
+ {:first_name "John"
+** Processing line: ~ :last_name "Smith"~
+- Inside source: true
+*** True Line Result
+ :last_name "Smith"
+** Processing line: ~ :middle_initial "I"~
+- Inside source: true
+*** True Line Result
+ :middle_initial "I"
+** Processing line: ~ :so {:first_name "Pocahontas"~
+- Inside source: true
+*** True Line Result
+ :so {:first_name "Pocahontas"
+** Processing line: ~ :last_name "Tsenacommacah"}~
+- Inside source: true
+*** True Line Result
+ :last_name "Tsenacommacah"}
+** Processing line: ~ :friends [{:first_name "Side"~
+- Inside source: true
+*** True Line Result
+ :friends [{:first_name "Side"
+** Processing line: ~ :last_name "Kick"}~
+- Inside source: true
+*** True Line Result
+ :last_name "Kick"}
+** Processing line: ~ {:first_name "Tim"~
+- Inside source: true
+*** True Line Result
+ {:first_name "Tim"
+** Processing line: ~ :last_name "Wizard"}]}~
+- Inside source: true
+*** True Line Result
+ :last_name "Wizard"}]}
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # array with one value~
+- Inside source: true
+*** True Line Result
+ # array with one value
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (A 1)~
+- Inside source: true
+*** True Line Result
+ input = (A 1)
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ [1]~
+- Inside source: true
+*** True Line Result
+ [1]
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # array with multiple values~
+- Inside source: true
+*** True Line Result
+ # array with multiple values
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (A 1, 2, 3)~
+- Inside source: true
+*** True Line Result
+ input = (A 1, 2, 3)
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ [1~
+- Inside source: true
+*** True Line Result
+ [1
+** Processing line: ~ 2~
+- Inside source: true
+*** True Line Result
+ 2
+** Processing line: ~ 3]~
+- Inside source: true
+*** True Line Result
+ 3]
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # array with multiple values hashes~
+- Inside source: true
+*** True Line Result
+ # array with multiple values hashes
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (A (H first_name: "Side", last_name: "Kick"),~
+- Inside source: true
+*** True Line Result
+ input = (A (H first_name: "Side", last_name: "Kick"),
+** Processing line: ~ (H first_name: "Tim", last_name: "Wizard"))~
+- Inside source: true
+*** True Line Result
+ (H first_name: "Tim", last_name: "Wizard"))
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ [{:first_name "Side"~
+- Inside source: true
+*** True Line Result
+ [{:first_name "Side"
+** Processing line: ~ :last_name "Kick"}~
+- Inside source: true
+*** True Line Result
+ :last_name "Kick"}
+** Processing line: ~ {:first_name "Tim"~
+- Inside source: true
+*** True Line Result
+ {:first_name "Tim"
+** Processing line: ~ :last_name "Wizard"}]~
+- Inside source: true
+*** True Line Result
+ :last_name "Wizard"}]
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def test_nested_nested args, assert~
+- Inside source: true
+*** True Line Result
+ def test_nested_nested args, assert
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ # nested array in nested hash~
+- Inside source: true
+*** True Line Result
+ # nested array in nested hash
+** Processing line: ~ # =============================~
+- Inside source: true
+*** True Line Result
+ # =============================
+** Processing line: ~ input = (H type: :root,~
+- Inside source: true
+*** True Line Result
+ input = (H type: :root,
+** Processing line: ~ text: "Root",~
+- Inside source: true
+*** True Line Result
+ text: "Root",
+** Processing line: ~ children: (A (H level: 1,~
+- Inside source: true
+*** True Line Result
+ children: (A (H level: 1,
+** Processing line: ~ text: "Level 1",~
+- Inside source: true
+*** True Line Result
+ text: "Level 1",
+** Processing line: ~ children: (A (H level: 2,~
+- Inside source: true
+*** True Line Result
+ children: (A (H level: 2,
+** Processing line: ~ text: "Level 2",~
+- Inside source: true
+*** True Line Result
+ text: "Level 2",
+** Processing line: ~ children: [])))))~
+- Inside source: true
+*** True Line Result
+ children: [])))))
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ expected = <<-S~
+- Inside source: true
+*** True Line Result
+ expected = <<-S
+** Processing line: ~ {:type :root~
+- Inside source: true
+*** True Line Result
+ {:type :root
+** Processing line: ~ :text "Root"~
+- Inside source: true
+*** True Line Result
+ :text "Root"
+** Processing line: ~ :children [{:level 1~
+- Inside source: true
+*** True Line Result
+ :children [{:level 1
+** Processing line: ~ :text "Level 1"~
+- Inside source: true
+*** True Line Result
+ :text "Level 1"
+** Processing line: ~ :children [{:level 2~
+- Inside source: true
+*** True Line Result
+ :children [{:level 2
+** Processing line: ~ :text "Level 2"~
+- Inside source: true
+*** True Line Result
+ :text "Level 2"
+** Processing line: ~ :children []}]}]}~
+- Inside source: true
+*** True Line Result
+ :children []}]}]}
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ (assert_format args, assert, input, expected)~
+- Inside source: true
+*** True Line Result
+ (assert_format args, assert, input, expected)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def test_scene args, assert~
+- Inside source: true
+*** True Line Result
+ def test_scene args, assert
+** Processing line: ~ script = <<-S~
+- Inside source: true
+*** True Line Result
+ script = <<-S
+** Processing line: ~ * Scene 1~
+- Inside source: true
+*** True Line Result
+ * Scene 1
+** Processing line: ~ ** Narrator~
+- Inside source: true
+*** True Line Result
+ ** Narrator
+** Processing line: ~ They say happy endings don't exist.~
+- Inside source: true
+*** True Line Result
+ They say happy endings don't exist.
+** Processing line: ~ ** Narrator~
+- Inside source: true
+*** True Line Result
+ ** Narrator
+** Processing line: ~ They say true love is a lie.~
+- Inside source: true
+*** True Line Result
+ They say true love is a lie.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ input = parse_org args, script~
+- Inside source: true
+*** True Line Result
+ input = parse_org args, script
+** Processing line: ~ puts (args.fn.pretty_format input)~
+- Inside source: true
+*** True Line Result
+ puts (args.fn.pretty_format input)
+** 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 - Unit Tests - require_tests.rb~
- Header detected.
*** True Line Result
@@ -96416,6 +99495,1770 @@ 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 - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Crafting - Farming Game 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_crafting/farming_game_starting_point/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_crafting/farming_game_starting_point/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ args.state.tile_size = 80~
+- Inside source: true
+*** True Line Result
+ args.state.tile_size = 80
+** Processing line: ~ args.state.player_speed = 4~
+- Inside source: true
+*** True Line Result
+ args.state.player_speed = 4
+** Processing line: ~ args.state.player ||= tile(args, 7, 3, 0, 128, 180)~
+- Inside source: true
+*** True Line Result
+ args.state.player ||= tile(args, 7, 3, 0, 128, 180)
+** Processing line: ~ generate_map args~
+- Inside source: true
+*** True Line Result
+ generate_map args
+** Processing line: ~ #press j to plant a green onion~
+- Inside source: true
+*** True Line Result
+ #press j to plant a green onion
+** Processing line: ~ if args.inputs.keyboard.j~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.j
+** Processing line: ~ #change this part you can change what you want to plant~
+- Inside source: true
+*** True Line Result
+ #change this part you can change what you want to plant
+** Processing line: ~ args.state.walls << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y)/args.state.tile_size), 255, 255, 255)~
+- Inside source: true
+*** True Line Result
+ args.state.walls << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y)/args.state.tile_size), 255, 255, 255)
+** Processing line: ~ args.state.plants << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y+80)/args.state.tile_size), 0, 160, 0)~
+- Inside source: true
+*** True Line Result
+ args.state.plants << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y+80)/args.state.tile_size), 0, 160, 0)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ # Adds walls, background, and player to args.outputs.solids so they appear on screen~
+- Inside source: true
+*** True Line Result
+ # Adds walls, background, and player to args.outputs.solids so they appear on screen
+** Processing line: ~ args.outputs.solids << [0,0,1280,720, 237,189,101]~
+- Inside source: true
+*** True Line Result
+ args.outputs.solids << [0,0,1280,720, 237,189,101]
+** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']
+** Processing line: ~ args.outputs.solids << args.state.walls~
+- Inside source: true
+*** True Line Result
+ args.outputs.solids << args.state.walls
+** Processing line: ~ args.outputs.solids << args.state.player~
+- Inside source: true
+*** True Line Result
+ args.outputs.solids << args.state.player
+** Processing line: ~ args.outputs.solids << args.state.plants~
+- Inside source: true
+*** True Line Result
+ args.outputs.solids << args.state.plants
+** Processing line: ~ args.outputs.labels << [320, 640, "press J to plant", 3, 1, 255, 0, 0, 200]~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << [320, 640, "press J to plant", 3, 1, 255, 0, 0, 200]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ move_player args, -1, 0 if args.inputs.keyboard.left # x position decreases by 1 if left key is pressed~
+- Inside source: true
+*** True Line Result
+ move_player args, -1, 0 if args.inputs.keyboard.left # x position decreases by 1 if left key is pressed
+** Processing line: ~ move_player args, 1, 0 if args.inputs.keyboard.right # x position increases by 1 if right key is pressed~
+- Inside source: true
+*** True Line Result
+ move_player args, 1, 0 if args.inputs.keyboard.right # x position increases by 1 if right key is pressed
+** Processing line: ~ move_player args, 0, 1 if args.inputs.keyboard.up # y position increases by 1 if up is pressed~
+- Inside source: true
+*** True Line Result
+ move_player args, 0, 1 if args.inputs.keyboard.up # y position increases by 1 if up is pressed
+** Processing line: ~ move_player args, 0, -1 if args.inputs.keyboard.down # y position decreases by 1 if down is pressed~
+- Inside source: true
+*** True Line Result
+ move_player args, 0, -1 if args.inputs.keyboard.down # y position decreases by 1 if down is pressed
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Sets position, size, and color of the tile~
+- Inside source: true
+*** True Line Result
+ # Sets position, size, and color of the tile
+** Processing line: ~ def tile args, x, y, *color~
+- Inside source: true
+*** True Line Result
+ def tile args, x, y, *color
+** Processing line: ~ [x * args.state.tile_size, # sets definition for array using method parameters~
+- Inside source: true
+*** True Line Result
+ [x * args.state.tile_size, # sets definition for array using method parameters
+** Processing line: ~ y * args.state.tile_size, # multiplying by tile_size sets x and y to correct position using pixel values~
+- Inside source: true
+*** True Line Result
+ y * args.state.tile_size, # multiplying by tile_size sets x and y to correct position using pixel values
+** Processing line: ~ args.state.tile_size,~
+- Inside source: true
+*** True Line Result
+ args.state.tile_size,
+** Processing line: ~ args.state.tile_size,~
+- Inside source: true
+*** True Line Result
+ args.state.tile_size,
+** Processing line: ~ *color]~
+- Inside source: true
+*** True Line Result
+ *color]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Creates map by adding tiles to the wall, as well as a goal (that the player needs to reach)~
+- Inside source: true
+*** True Line Result
+ # Creates map by adding tiles to the wall, as well as a goal (that the player needs to reach)
+** Processing line: ~ def generate_map args~
+- Inside source: true
+*** True Line Result
+ def generate_map args
+** Processing line: ~ return if args.state.area~
+- Inside source: true
+*** True Line Result
+ return if args.state.area
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Creates the area of the map. There are 9 rows running horizontally across the screen~
+- Inside source: true
+*** True Line Result
+ # Creates the area of the map. There are 9 rows running horizontally across the screen
+** Processing line: ~ # and 16 columns running vertically on the screen. Any spot with a "1" is not~
+- Inside source: true
+*** True Line Result
+ # and 16 columns running vertically on the screen. Any spot with a "1" is not
+** Processing line: ~ # open for the player to move into (and is green), and any spot with a "0" is available~
+- Inside source: true
+*** True Line Result
+ # open for the player to move into (and is green), and any spot with a "0" is available
+** Processing line: ~ # for the player to move in.~
+- Inside source: true
+*** True Line Result
+ # for the player to move in.
+** Processing line: ~ args.state.area = [~
+- Inside source: true
+*** True Line Result
+ args.state.area = [
+** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],
+** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],
+** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],~
+- Inside source: true
+*** True Line Result
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],
+** Processing line: ~ ].reverse # reverses the order of the area collection~
+- Inside source: true
+*** True Line Result
+ ].reverse # reverses the order of the area collection
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # By reversing the order, the way that the area appears above is how it appears~
+- Inside source: true
+*** True Line Result
+ # By reversing the order, the way that the area appears above is how it appears
+** Processing line: ~ # on the screen in the game. If we did not reverse, the map would appear inverted.~
+- Inside source: true
+*** True Line Result
+ # on the screen in the game. If we did not reverse, the map would appear inverted.
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ #The wall starts off with no tiles.~
+- Inside source: true
+*** True Line Result
+ #The wall starts off with no tiles.
+** Processing line: ~ args.state.walls = []~
+- Inside source: true
+*** True Line Result
+ args.state.walls = []
+** Processing line: ~ args.state.plants = []~
+- Inside source: true
+*** True Line Result
+ args.state.plants = []
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # If v is 1, a green tile is added to args.state.walls.~
+- Inside source: true
+*** True Line Result
+ # If v is 1, a green tile is added to args.state.walls.
+** Processing line: ~ # If v is 2, a black tile is created as the goal.~
+- Inside source: true
+*** True Line Result
+ # If v is 2, a black tile is created as the goal.
+** Processing line: ~ args.state.area.map_2d do |y, x, v|~
+- Inside source: true
+*** True Line Result
+ args.state.area.map_2d do |y, x, v|
+** Processing line: ~ if v == 1~
+- Inside source: true
+*** True Line Result
+ if v == 1
+** Processing line: ~ args.state.walls << tile(args, x, y, 255, 160, 156) # green tile~
+- Inside source: true
+*** True Line Result
+ args.state.walls << tile(args, x, y, 255, 160, 156) # green tile
+** 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: ~ # Allows the player to move their box around the screen~
+- Inside source: true
+*** True Line Result
+ # Allows the player to move their box around the screen
+** Processing line: ~ def move_player args, *vector~
+- Inside source: true
+*** True Line Result
+ def move_player args, *vector
+** Processing line: ~ box = args.state.player.shift_rect(vector) # box is able to move at an angle~
+- Inside source: true
+*** True Line Result
+ box = args.state.player.shift_rect(vector) # box is able to move at an angle
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # If the player's box hits a wall, it is not able to move further in that direction~
+- Inside source: true
+*** True Line Result
+ # If the player's box hits a wall, it is not able to move further in that direction
+** Processing line: ~ return if args.state.walls~
+- Inside source: true
+*** True Line Result
+ return if args.state.walls
+** Processing line: ~ .any_intersect_rect?(box)~
+- Inside source: true
+*** True Line Result
+ .any_intersect_rect?(box)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Player's box is able to move at angles (not just the four general directions) fast~
+- Inside source: true
+*** True Line Result
+ # Player's box is able to move at angles (not just the four general directions) fast
+** Processing line: ~ args.state.player =~
+- Inside source: true
+*** True Line Result
+ args.state.player =
+** Processing line: ~ args.state.player~
+- Inside source: true
+*** True Line Result
+ args.state.player
+** Processing line: ~ .shift_rect(vector.x * args.state.player_speed, # if we don't multiply by speed, then~
+- Inside source: true
+*** True Line Result
+ .shift_rect(vector.x * args.state.player_speed, # if we don't multiply by speed, then
+** Processing line: ~ vector.y * args.state.player_speed) # the box will move extremely slow~
+- Inside source: true
+*** True Line Result
+ vector.y * args.state.player_speed) # the box will move extremely slow
+** 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 - 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
+
+*** True Line Result
+*** Crafting - Farming Game Starting Point - tests.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/tests.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_crafting/farming_game_starting_point/app/tests.rb
+** Processing line: ~ # For advanced users:~
+- Inside source: true
+*** True Line Result
+ # For advanced users:
+** Processing line: ~ # You can put some quick verification tests here, any method~
+- Inside source: true
+*** True Line Result
+ # You can put some quick verification tests here, any method
+** Processing line: ~ # that starts with the `test_` will be run when you save this file.~
+- Inside source: true
+*** True Line Result
+ # that starts with the `test_` will be run when you save this file.
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Here is an example test and game~
+- Inside source: true
+*** True Line Result
+ # Here is an example test and game
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick~
+- Inside source: true
+*** True Line Result
+ # To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ class MySuperHappyFunGame~
+- Inside source: true
+*** True Line Result
+ class MySuperHappyFunGame
+** 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: ~ outputs.solids << [100, 100, 300, 300]~
+- Inside source: true
+*** True Line Result
+ outputs.solids << [100, 100, 300, 300]
+** 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 test_universe args, assert~
+- Inside source: true
+*** True Line Result
+ def test_universe args, assert
+** Processing line: ~ game = MySuperHappyFunGame.new~
+- Inside source: true
+*** True Line Result
+ game = MySuperHappyFunGame.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: ~ assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick"~
+- Inside source: true
+*** True Line Result
+ assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick"
+** Processing line: ~ assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending"~
+- Inside source: true
+*** True Line Result
+ assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending"
+** Processing line: ~ puts "test_universe completed successfully"~
+- Inside source: true
+*** True Line Result
+ puts "test_universe completed successfully"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ puts "running tests"~
+- Inside source: true
+*** True Line Result
+ puts "running tests"
+** Processing line: ~ $gtk.reset 100~
+- Inside source: true
+*** True Line Result
+ $gtk.reset 100
+** Processing line: ~ $gtk.log_level = :off~
+- Inside source: true
+*** True Line Result
+ $gtk.log_level = :off
+** Processing line: ~ $gtk.tests.start~
+- Inside source: true
+*** True Line Result
+ $gtk.tests.start
+** 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: ~*** Dev Tools - Add Buttons To Console - main.rb~
- Header detected.
*** True Line Result
@@ -97104,18 +101947,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
text: "#{i + 1}", r: 180, g: 180, b: 180,
-** Processing line: ~ size_enum: -4, alignment_enum: 1 }.label~
+** Processing line: ~ size_enum: -4, alignment_enum: 1 }.label!~
- Inside source: true
*** True Line Result
- size_enum: -4, alignment_enum: 1 }.label
+ size_enum: -4, alignment_enum: 1 }.label!
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ selection_border = b.merge(r: 40, g: 40, b: 40).border~
+** Processing line: ~ selection_border = b.merge(r: 40, g: 40, b: 40).border!~
- Inside source: true
*** True Line Result
- selection_border = b.merge(r: 40, g: 40, b: 40).border
+ selection_border = b.merge(r: 40, g: 40, b: 40).border!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -97124,10 +101967,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if i == state.animation_frames_selected_index
-** Processing line: ~ selection_border = b.merge(r: 40, g: 230, b: 200).border~
+** Processing line: ~ selection_border = b.merge(r: 40, g: 230, b: 200).border!~
- Inside source: true
*** True Line Result
- selection_border = b.merge(r: 40, g: 230, b: 200).border
+ selection_border = b.merge(r: 40, g: 230, b: 200).border!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -100076,6 +104919,2102 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** Dungeon Crawl - Classics Jam - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Dungeon Crawl - Classics Jam - 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_dungeon_crawl/classics_jam/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_dungeon_crawl/classics_jam/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: ~ 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: ~ def defaults~
+- Inside source: true
+*** True Line Result
+ def defaults
+** Processing line: ~ player.x ||= 640~
+- Inside source: true
+*** True Line Result
+ player.x ||= 640
+** Processing line: ~ player.y ||= 360~
+- Inside source: true
+*** True Line Result
+ player.y ||= 360
+** Processing line: ~ player.w ||= 16~
+- Inside source: true
+*** True Line Result
+ player.w ||= 16
+** Processing line: ~ player.h ||= 16~
+- Inside source: true
+*** True Line Result
+ player.h ||= 16
+** Processing line: ~ player.attacked_at ||= -1~
+- Inside source: true
+*** True Line Result
+ player.attacked_at ||= -1
+** Processing line: ~ player.angle ||= 0~
+- Inside source: true
+*** True Line Result
+ player.angle ||= 0
+** Processing line: ~ player.future_player ||= future_player_position 0, 0~
+- Inside source: true
+*** True Line Result
+ player.future_player ||= future_player_position 0, 0
+** Processing line: ~ player.projectiles ||= []~
+- Inside source: true
+*** True Line Result
+ player.projectiles ||= []
+** Processing line: ~ player.damage ||= 0~
+- Inside source: true
+*** True Line Result
+ player.damage ||= 0
+** Processing line: ~ state.level ||= create_level level_one_template~
+- Inside source: true
+*** True Line Result
+ state.level ||= create_level level_one_template
+** 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.sprites << level.walls.map do |w|~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << level.walls.map do |w|
+** Processing line: ~ w.merge(path: 'sprites/square/gray.png')~
+- Inside source: true
+*** True Line Result
+ w.merge(path: 'sprites/square/gray.png')
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.sprites << level.spawn_locations.map do |s|~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << level.spawn_locations.map do |s|
+** Processing line: ~ s.merge(path: 'sprites/square/blue.png')~
+- Inside source: true
+*** True Line Result
+ s.merge(path: 'sprites/square/blue.png')
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.sprites << player.projectiles.map do |p|~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << player.projectiles.map do |p|
+** Processing line: ~ p.merge(path: 'sprites/square/blue.png')~
+- Inside source: true
+*** True Line Result
+ p.merge(path: 'sprites/square/blue.png')
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.sprites << level.enemies.map do |e|~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << level.enemies.map do |e|
+** Processing line: ~ e.merge(path: 'sprites/square/red.png')~
+- Inside source: true
+*** True Line Result
+ e.merge(path: 'sprites/square/red.png')
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.sprites << player.merge(path: 'sprites/circle/green.png', angle: player.angle)~
+- Inside source: true
+*** True Line Result
+ outputs.sprites << player.merge(path: 'sprites/circle/green.png', angle: player.angle)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ outputs.labels << { x: 30, y: 30.from_top, text: "damage: #{player.damage || 0}" }~
+- Inside source: true
+*** True Line Result
+ outputs.labels << { x: 30, y: 30.from_top, text: "damage: #{player.damage || 0}" }
+** 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: ~ player.angle = inputs.directional_angle || player.angle~
+- Inside source: true
+*** True Line Result
+ player.angle = inputs.directional_angle || player.angle
+** Processing line: ~ if inputs.controller_one.key_down.a || inputs.keyboard.key_down.space~
+- Inside source: true
+*** True Line Result
+ if inputs.controller_one.key_down.a || inputs.keyboard.key_down.space
+** Processing line: ~ player.attacked_at = state.tick_count~
+- Inside source: true
+*** True Line Result
+ player.attacked_at = state.tick_count
+** 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~
+- Inside source: true
+*** True Line Result
+ def calc
+** Processing line: ~ calc_player~
+- Inside source: true
+*** True Line Result
+ calc_player
+** Processing line: ~ calc_projectiles~
+- Inside source: true
+*** True Line Result
+ calc_projectiles
+** Processing line: ~ calc_enemies~
+- Inside source: true
+*** True Line Result
+ calc_enemies
+** Processing line: ~ calc_spawn_locations~
+- Inside source: true
+*** True Line Result
+ calc_spawn_locations
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_player~
+- Inside source: true
+*** True Line Result
+ def calc_player
+** Processing line: ~ if player.attacked_at == state.tick_count~
+- Inside source: true
+*** True Line Result
+ if player.attacked_at == state.tick_count
+** Processing line: ~ player.projectiles << { at: state.tick_count,~
+- Inside source: true
+*** True Line Result
+ player.projectiles << { at: state.tick_count,
+** 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: ~ angle: player.angle,~
+- Inside source: true
+*** True Line Result
+ angle: player.angle,
+** Processing line: ~ w: 4,~
+- Inside source: true
+*** True Line Result
+ w: 4,
+** Processing line: ~ h: 4 }.center_inside_rect(player)~
+- Inside source: true
+*** True Line Result
+ h: 4 }.center_inside_rect(player)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if player.attacked_at.elapsed_time > 5~
+- Inside source: true
+*** True Line Result
+ if player.attacked_at.elapsed_time > 5
+** Processing line: ~ future_player = future_player_position inputs.left_right * 2, inputs.up_down * 2~
+- Inside source: true
+*** True Line Result
+ future_player = future_player_position inputs.left_right * 2, inputs.up_down * 2
+** Processing line: ~ future_player_collision = future_collision player, future_player, level.walls~
+- Inside source: true
+*** True Line Result
+ future_player_collision = future_collision player, future_player, level.walls
+** Processing line: ~ player.x = future_player_collision.x if !future_player_collision.dx_collision~
+- Inside source: true
+*** True Line Result
+ player.x = future_player_collision.x if !future_player_collision.dx_collision
+** Processing line: ~ player.y = future_player_collision.y if !future_player_collision.dy_collision~
+- Inside source: true
+*** True Line Result
+ player.y = future_player_collision.y if !future_player_collision.dy_collision
+** 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_projectile_collisions entities~
+- Inside source: true
+*** True Line Result
+ def calc_projectile_collisions entities
+** Processing line: ~ entities.each do |e|~
+- Inside source: true
+*** True Line Result
+ entities.each do |e|
+** Processing line: ~ e.damage ||= 0~
+- Inside source: true
+*** True Line Result
+ e.damage ||= 0
+** Processing line: ~ player.projectiles.each do |p|~
+- Inside source: true
+*** True Line Result
+ player.projectiles.each do |p|
+** Processing line: ~ if !p.collided && (p.intersect_rect? e)~
+- Inside source: true
+*** True Line Result
+ if !p.collided && (p.intersect_rect? e)
+** Processing line: ~ p.collided = true~
+- Inside source: true
+*** True Line Result
+ p.collided = true
+** Processing line: ~ e.damage += 1~
+- Inside source: true
+*** True Line Result
+ e.damage += 1
+** 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: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_projectiles~
+- Inside source: true
+*** True Line Result
+ def calc_projectiles
+** Processing line: ~ player.projectiles.map! do |p|~
+- Inside source: true
+*** True Line Result
+ player.projectiles.map! do |p|
+** Processing line: ~ dx, dy = p.angle.vector 10~
+- Inside source: true
+*** True Line Result
+ dx, dy = p.angle.vector 10
+** Processing line: ~ p.merge(x: p.x + dx, y: p.y + dy)~
+- Inside source: true
+*** True Line Result
+ p.merge(x: p.x + dx, y: p.y + dy)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ calc_projectile_collisions level.walls + level.enemies + level.spawn_locations~
+- Inside source: true
+*** True Line Result
+ calc_projectile_collisions level.walls + level.enemies + level.spawn_locations
+** Processing line: ~ player.projectiles.reject! { |p| p.at.elapsed_time > 10000 }~
+- Inside source: true
+*** True Line Result
+ player.projectiles.reject! { |p| p.at.elapsed_time > 10000 }
+** Processing line: ~ player.projectiles.reject! { |p| p.collided }~
+- Inside source: true
+*** True Line Result
+ player.projectiles.reject! { |p| p.collided }
+** Processing line: ~ level.enemies.reject! { |e| e.damage > e.hp }~
+- Inside source: true
+*** True Line Result
+ level.enemies.reject! { |e| e.damage > e.hp }
+** Processing line: ~ level.spawn_locations.reject! { |s| s.damage > s.hp }~
+- Inside source: true
+*** True Line Result
+ level.spawn_locations.reject! { |s| s.damage > s.hp }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_enemies~
+- Inside source: true
+*** True Line Result
+ def calc_enemies
+** Processing line: ~ level.enemies.map! do |e|~
+- Inside source: true
+*** True Line Result
+ level.enemies.map! do |e|
+** Processing line: ~ dx = 0~
+- Inside source: true
+*** True Line Result
+ dx = 0
+** Processing line: ~ dx = 1 if e.x < player.x~
+- Inside source: true
+*** True Line Result
+ dx = 1 if e.x < player.x
+** Processing line: ~ dx = -1 if e.x > player.x~
+- Inside source: true
+*** True Line Result
+ dx = -1 if e.x > player.x
+** Processing line: ~ dy = 0~
+- Inside source: true
+*** True Line Result
+ dy = 0
+** Processing line: ~ dy = 1 if e.y < player.y~
+- Inside source: true
+*** True Line Result
+ dy = 1 if e.y < player.y
+** Processing line: ~ dy = -1 if e.y > player.y~
+- Inside source: true
+*** True Line Result
+ dy = -1 if e.y > player.y
+** Processing line: ~ future_e = future_entity_position dx, dy, e~
+- Inside source: true
+*** True Line Result
+ future_e = future_entity_position dx, dy, e
+** Processing line: ~ future_e_collision = future_collision e, future_e, level.enemies + level.walls~
+- Inside source: true
+*** True Line Result
+ future_e_collision = future_collision e, future_e, level.enemies + level.walls
+** Processing line: ~ e.next_x = e.x~
+- Inside source: true
+*** True Line Result
+ e.next_x = e.x
+** Processing line: ~ e.next_y = e.y~
+- Inside source: true
+*** True Line Result
+ e.next_y = e.y
+** Processing line: ~ e.next_x = future_e_collision.x if !future_e_collision.dx_collision~
+- Inside source: true
+*** True Line Result
+ e.next_x = future_e_collision.x if !future_e_collision.dx_collision
+** Processing line: ~ e.next_y = future_e_collision.y if !future_e_collision.dy_collision~
+- Inside source: true
+*** True Line Result
+ e.next_y = future_e_collision.y if !future_e_collision.dy_collision
+** Processing line: ~ e~
+- Inside source: true
+*** True Line Result
+ e
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ level.enemies.map! do |e|~
+- Inside source: true
+*** True Line Result
+ level.enemies.map! do |e|
+** Processing line: ~ e.x = e.next_x~
+- Inside source: true
+*** True Line Result
+ e.x = e.next_x
+** Processing line: ~ e.y = e.next_y~
+- Inside source: true
+*** True Line Result
+ e.y = e.next_y
+** Processing line: ~ e~
+- Inside source: true
+*** True Line Result
+ e
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ level.enemies.each do |e|~
+- Inside source: true
+*** True Line Result
+ level.enemies.each do |e|
+** Processing line: ~ player.damage += 1 if e.intersect_rect? player~
+- Inside source: true
+*** True Line Result
+ player.damage += 1 if e.intersect_rect? player
+** 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_spawn_locations~
+- Inside source: true
+*** True Line Result
+ def calc_spawn_locations
+** Processing line: ~ level.spawn_locations.map! do |s|~
+- Inside source: true
+*** True Line Result
+ level.spawn_locations.map! do |s|
+** Processing line: ~ s.merge(countdown: s.countdown - 1)~
+- Inside source: true
+*** True Line Result
+ s.merge(countdown: s.countdown - 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ level.spawn_locations~
+- Inside source: true
+*** True Line Result
+ level.spawn_locations
+** Processing line: ~ .find_all { |s| s.countdown.neg? }~
+- Inside source: true
+*** True Line Result
+ .find_all { |s| s.countdown.neg? }
+** Processing line: ~ .each do |s|~
+- Inside source: true
+*** True Line Result
+ .each do |s|
+** Processing line: ~ s.countdown = s.rate~
+- Inside source: true
+*** True Line Result
+ s.countdown = s.rate
+** Processing line: ~ s.merge(countdown: s.rate)~
+- Inside source: true
+*** True Line Result
+ s.merge(countdown: s.rate)
+** Processing line: ~ new_enemy = create_enemy s~
+- Inside source: true
+*** True Line Result
+ new_enemy = create_enemy s
+** Processing line: ~ if !(level.enemies.find { |e| e.intersect_rect? new_enemy })~
+- Inside source: true
+*** True Line Result
+ if !(level.enemies.find { |e| e.intersect_rect? new_enemy })
+** Processing line: ~ level.enemies << new_enemy~
+- Inside source: true
+*** True Line Result
+ level.enemies << new_enemy
+** 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 create_enemy spawn_location~
+- Inside source: true
+*** True Line Result
+ def create_enemy spawn_location
+** Processing line: ~ to_cell(spawn_location.ordinal_x, spawn_location.ordinal_y).merge hp: 2~
+- Inside source: true
+*** True Line Result
+ to_cell(spawn_location.ordinal_x, spawn_location.ordinal_y).merge hp: 2
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def create_level level_template~
+- Inside source: true
+*** True Line Result
+ def create_level level_template
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ walls: level_template.walls.map { |w| to_cell(w.ordinal_x, w.ordinal_y).merge(w) },~
+- Inside source: true
+*** True Line Result
+ walls: level_template.walls.map { |w| to_cell(w.ordinal_x, w.ordinal_y).merge(w) },
+** Processing line: ~ enemies: [],~
+- Inside source: true
+*** True Line Result
+ enemies: [],
+** Processing line: ~ spawn_locations: level_template.spawn_locations.map { |s| to_cell(s.ordinal_x, s.ordinal_y).merge(s) }~
+- Inside source: true
+*** True Line Result
+ spawn_locations: level_template.spawn_locations.map { |s| to_cell(s.ordinal_x, s.ordinal_y).merge(s) }
+** 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 level_one_template~
+- Inside source: true
+*** True Line Result
+ def level_one_template
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ walls: [{ ordinal_x: 25, ordinal_y: 20},~
+- Inside source: true
+*** True Line Result
+ walls: [{ ordinal_x: 25, ordinal_y: 20},
+** Processing line: ~ { ordinal_x: 25, ordinal_y: 21},~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 25, ordinal_y: 21},
+** Processing line: ~ { ordinal_x: 25, ordinal_y: 22},~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 25, ordinal_y: 22},
+** Processing line: ~ { ordinal_x: 25, ordinal_y: 23}],~
+- Inside source: true
+*** True Line Result
+ { ordinal_x: 25, ordinal_y: 23}],
+** Processing line: ~ spawn_locations: [{ ordinal_x: 10, ordinal_y: 10, rate: 120, countdown: 0, hp: 5 }]~
+- Inside source: true
+*** True Line Result
+ spawn_locations: [{ ordinal_x: 10, ordinal_y: 10, rate: 120, countdown: 0, hp: 5 }]
+** 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 player~
+- Inside source: true
+*** True Line Result
+ def player
+** Processing line: ~ state.player ||= {}~
+- Inside source: true
+*** True Line Result
+ state.player ||= {}
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def level~
+- Inside source: true
+*** True Line Result
+ def level
+** Processing line: ~ state.level ||= {}~
+- Inside source: true
+*** True Line Result
+ state.level ||= {}
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def future_collision entity, future_entity, others~
+- Inside source: true
+*** True Line Result
+ def future_collision entity, future_entity, others
+** Processing line: ~ dx_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dx) }~
+- Inside source: true
+*** True Line Result
+ dx_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dx) }
+** Processing line: ~ dy_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dy) }~
+- Inside source: true
+*** True Line Result
+ dy_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dy) }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ dx_collision: dx_collision,~
+- Inside source: true
+*** True Line Result
+ dx_collision: dx_collision,
+** Processing line: ~ x: future_entity.dx.x,~
+- Inside source: true
+*** True Line Result
+ x: future_entity.dx.x,
+** Processing line: ~ dy_collision: dy_collision,~
+- Inside source: true
+*** True Line Result
+ dy_collision: dy_collision,
+** Processing line: ~ y: future_entity.dy.y~
+- Inside source: true
+*** True Line Result
+ y: future_entity.dy.y
+** 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 future_entity_position dx, dy, entity~
+- Inside source: true
+*** True Line Result
+ def future_entity_position dx, dy, entity
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ dx: entity.merge(x: entity.x + dx),~
+- Inside source: true
+*** True Line Result
+ dx: entity.merge(x: entity.x + dx),
+** Processing line: ~ dy: entity.merge(y: entity.y + dy),~
+- Inside source: true
+*** True Line Result
+ dy: entity.merge(y: entity.y + dy),
+** Processing line: ~ both: entity.merge(x: entity.x + dx, y: entity.y + dy)~
+- Inside source: true
+*** True Line Result
+ both: entity.merge(x: entity.x + dx, y: entity.y + dy)
+** 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 future_player_position dx, dy~
+- Inside source: true
+*** True Line Result
+ def future_player_position dx, dy
+** Processing line: ~ future_entity_position dx, dy, player~
+- Inside source: true
+*** True Line Result
+ future_entity_position dx, dy, player
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_cell ordinal_x, ordinal_y~
+- Inside source: true
+*** True Line Result
+ def to_cell ordinal_x, ordinal_y
+** Processing line: ~ { x: ordinal_x * 16, y: ordinal_y * 16, w: 16, h: 16 }~
+- Inside source: true
+*** True Line Result
+ { x: ordinal_x * 16, y: ordinal_y * 16, w: 16, h: 16 }
+** 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: ~ $game = nil~
+- Inside source: true
+*** True Line Result
+ $game = nil
+** 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: ~*** Fighting - Special Move Inputs - main.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** Fighting - Special Move Inputs - 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_fighting/01_special_move_inputs/app/main.rb~
+- Inside source: true
+*** True Line Result
+ # ./samples/99_genre_fighting/01_special_move_inputs/app/main.rb
+** Processing line: ~ def tick args~
+- Inside source: true
+*** True Line Result
+ def tick args
+** Processing line: ~ #tick_instructions args, "Use LEFT and RIGHT arrow keys to move and SPACE to jump."~
+- Inside source: true
+*** True Line Result
+ #tick_instructions args, "Use LEFT and RIGHT arrow keys to move and SPACE to jump."
+** 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
+ 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: ~ # sets default values and creates empty collections~
+- Inside source: true
+*** True Line Result
+ # sets default values and creates empty collections
+** Processing line: ~ # initialization only happens in the first frame~
+- Inside source: true
+*** True Line Result
+ # initialization only happens in the first frame
+** Processing line: ~ def defaults args~
+- Inside source: true
+*** True Line Result
+ def defaults args
+** Processing line: ~ fiddle args~
+- Inside source: true
+*** True Line Result
+ fiddle args
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.tick_count = args.state.tick_count~
+- Inside source: true
+*** True Line Result
+ args.state.tick_count = args.state.tick_count
+** Processing line: ~ args.state.bridge_top = 128~
+- Inside source: true
+*** True Line Result
+ args.state.bridge_top = 128
+** Processing line: ~ args.state.player.x ||= 0 # initializes player's properties~
+- Inside source: true
+*** True Line Result
+ args.state.player.x ||= 0 # initializes player's properties
+** Processing line: ~ args.state.player.y ||= args.state.bridge_top~
+- Inside source: true
+*** True Line Result
+ args.state.player.y ||= args.state.bridge_top
+** Processing line: ~ args.state.player.w ||= 64~
+- Inside source: true
+*** True Line Result
+ args.state.player.w ||= 64
+** Processing line: ~ args.state.player.h ||= 64~
+- Inside source: true
+*** True Line Result
+ args.state.player.h ||= 64
+** Processing line: ~ args.state.player.dy ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy ||= 0
+** Processing line: ~ args.state.player.dx ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx ||= 0
+** Processing line: ~ args.state.player.r ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.r ||= 0
+** Processing line: ~ args.state.game_over_at ||= 0~
+- Inside source: true
+*** True Line Result
+ args.state.game_over_at ||= 0
+** Processing line: ~ args.state.animation_time ||=0~
+- Inside source: true
+*** True Line Result
+ args.state.animation_time ||=0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.timeleft ||=0~
+- Inside source: true
+*** True Line Result
+ args.state.timeleft ||=0
+** Processing line: ~ args.state.timeright ||=0~
+- Inside source: true
+*** True Line Result
+ args.state.timeright ||=0
+** Processing line: ~ args.state.lastpush ||=0~
+- Inside source: true
+*** True Line Result
+ args.state.lastpush ||=0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.inputlist ||= ["j","k","l"]~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist ||= ["j","k","l"]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # sets enemy, player, hammer values~
+- Inside source: true
+*** True Line Result
+ # sets enemy, player, hammer values
+** Processing line: ~ def fiddle args~
+- Inside source: true
+*** True Line Result
+ def fiddle args
+** Processing line: ~ args.state.gravity = -0.5~
+- Inside source: true
+*** True Line Result
+ args.state.gravity = -0.5
+** Processing line: ~ args.state.player_jump_power = 10 # sets player values~
+- Inside source: true
+*** True Line Result
+ args.state.player_jump_power = 10 # sets player values
+** Processing line: ~ args.state.player_jump_power_duration = 5~
+- Inside source: true
+*** True Line Result
+ args.state.player_jump_power_duration = 5
+** Processing line: ~ args.state.player_max_run_speed = 20~
+- Inside source: true
+*** True Line Result
+ args.state.player_max_run_speed = 20
+** Processing line: ~ args.state.player_speed_slowdown_rate = 0.9~
+- Inside source: true
+*** True Line Result
+ args.state.player_speed_slowdown_rate = 0.9
+** Processing line: ~ args.state.player_acceleration = 0.9~
+- Inside source: true
+*** True Line Result
+ args.state.player_acceleration = 0.9
+** 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
+ # outputs objects onto the screen
+** Processing line: ~ def render args~
+- Inside source: true
+*** True Line Result
+ def render args
+** Processing line: ~ if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)~
+- Inside source: true
+*** True Line Result
+ if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)
+** Processing line: ~ args.state.player.dx = 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ #move list~
+- Inside source: true
+*** True Line Result
+ #move list
+** Processing line: ~ (args.layout.rect_group row: 0, col_from_right: 8, drow: 0.3,~
+- Inside source: true
+*** True Line Result
+ (args.layout.rect_group row: 0, col_from_right: 8, drow: 0.3,
+** Processing line: ~ merge: { vertical_alignment_enum: 0, size_enum: -2 },~
+- Inside source: true
+*** True Line Result
+ merge: { vertical_alignment_enum: 0, size_enum: -2 },
+** Processing line: ~ group: [~
+- Inside source: true
+*** True Line Result
+ group: [
+** Processing line: ~ { text: "move: WASD" },~
+- Inside source: true
+*** True Line Result
+ { text: "move: WASD" },
+** Processing line: ~ { text: "jump: Space" },~
+- Inside source: true
+*** True Line Result
+ { text: "jump: Space" },
+** Processing line: ~ { text: "attack forwards: J (while on ground" },~
+- Inside source: true
+*** True Line Result
+ { text: "attack forwards: J (while on ground" },
+** Processing line: ~ { text: "attack upwards: K (while on groud)" },~
+- Inside source: true
+*** True Line Result
+ { text: "attack upwards: K (while on groud)" },
+** Processing line: ~ { text: "attack backwards: J (while on ground and holding A)" },~
+- Inside source: true
+*** True Line Result
+ { text: "attack backwards: J (while on ground and holding A)" },
+** Processing line: ~ { text: "attack downwards: K (while in air)" },~
+- Inside source: true
+*** True Line Result
+ { text: "attack downwards: K (while in air)" },
+** Processing line: ~ { text: "dash attack: J, K in quick succession." },~
+- Inside source: true
+*** True Line Result
+ { text: "dash attack: J, K in quick succession." },
+** Processing line: ~ { text: "shield: hold J, K at the same time." },~
+- Inside source: true
+*** True Line Result
+ { text: "shield: hold J, K at the same time." },
+** Processing line: ~ { text: "dash backwards: A, A in quick succession." },~
+- Inside source: true
+*** True Line Result
+ { text: "dash backwards: A, A in quick succession." },
+** Processing line: ~ ]).into args.outputs.labels~
+- Inside source: true
+*** True Line Result
+ ]).into args.outputs.labels
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # registered moves~
+- Inside source: true
+*** True Line Result
+ # registered moves
+** Processing line: ~ args.outputs.labels << { x: 0.to_layout_col,~
+- Inside source: true
+*** True Line Result
+ args.outputs.labels << { x: 0.to_layout_col,
+** Processing line: ~ y: 0.to_layout_row,~
+- Inside source: true
+*** True Line Result
+ y: 0.to_layout_row,
+** Processing line: ~ text: "input history",~
+- Inside source: true
+*** True Line Result
+ text: "input history",
+** Processing line: ~ size_enum: -2,~
+- Inside source: true
+*** True Line Result
+ size_enum: -2,
+** Processing line: ~ vertical_alignment_enum: 0 }~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 0 }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ (args.state.inputlist.take(5)).map do |s|~
+- Inside source: true
+*** True Line Result
+ (args.state.inputlist.take(5)).map do |s|
+** Processing line: ~ { text: s, size_enum: -2, vertical_alignment_enum: 0 }~
+- Inside source: true
+*** True Line Result
+ { text: s, size_enum: -2, vertical_alignment_enum: 0 }
+** Processing line: ~ end.yield_self do |group|~
+- Inside source: true
+*** True Line Result
+ end.yield_self do |group|
+** Processing line: ~ (args.layout.rect_group row: 0.3, col: 0, drow: 0.3, group: group).into args.outputs.labels~
+- Inside source: true
+*** True Line Result
+ (args.layout.rect_group row: 0.3, col: 0, drow: 0.3, group: group).into args.outputs.labels
+** 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: ~ #sprites~
+- Inside source: true
+*** True Line Result
+ #sprites
+** Processing line: ~ player = [args.state.player.x, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ player = [args.state.player.x, args.state.player.y,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/square/white.png",~
+- Inside source: true
+*** True Line Result
+ "sprites/square/white.png",
+** Processing line: ~ args.state.player.r]~
+- Inside source: true
+*** True Line Result
+ args.state.player.r]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ playershield = [args.state.player.x - 20, args.state.player.y - 10,~
+- Inside source: true
+*** True Line Result
+ playershield = [args.state.player.x - 20, args.state.player.y - 10,
+** Processing line: ~ args.state.player.w + 20, args.state.player.h + 20,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w + 20, args.state.player.h + 20,
+** Processing line: ~ "sprites/square/blue.png",~
+- Inside source: true
+*** True Line Result
+ "sprites/square/blue.png",
+** Processing line: ~ args.state.player.r,~
+- Inside source: true
+*** True Line Result
+ args.state.player.r,
+** Processing line: ~ 0]~
+- Inside source: true
+*** True Line Result
+ 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ playerjab = [args.state.player.x + 32, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/indigo.png",~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/indigo.png",
+** Processing line: ~ args.state.player.r,~
+- Inside source: true
+*** True Line Result
+ args.state.player.r,
+** Processing line: ~ 0]~
+- Inside source: true
+*** True Line Result
+ 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y + 32,~
+- Inside source: true
+*** True Line Result
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/indigo.png",~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/indigo.png",
+** Processing line: ~ args.state.player.r+90,~
+- Inside source: true
+*** True Line Result
+ args.state.player.r+90,
+** Processing line: ~ 0]~
+- Inside source: true
+*** True Line Result
+ 0]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if ((args.state.tick_count - args.state.lastpush) <= 15)~
+- Inside source: true
+*** True Line Result
+ if ((args.state.tick_count - args.state.lastpush) <= 15)
+** Processing line: ~ if (args.state.inputlist[0] == "<<")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "<<")
+** Processing line: ~ player = [args.state.player.x, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ player = [args.state.player.x, args.state.player.y,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/square/yellow.png", args.state.player.r]~
+- Inside source: true
+*** True Line Result
+ "sprites/square/yellow.png", args.state.player.r]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (args.state.inputlist[0] == "shield")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "shield")
+** Processing line: ~ player = [args.state.player.x, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ player = [args.state.player.x, args.state.player.y,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/square/indigo.png", args.state.player.r]~
+- Inside source: true
+*** True Line Result
+ "sprites/square/indigo.png", args.state.player.r]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ playershield = [args.state.player.x - 10, args.state.player.y - 10,~
+- Inside source: true
+*** True Line Result
+ playershield = [args.state.player.x - 10, args.state.player.y - 10,
+** Processing line: ~ args.state.player.w + 20, args.state.player.h + 20,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w + 20, args.state.player.h + 20,
+** Processing line: ~ "sprites/square/blue.png", args.state.player.r, 50]~
+- Inside source: true
+*** True Line Result
+ "sprites/square/blue.png", args.state.player.r, 50]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (args.state.inputlist[0] == "back-attack")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "back-attack")
+** Processing line: ~ playerjab = [args.state.player.x - 20, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ playerjab = [args.state.player.x - 20, args.state.player.y,
+** Processing line: ~ args.state.player.w - 10, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w - 10, args.state.player.h,
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r, 255]~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/indigo.png", args.state.player.r, 255]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (args.state.inputlist[0] == "forward-attack")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "forward-attack")
+** Processing line: ~ playerjab = [args.state.player.x + 32, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r, 255]~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/indigo.png", args.state.player.r, 255]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (args.state.inputlist[0] == "up-attack")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "up-attack")
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y + 32,~
+- Inside source: true
+*** True Line Result
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (args.state.inputlist[0] == "dair")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "dair")
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y - 32,~
+- Inside source: true
+*** True Line Result
+ playerupper = [args.state.player.x, args.state.player.y - 32,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (args.state.inputlist[0] == "dash-attack")~
+- Inside source: true
+*** True Line Result
+ if (args.state.inputlist[0] == "dash-attack")
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y + 32,~
+- Inside source: true
+*** True Line Result
+ playerupper = [args.state.player.x, args.state.player.y + 32,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/violet.png", args.state.player.r + 90, 255]~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/violet.png", args.state.player.r + 90, 255]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ playerjab = [args.state.player.x + 32, args.state.player.y,~
+- Inside source: true
+*** True Line Result
+ playerjab = [args.state.player.x + 32, args.state.player.y,
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+- Inside source: true
+*** True Line Result
+ args.state.player.w, args.state.player.h,
+** Processing line: ~ "sprites/isometric/violet.png", args.state.player.r, 255]~
+- Inside source: true
+*** True Line Result
+ "sprites/isometric/violet.png", args.state.player.r, 255]
+** 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: ~ args.outputs.sprites << playerjab~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << playerjab
+** Processing line: ~ args.outputs.sprites << playerupper~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << playerupper
+** Processing line: ~ args.outputs.sprites << player~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << player
+** Processing line: ~ args.outputs.sprites << playershield~
+- Inside source: true
+*** True Line Result
+ args.outputs.sprites << playershield
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge~
+- Inside source: true
+*** True Line Result
+ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge
+** Processing line: ~ [i * 64, args.state.bridge_top - 64, 64, 64]~
+- Inside source: true
+*** True Line Result
+ [i * 64, args.state.bridge_top - 64, 64, 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: ~ # Performs calculations to move objects on the screen~
+- Inside source: true
+*** True Line Result
+ # Performs calculations to move objects on the screen
+** Processing line: ~ def calc args~
+- Inside source: true
+*** True Line Result
+ def calc args
+** Processing line: ~ # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.~
+- Inside source: true
+*** True Line Result
+ # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.
+** Processing line: ~ args.state.player.x += args.state.player.dx~
+- Inside source: true
+*** True Line Result
+ args.state.player.x += args.state.player.dx
+** 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: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Since acceleration is the change in velocity, the change in y (dy) increases every frame~
+- Inside source: true
+*** True Line Result
+ # Since acceleration is the change in velocity, the change in y (dy) increases every frame
+** Processing line: ~ args.state.player.dy += args.state.gravity~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy += args.state.gravity
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # player's y position is either current y position or y position of top of~
+- Inside source: true
+*** True Line Result
+ # player's y position is either current y position or y position of top of
+** Processing line: ~ # bridge, whichever has a greater value~
+- Inside source: true
+*** True Line Result
+ # bridge, whichever has a greater value
+** Processing line: ~ # ensures that the player never goes below the bridge~
+- Inside source: true
+*** True Line Result
+ # ensures that the player never goes below the bridge
+** Processing line: ~ args.state.player.y = args.state.player.y.greater(args.state.bridge_top)~
+- Inside source: true
+*** True Line Result
+ args.state.player.y = args.state.player.y.greater(args.state.bridge_top)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # player's x position is either the current x position or 0, whichever has a greater value~
+- Inside source: true
+*** True Line Result
+ # player's x position is either the current x position or 0, whichever has a greater value
+** Processing line: ~ # ensures that the player doesn't go too far left (out of the screen's scope)~
+- Inside source: true
+*** True Line Result
+ # ensures that the player doesn't go too far left (out of the screen's scope)
+** Processing line: ~ args.state.player.x = args.state.player.x.greater(0)~
+- Inside source: true
+*** True Line Result
+ args.state.player.x = args.state.player.x.greater(0)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # player is not falling if it is located on the top of the bridge~
+- Inside source: true
+*** True Line Result
+ # player is not falling if it is located on the top of the bridge
+** Processing line: ~ args.state.player.falling = false if args.state.player.y == args.state.bridge_top~
+- Inside source: true
+*** True Line Result
+ args.state.player.falling = false if args.state.player.y == args.state.bridge_top
+** Processing line: ~ #args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player~
+- Inside source: true
+*** True Line Result
+ #args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Resets the player by changing its properties back to the values they had at initialization~
+- Inside source: true
+*** True Line Result
+ # Resets the player by changing its properties back to the values they had at initialization
+** Processing line: ~ def reset_player args~
+- Inside source: true
+*** True Line Result
+ def reset_player args
+** Processing line: ~ args.state.player.x = 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.x = 0
+** Processing line: ~ args.state.player.y = args.state.bridge_top~
+- Inside source: true
+*** True Line Result
+ args.state.player.y = args.state.bridge_top
+** Processing line: ~ args.state.player.dy = 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy = 0
+** Processing line: ~ args.state.player.dx = 0~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = 0
+** Processing line: ~ args.state.enemy.hammers.clear # empties hammer collection~
+- Inside source: true
+*** True Line Result
+ args.state.enemy.hammers.clear # empties hammer collection
+** Processing line: ~ args.state.enemy.hammer_queue.clear # empties hammer_queue~
+- Inside source: true
+*** True Line Result
+ args.state.enemy.hammer_queue.clear # empties hammer_queue
+** Processing line: ~ args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)~
+- Inside source: true
+*** True Line Result
+ args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # Processes input from the user to move the player~
+- Inside source: true
+*** True Line Result
+ # Processes input from the user to move the player
+** Processing line: ~ def input args~
+- Inside source: true
+*** True Line Result
+ def input args
+** Processing line: ~ if args.state.inputlist.length > 5~
+- Inside source: true
+*** True Line Result
+ if args.state.inputlist.length > 5
+** Processing line: ~ args.state.inputlist.pop~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.pop
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ should_process_special_move = (args.inputs.keyboard.key_down.j) ||~
+- Inside source: true
+*** True Line Result
+ should_process_special_move = (args.inputs.keyboard.key_down.j) ||
+** Processing line: ~ (args.inputs.keyboard.key_down.k) ||~
+- Inside source: true
+*** True Line Result
+ (args.inputs.keyboard.key_down.k) ||
+** Processing line: ~ (args.inputs.keyboard.key_down.a) ||~
+- Inside source: true
+*** True Line Result
+ (args.inputs.keyboard.key_down.a) ||
+** Processing line: ~ (args.inputs.keyboard.key_down.d) ||~
+- Inside source: true
+*** True Line Result
+ (args.inputs.keyboard.key_down.d) ||
+** Processing line: ~ (args.inputs.controller_one.key_down.y) ||~
+- Inside source: true
+*** True Line Result
+ (args.inputs.controller_one.key_down.y) ||
+** Processing line: ~ (args.inputs.controller_one.key_down.x) ||~
+- Inside source: true
+*** True Line Result
+ (args.inputs.controller_one.key_down.x) ||
+** Processing line: ~ (args.inputs.controller_one.key_down.left) ||~
+- Inside source: true
+*** True Line Result
+ (args.inputs.controller_one.key_down.left) ||
+** Processing line: ~ (args.inputs.controller_one.key_down.right)~
+- Inside source: true
+*** True Line Result
+ (args.inputs.controller_one.key_down.right)
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (should_process_special_move)~
+- Inside source: true
+*** True Line Result
+ if (should_process_special_move)
+** Processing line: ~ if (args.inputs.keyboard.key_down.j && args.inputs.keyboard.key_down.k) ||~
+- Inside source: true
+*** True Line Result
+ if (args.inputs.keyboard.key_down.j && args.inputs.keyboard.key_down.k) ||
+** Processing line: ~ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.y)~
+- Inside source: true
+*** True Line Result
+ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.y)
+** Processing line: ~ args.state.inputlist.unshift("shield")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("shield")
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&
+** Processing line: ~ (args.state.inputlist[0] == "forward-attack") && ((args.state.tick_count - args.state.lastpush) <= 15)~
+- Inside source: true
+*** True Line Result
+ (args.state.inputlist[0] == "forward-attack") && ((args.state.tick_count - args.state.lastpush) <= 15)
+** Processing line: ~ args.state.inputlist.unshift("dash-attack")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("dash-attack")
+** Processing line: ~ args.state.player.dx = 20~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = 20
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.j && args.inputs.keyboard.a) ||~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.keyboard.key_down.j && args.inputs.keyboard.a) ||
+** Processing line: ~ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.left)~
+- Inside source: true
+*** True Line Result
+ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.left)
+** Processing line: ~ args.state.inputlist.unshift("back-attack")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("back-attack")
+** Processing line: ~ elsif ( args.inputs.controller_one.key_down.x || args.inputs.keyboard.key_down.j)~
+- Inside source: true
+*** True Line Result
+ elsif ( args.inputs.controller_one.key_down.x || args.inputs.keyboard.key_down.j)
+** Processing line: ~ args.state.inputlist.unshift("forward-attack")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("forward-attack")
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&
+** Processing line: ~ (args.state.player.y > 128)~
+- Inside source: true
+*** True Line Result
+ (args.state.player.y > 128)
+** Processing line: ~ args.state.inputlist.unshift("dair")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("dair")
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y)~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y)
+** Processing line: ~ args.state.inputlist.unshift("up-attack")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("up-attack")
+** Processing line: ~ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a) &&~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a) &&
+** Processing line: ~ (args.state.inputlist[0] == "<") &&~
+- Inside source: true
+*** True Line Result
+ (args.state.inputlist[0] == "<") &&
+** Processing line: ~ ((args.state.tick_count - args.state.lastpush) <= 10)~
+- Inside source: true
+*** True Line Result
+ ((args.state.tick_count - args.state.lastpush) <= 10)
+** Processing line: ~ args.state.inputlist.unshift("<<")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("<<")
+** Processing line: ~ args.state.player.dx = -15~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = -15
+** Processing line: ~ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a)~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a)
+** Processing line: ~ args.state.inputlist.unshift("<")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift("<")
+** Processing line: ~ args.state.timeleft = args.state.tick_count~
+- Inside source: true
+*** True Line Result
+ args.state.timeleft = args.state.tick_count
+** Processing line: ~ elsif (args.inputs.controller_one.key_down.right || args.inputs.keyboard.key_down.d)~
+- Inside source: true
+*** True Line Result
+ elsif (args.inputs.controller_one.key_down.right || args.inputs.keyboard.key_down.d)
+** Processing line: ~ args.state.inputlist.unshift(">")~
+- Inside source: true
+*** True Line Result
+ args.state.inputlist.unshift(">")
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.state.lastpush = args.state.tick_count~
+- Inside source: true
+*** True Line Result
+ args.state.lastpush = args.state.tick_count
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.keyboard.space || args.inputs.controller_one.r2 # if the user presses the space bar~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.space || args.inputs.controller_one.r2 # if the user presses the space bar
+** Processing line: ~ args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame~
+- Inside source: true
+*** True Line Result
+ args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # if the time that has passed since the jump is less than the player's jump duration and~
+- Inside source: true
+*** True Line Result
+ # if the time that has passed since the jump is less than the player's jump duration and
+** Processing line: ~ # the player is not falling~
+- Inside source: true
+*** True Line Result
+ # the player is not falling
+** Processing line: ~ if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling~
+- Inside source: true
+*** True Line Result
+ if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling
+** Processing line: ~ args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump~
+- Inside source: true
+*** True Line Result
+ args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump
+** 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 in the "up" state (or not being pressed down)~
+- Inside source: true
+*** True Line Result
+ # if the space bar is in the "up" state (or not being pressed down)
+** Processing line: ~ if args.inputs.keyboard.key_up.space || args.inputs.controller_one.key_up.r2~
+- Inside source: true
+*** True Line Result
+ if args.inputs.keyboard.key_up.space || args.inputs.controller_one.key_up.r2
+** Processing line: ~ args.state.player.jumped_at = nil # jumped_at is empty~
+- Inside source: true
+*** True Line Result
+ args.state.player.jumped_at = nil # jumped_at is empty
+** Processing line: ~ args.state.player.falling = true # the player is falling~
+- Inside source: true
+*** True Line Result
+ args.state.player.falling = true # the player is falling
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if args.inputs.left # if left key is pressed~
+- Inside source: true
+*** True Line Result
+ if args.inputs.left # if left key is pressed
+** Processing line: ~ if args.state.player.dx < -5~
+- Inside source: true
+*** True Line Result
+ if args.state.player.dx < -5
+** Processing line: ~ args.state.player.dx = args.state.player.dx~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = args.state.player.dx
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ args.state.player.dx = -5~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = -5
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ elsif args.inputs.right # if right key is pressed~
+- Inside source: true
+*** True Line Result
+ elsif args.inputs.right # if right key is pressed
+** Processing line: ~ if args.state.player.dx > 5~
+- Inside source: true
+*** True Line Result
+ if args.state.player.dx > 5
+** Processing line: ~ args.state.player.dx = args.state.player.dx~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = args.state.player.dx
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ args.state.player.dx = 5~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx = 5
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if ((args.state.player.dx).abs > 5) #&& ((args.state.tick_count - args.state.lastpush) <= 10)~
+- Inside source: true
+*** True Line Result
+ if ((args.state.player.dx).abs > 5) #&& ((args.state.tick_count - args.state.lastpush) <= 10)
+** Processing line: ~ args.state.player.dx *= 0.95~
+- Inside source: true
+*** True Line Result
+ args.state.player.dx *= 0.95
+** 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_instructions args, text, y = 715~
+- Inside source: true
+*** True Line Result
+ def tick_instructions args, text, y = 715
+** Processing line: ~ return if args.state.key_event_occurred~
+- Inside source: true
+*** True Line Result
+ return if args.state.key_event_occurred
+** Processing line: ~ if args.inputs.mouse.click ||~
+- Inside source: true
+*** True Line Result
+ if args.inputs.mouse.click ||
+** Processing line: ~ args.inputs.keyboard.directional_vector ||~
+- Inside source: true
+*** True Line Result
+ args.inputs.keyboard.directional_vector ||
+** Processing line: ~ args.inputs.keyboard.key_down.enter ||~
+- Inside source: true
+*** True Line Result
+ args.inputs.keyboard.key_down.enter ||
+** Processing line: ~ args.inputs.keyboard.key_down.space ||~
+- Inside source: true
+*** True Line Result
+ args.inputs.keyboard.key_down.space ||
+** Processing line: ~ args.inputs.keyboard.key_down.escape~
+- Inside source: true
+*** True Line Result
+ args.inputs.keyboard.key_down.escape
+** Processing line: ~ args.state.key_event_occurred = true~
+- Inside source: true
+*** True Line Result
+ args.state.key_event_occurred = true
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
+- Inside source: true
+*** True Line Result
+ args.outputs.debug << [0, y - 50, 1280, 60].solid
+** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
+- Inside source: true
+*** True Line Result
+ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label
+** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+- Inside source: true
+*** True Line Result
+ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label
+** 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: ~*** Lowrez - Nokia 3310 - main.rb~
- Header detected.
*** True Line Result
@@ -102520,10 +109459,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
r: 255, g: 255, b: 255
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
- Inside source: true
*** True Line Result
- }.label
+ }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -102560,10 +109499,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
r: 255, g: 255, b: 255
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
- Inside source: true
*** True Line Result
- }.label
+ }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -103572,10 +110511,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 100
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
- Inside source: true
*** True Line Result
- }.line
+ }.line!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -103624,10 +110563,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 100
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
- Inside source: true
*** True Line Result
- }.line
+ }.line!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -106640,10 +113579,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 80
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
- Inside source: true
*** True Line Result
- }.line
+ }.line!
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -106684,10 +113623,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
a: 80
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
- Inside source: true
*** True Line Result
- }.line
+ }.line!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -106792,10 +113731,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
size_enum: -1.5
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
- Inside source: true
*** True Line Result
- }.label
+ }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -106828,10 +113767,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
alignment_enum: 1
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
- Inside source: true
*** True Line Result
- }.label
+ }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -140923,170 +147862,42 @@ 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: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Contains information related to input devices and input events.~
-- Inside source: true
-*** True Line Result
- # Contains information related to input devices and input events.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Inputs]~
-- Inside source: true
-*** True Line Result
- # @return [Inputs]
** Processing line: ~ attr_accessor :inputs~
- Inside source: true
*** True Line Result
attr_accessor :inputs
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Contains the means to interact with output devices such as the screen.~
-- Inside source: true
-*** True Line Result
- # Contains the means to interact with output devices such as the screen.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Outputs]~
-- Inside source: true
-*** True Line Result
- # @return [Outputs]
** Processing line: ~ attr_accessor :outputs~
- Inside source: true
*** True Line Result
attr_accessor :outputs
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Contains the means to interact with the audio mixer.~
-- Inside source: true
-*** True Line Result
- # Contains the means to interact with the audio mixer.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Hash]~
-- Inside source: true
-*** True Line Result
- # @return [Hash]
** Processing line: ~ attr_accessor :audio~
- Inside source: true
*** True Line Result
attr_accessor :audio
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Contains display size information to assist in positioning things on the screen.~
-- Inside source: true
-*** True Line Result
- # Contains display size information to assist in positioning things on the screen.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Grid]~
-- Inside source: true
-*** True Line Result
- # @return [Grid]
** Processing line: ~ attr_accessor :grid~
- Inside source: true
*** True Line Result
attr_accessor :grid
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Provides access to game play recording facilities within Game Toolkit.~
-- Inside source: true
-*** True Line Result
- # Provides access to game play recording facilities within Game Toolkit.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Recording]~
-- Inside source: true
-*** True Line Result
- # @return [Recording]
** Processing line: ~ attr_accessor :recording~
- Inside source: true
*** True Line Result
attr_accessor :recording
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Gives you access to geometry related functions.~
-- Inside source: true
-*** True Line Result
- # Gives you access to geometry related functions.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Geometry]~
-- Inside source: true
-*** True Line Result
- # @return [Geometry]
** Processing line: ~ attr_accessor :geometry~
- Inside source: true
*** True Line Result
attr_accessor :geometry
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ attr_accessor :fn~
- Inside source: true
*** True Line Result
attr_accessor :fn
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # This is where you'll put state associated with your video game.~
-- Inside source: true
-*** True Line Result
- # This is where you'll put state associated with your video game.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [OpenEntity]~
-- Inside source: true
-*** True Line Result
- # @return [OpenEntity]
** Processing line: ~ attr_accessor :state~
- Inside source: true
*** True Line Result
attr_accessor :state
-** Processing line: ~~
+** Processing line: ~ attr_accessor :temp_state~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ # Gives you access to the top level DragonRuby runtime.~
-- Inside source: true
-*** True Line Result
- # Gives you access to the top level DragonRuby runtime.
-** Processing line: ~ #~
-- Inside source: true
-*** True Line Result
- #
-** Processing line: ~ # @return [Runtime]~
-- Inside source: true
-*** True Line Result
- # @return [Runtime]
+ attr_accessor :temp_state
** Processing line: ~ attr_accessor :runtime~
- Inside source: true
*** True Line Result
@@ -141095,42 +147906,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
alias_method :gtk, :runtime
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ attr_accessor :passes~
- Inside source: true
*** True Line Result
attr_accessor :passes
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ attr_accessor :wizards~
- Inside source: true
*** True Line Result
attr_accessor :wizards
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ attr_accessor :layout~
- Inside source: true
*** True Line Result
attr_accessor :layout
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ attr_accessor :easing~
- Inside source: true
*** True Line Result
attr_accessor :easing
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
** Processing line: ~ attr_accessor :string~
- Inside source: true
*** True Line Result
@@ -141163,6 +147954,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@state = OpenEntity.new
+** Processing line: ~ @temp_state = OpenEntity.new~
+- Inside source: true
+*** True Line Result
+ @temp_state = OpenEntity.new
** Processing line: ~ @state.tick_count = -1~
- Inside source: true
*** True Line Result
@@ -141279,26 +148074,30 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
{
-** Processing line: ~ state: state.as_hash,~
+** Processing line: ~ state: state.as_hash,~
+- Inside source: true
+*** True Line Result
+ state: state.as_hash,
+** Processing line: ~ temp_state: temp_state.as_hash,~
- Inside source: true
*** True Line Result
- state: state.as_hash,
-** Processing line: ~ inputs: inputs.serialize,~
+ temp_state: temp_state.as_hash,
+** Processing line: ~ inputs: inputs.serialize,~
- Inside source: true
*** True Line Result
- inputs: inputs.serialize,
-** Processing line: ~ passes: passes.serialize,~
+ inputs: inputs.serialize,
+** Processing line: ~ passes: passes.serialize,~
- Inside source: true
*** True Line Result
- passes: passes.serialize,
-** Processing line: ~ outputs: outputs.serialize,~
+ passes: passes.serialize,
+** Processing line: ~ outputs: outputs.serialize,~
- Inside source: true
*** True Line Result
- outputs: outputs.serialize,
-** Processing line: ~ grid: grid.serialize~
+ outputs: outputs.serialize,
+** Processing line: ~ grid: grid.serialize~
- Inside source: true
*** True Line Result
- grid: grid.serialize
+ grid: grid.serialize
** Processing line: ~ }~
- Inside source: true
*** True Line Result
@@ -141963,10 +148762,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def custom_assertion actual, expected, message = nil
-** Processing line: ~ # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).~
+** Processing line: ~ # this tells Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).~
- Inside source: true
*** True Line Result
- # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
+ # this tells Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
** Processing line: ~ @assertion_performed = true~
- Inside source: true
*** True Line Result
@@ -141975,10 +148774,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # perform your custom logic here and rais an exception to denote a failure.~
+** Processing line: ~ # perform your custom logic here and raise an exception to denote a failure.~
- Inside source: true
*** True Line Result
- # perform your custom logic here and rais an exception to denote a failure.
+ # perform your custom logic here and raise an exception to denote a failure.
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -142015,10 +148814,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
=begin
-** Processing line: ~ Us this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).~
+** Processing line: ~ Use this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).~
- Inside source: true
*** True Line Result
- Us this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
+ Use this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
** Processing line: ~ =end~
- Inside source: true
*** True Line Result
@@ -142043,10 +148842,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
=begin
-** Processing line: ~ Assert if a value is a thruthy value. All assert method take an optional final parameter that is the message to display to the user.~
+** Processing line: ~ Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.~
- Inside source: true
*** True Line Result
- Assert if a value is a thruthy value. All assert method take an optional final parameter that is the message to display to the user.
+ Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -142259,10 +149058,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
-** Processing line: ~ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}"~
+** Processing line: ~ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}\n#{message}"~
- Inside source: true
*** True Line Result
- message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}\n#{message}"
** Processing line: ~ raise message~
- Inside source: true
*** True Line Result
@@ -142299,10 +149098,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
-** Processing line: ~ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}"~
+** Processing line: ~ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}\n#{message}"~
- Inside source: true
*** True Line Result
- message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}\n#{message}"
** Processing line: ~ raise message~
- Inside source: true
*** True Line Result
@@ -142523,6 +149322,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def temp_state~
+- Inside source: true
+*** True Line Result
+ def temp_state
+** Processing line: ~ args.temp_state~
+- Inside source: true
+*** True Line Result
+ args.temp_state
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def inputs~
- Inside source: true
*** True Line Result
@@ -142631,6 +149446,38 @@ 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: ~ def new_entity entity_type, init_hash = nil, &block~
+- Inside source: true
+*** True Line Result
+ def new_entity entity_type, init_hash = nil, &block
+** Processing line: ~ args.state.new_entity entity_type, init_hash, &block~
+- Inside source: true
+*** True Line Result
+ args.state.new_entity entity_type, init_hash, &block
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def new_entity_strict entity_type, init_hash = nil, &block~
+- Inside source: true
+*** True Line Result
+ def new_entity_strict entity_type, init_hash = nil, &block
+** Processing line: ~ args.state.new_entity_strict entity_type, init_hash, &block~
+- Inside source: true
+*** True Line Result
+ args.state.new_entity_strict entity_type, init_hash, &block
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -142819,10 +149666,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:flip_vertically, :angle_anchor_x, :angle_anchor_y, :id,
-** Processing line: ~ :source_x, :source_y, :source_w, :source_h~
+** Processing line: ~ :source_x, :source_y, :source_w, :source_h, :blendmode_enum~
- Inside source: true
*** True Line Result
- :source_x, :source_y, :source_w, :source_h
+ :source_x, :source_y, :source_w, :source_h, :blendmode_enum
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -143003,10 +149850,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def initialize
-** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)~
+** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)~
- Inside source: true
*** True Line Result
- @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)
+ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)
** Processing line: ~ @menu = Menu.new self~
- Inside source: true
*** True Line Result
@@ -143083,6 +149930,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@header_color = Color.new [100, 200, 220]
+** Processing line: ~ @code_color = Color.new [210, 168, 255]~
+- Inside source: true
+*** True Line Result
+ @code_color = Color.new [210, 168, 255]
+** Processing line: ~ @comment_color = Color.new [0, 200, 100]~
+- Inside source: true
+*** True Line Result
+ @comment_color = Color.new [0, 200, 100]
** Processing line: ~ @animation_duration = 1.seconds~
- Inside source: true
*** True Line Result
@@ -144179,6 +151034,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
$gtk.request_quit
+** Processing line: ~ elsif cmd.start_with? ':'~
+- Inside source: true
+*** True Line Result
+ elsif cmd.start_with? ':'
+** Processing line: ~ send ((cmd.gsub '-', '_').gsub ':', '')~
+- Inside source: true
+*** True Line Result
+ send ((cmd.gsub '-', '_').gsub ':', '')
** Processing line: ~ else~
- Inside source: true
*** True Line Result
@@ -144211,6 +151074,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
elsif $results == :console_silent_eval
+** Processing line: ~ # do nothing since the console is silent~
+- Inside source: true
+*** True Line Result
+ # do nothing since the console is silent
** Processing line: ~ else~
- Inside source: true
*** True Line Result
@@ -144235,10 +151102,30 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
try_search_docs e
-** Processing line: ~ puts "* EXCEPTION: #{e}"~
+** Processing line: ~ # if an exception is thrown and the bactrace includes something helpful, then show it~
+- Inside source: true
+*** True Line Result
+ # if an exception is thrown and the bactrace includes something helpful, then show it
+** Processing line: ~ if (e.backtrace || []).first && (e.backtrace.first.include? "(eval)")~
+- Inside source: true
+*** True Line Result
+ if (e.backtrace || []).first && (e.backtrace.first.include? "(eval)")
+** Processing line: ~ puts "* EXCEPTION: #{e}"~
- Inside source: true
*** True Line Result
- puts "* EXCEPTION: #{e}"
+ puts "* EXCEPTION: #{e}"
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ puts "* EXCEPTION: #{e}\n#{e.__backtrace_to_org__}"~
+- Inside source: true
+*** True Line Result
+ puts "* EXCEPTION: #{e}\n#{e.__backtrace_to_org__}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -145143,6 +152030,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
render_log_offset args
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ args.outputs.reserved << { x: 10.from_right, y: @bottom + 10,~
+- Inside source: true
+*** True Line Result
+ args.outputs.reserved << { x: 10.from_right, y: @bottom + 10,
+** Processing line: ~ text: "Press CTRL+g or ESCAPE to clear the prompt.",~
+- Inside source: true
+*** True Line Result
+ text: "Press CTRL+g or ESCAPE to clear the prompt.",
+** Processing line: ~ vertical_alignment_enum: 0,~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 0,
+** Processing line: ~ alignment_enum: 2, r: 80, g: 80, b: 80 }.label!~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 2, r: 80, g: 80, b: 80 }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -145231,10 +152138,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def include_subdued_markers? text
-** Processing line: ~ include_any_words? text, subdued_markers~
+** Processing line: ~ (text.start_with? "* INFO: ") && (include_any_words? text, subdued_markers)~
- Inside source: true
*** True Line Result
- include_any_words? text, subdued_markers
+ (text.start_with? "* INFO: ") && (include_any_words? text, subdued_markers)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -145815,14 +152722,110 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def code? log_entry~
+- Inside source: true
+*** True Line Result
+ def code? log_entry
+** Processing line: ~ (just_symbol? log_entry) || (codeblock_marker? log_entry)~
+- Inside source: true
+*** True Line Result
+ (just_symbol? log_entry) || (codeblock_marker? log_entry)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def just_symbol? log_entry~
+- Inside source: true
+*** True Line Result
+ def just_symbol? log_entry
+** Processing line: ~ scrubbed = log_entry.gsub("*", "").strip~
+- Inside source: true
+*** True Line Result
+ scrubbed = log_entry.gsub("*", "").strip
+** Processing line: ~ (scrubbed.start_with? ":") && (!scrubbed.include? " ") && (!scrubbed.include? "=>")~
+- Inside source: true
+*** True Line Result
+ (scrubbed.start_with? ":") && (!scrubbed.include? " ") && (!scrubbed.include? "=>")
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def code_comment? log_entry~
+- Inside source: true
+*** True Line Result
+ def code_comment? log_entry
+** Processing line: ~ return true if log_entry.strip.start_with?("# ")~
+- Inside source: true
+*** True Line Result
+ return true if log_entry.strip.start_with?("# ")
+** Processing line: ~ return false~
+- Inside source: true
+*** True Line Result
+ return false
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def codeblock_marker? log_entry~
+- Inside source: true
+*** True Line Result
+ def codeblock_marker? log_entry
+** Processing line: ~ return true if log_entry.strip.start_with?("#+begin_src")~
+- Inside source: true
+*** True Line Result
+ return true if log_entry.strip.start_with?("#+begin_src")
+** Processing line: ~ return true if log_entry.strip.start_with?("#+end_src")~
+- Inside source: true
+*** True Line Result
+ return true if log_entry.strip.start_with?("#+end_src")
+** Processing line: ~ return false~
+- Inside source: true
+*** True Line Result
+ return false
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- 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 include_row_marker? log_entry~
+** Processing line: ~ if code? log_entry~
+- Inside source: true
+*** True Line Result
+ if code? log_entry
+** Processing line: ~ @code_color~
+- Inside source: true
+*** True Line Result
+ @code_color
+** Processing line: ~ elsif code_comment? log_entry~
+- Inside source: true
+*** True Line Result
+ elsif code_comment? log_entry
+** Processing line: ~ @comment_color~
+- Inside source: true
+*** True Line Result
+ @comment_color
+** Processing line: ~ elsif include_row_marker? log_entry~
- Inside source: true
*** True Line Result
- if include_row_marker? log_entry
+ elsif include_row_marker? log_entry
** Processing line: ~ @text_color~
- Inside source: true
*** True Line Result
@@ -146123,6 +153126,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def to_s~
+- Inside source: true
+*** True Line Result
+ def to_s
+** Processing line: ~ "GTK::Console::Color #{to_h}"~
+- Inside source: true
+*** True Line Result
+ "GTK::Console::Color #{to_h}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def to_h~
- Inside source: true
*** True Line Result
@@ -146315,10 +153334,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
**color.to_h,
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
- Inside source: true
*** True Line Result
- }.label
+ }.label!
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -146575,10 +153594,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@console.scroll_to_bottom
-** Processing line: ~ $wizards.itch.start~
+** Processing line: ~ $wizards.itch.restart~
- Inside source: true
*** True Line Result
- $wizards.itch.start
+ $wizards.itch.restart
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -146675,6 +153694,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
(button id: :replay, row: 0, col: 10, text: "start replay", method: :replay_clicked),
+** Processing line: ~ *custom_buttons~
+- Inside source: true
+*** True Line Result
+ *custom_buttons
** Processing line: ~ ]~
- Inside source: true
*** True Line Result
@@ -146907,14 +153930,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
primitives = []
-** Processing line: ~ primitives << entity[:rect].merge(a: 164).solid~
+** Processing line: ~ primitives << entity[:rect].solid!(a: 164)~
- Inside source: true
*** True Line Result
- primitives << entity[:rect].merge(a: 164).solid
-** Processing line: ~ primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border~
+ primitives << entity[:rect].solid!(a: 164)
+** Processing line: ~ primitives << entity[:rect].border!(r: 255, g: 255, b: 255)~
- Inside source: true
*** True Line Result
- primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border
+ primitives << entity[:rect].border!(r: 255, g: 255, b: 255)
** Processing line: ~ primitives << text.wrapped_lines(5)~
- Inside source: true
*** True Line Result
@@ -147731,10 +154754,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # remove seperators between empty values~
+** Processing line: ~ # remove separators between empty values~
- Inside source: true
*** True Line Result
- # remove seperators between empty values
+ # remove separators between empty values
** Processing line: ~ formated_row = formated_row.gsub(" | ", " ")~
- Inside source: true
*** True Line Result
@@ -147755,10 +154778,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def pretty_print_row_seperator string_width, cell_width, column_width, columns~
+** Processing line: ~ def pretty_print_row_separator string_width, cell_width, column_width, columns~
- Inside source: true
*** True Line Result
- def pretty_print_row_seperator string_width, cell_width, column_width, columns
+ def pretty_print_row_separator string_width, cell_width, column_width, columns
** Processing line: ~ # this is a joint: +--------~
- Inside source: true
*** True Line Result
@@ -147771,10 +154794,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # multiple joints create a row seperator: +----+----+~
+** Processing line: ~ # multiple joints create a row separator: +----+----+~
- Inside source: true
*** True Line Result
- # multiple joints create a row seperator: +----+----+
+ # multiple joints create a row separator: +----+----+
** Processing line: ~ puts (column_joint * columns) + "+"~
- Inside source: true
*** True Line Result
@@ -147807,10 +154830,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
x2: x + @cursor_position_px + 0.5,
-** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~
+** Processing line: ~ y2: y + @font_style.letter_size.y + 4)~
- Inside source: true
*** True Line Result
- y2: y + @font_style.letter_size.y + 5)
+ y2: y + @font_style.letter_size.y + 4)
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -147827,10 +154850,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
x2: x + @cursor_position_px + 1,
-** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~
+** Processing line: ~ y2: y + @font_style.letter_size.y + 4)~
- Inside source: true
*** True Line Result
- y2: y + @font_style.letter_size.y + 5)
+ y2: y + @font_style.letter_size.y + 4)
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -150351,10 +157374,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:l3, :r3,
-** Processing line: ~ :start, :select,~
+** Processing line: ~ :start, :select, :home,~
- Inside source: true
*** True Line Result
- :start, :select,
+ :start, :select, :home,
** Processing line: ~ :directional_up, :directional_down, :directional_left, :directional_right~
- Inside source: true
*** True Line Result
@@ -150383,6 +157406,70 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def back~
+- Inside source: true
+*** True Line Result
+ def back
+** Processing line: ~ @select~
+- Inside source: true
+*** True Line Result
+ @select
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def back= value~
+- Inside source: true
+*** True Line Result
+ def back= value
+** Processing line: ~ @select = value~
+- Inside source: true
+*** True Line Result
+ @select = value
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def guide~
+- Inside source: true
+*** True Line Result
+ def guide
+** Processing line: ~ @home~
+- Inside source: true
+*** True Line Result
+ @home
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def guide= value~
+- Inside source: true
+*** True Line Result
+ def guide= value
+** Processing line: ~ @home = value~
+- Inside source: true
+*** True Line Result
+ @home = value
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ # Activate a key.~
- Inside source: true
*** True Line Result
@@ -150579,10 +157666,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
* ERROR
-** Processing line: ~ The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy:~
+** Processing line: ~ The GTK::DirectionalKeys module should only be included in objects that respond to the following api hierarchy:~
- Inside source: true
*** True Line Result
- The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy:
+ The GTK::DirectionalKeys module should only be included in objects that respond to the following api hierarchy:
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -150807,6 +157894,30 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def directional_angle~
+- Inside source: true
+*** True Line Result
+ def directional_angle
+** Processing line: ~ return nil unless directional_vector~
+- Inside source: true
+*** True Line Result
+ return nil unless directional_vector
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ Math.atan2(up_down, left_right).to_degrees~
+- Inside source: true
+*** True Line Result
+ Math.atan2(up_down, left_right).to_degrees
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def method_missing m, *args~
- Inside source: true
*** True Line Result
@@ -151747,6 +158858,70 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
module Geometry
+** Processing line: ~ def self.rotate_point point, angle, around = nil~
+- Inside source: true
+*** True Line Result
+ def self.rotate_point point, angle, around = nil
+** Processing line: ~ s = Math.sin a.to_radians~
+- Inside source: true
+*** True Line Result
+ s = Math.sin a.to_radians
+** Processing line: ~ c = Math.cos a.to_radians~
+- Inside source: true
+*** True Line Result
+ c = Math.cos a.to_radians
+** Processing line: ~ px = point.x~
+- Inside source: true
+*** True Line Result
+ px = point.x
+** Processing line: ~ py = point.y~
+- Inside source: true
+*** True Line Result
+ py = point.y
+** Processing line: ~ cx = 0~
+- Inside source: true
+*** True Line Result
+ cx = 0
+** Processing line: ~ cy = 0~
+- Inside source: true
+*** True Line Result
+ cy = 0
+** Processing line: ~ if around~
+- Inside source: true
+*** True Line Result
+ if around
+** Processing line: ~ cx = around.x~
+- Inside source: true
+*** True Line Result
+ cx = around.x
+** Processing line: ~ cy = around.y~
+- Inside source: true
+*** True Line Result
+ cy = around.y
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ point.merge(x: ((px - cx) * c - (py - cy) * s) + cx,~
+- Inside source: true
+*** True Line Result
+ point.merge(x: ((px - cx) * c - (py - cy) * s) + cx,
+** Processing line: ~ y: ((px - cx) * s + (py - cy) * c) + cy)~
+- Inside source: true
+*** True Line Result
+ y: ((px - cx) * s + (py - cy) * c) + cy)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ # Returns f(t) for a cubic Bezier curve.~
- Inside source: true
*** True Line Result
@@ -152071,10 +159246,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
* ERROR:
-** Processing line: ~ center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~
+** Processing line: ~ center_inside_rect for self #{self} and other_rect #{other_rect}.\n#{e}.~
- Inside source: true
*** True Line Result
- center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+ center_inside_rect for self #{self} and other_rect #{other_rect}.\n#{e}.
** Processing line: ~ S~
- Inside source: true
*** True Line Result
@@ -152139,10 +159314,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
* ERROR:
-** Processing line: ~ center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~
+** Processing line: ~ center_inside_rect_x for self #{self} and other_rect #{other_rect}.\n#{e}.~
- Inside source: true
*** True Line Result
- center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+ center_inside_rect_x for self #{self} and other_rect #{other_rect}.\n#{e}.
** Processing line: ~ S~
- Inside source: true
*** True Line Result
@@ -152207,10 +159382,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
* ERROR:
-** Processing line: ~ center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~
+** Processing line: ~ center_inside_rect_y for self #{self} and other_rect #{other_rect}.\n#{e}.~
- Inside source: true
*** True Line Result
- center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.
+ center_inside_rect_y for self #{self} and other_rect #{other_rect}.\n#{e}.
** Processing line: ~ S~
- Inside source: true
*** True Line Result
@@ -152243,10 +159418,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # Returns a primitive that is anchored/repositioned based off its retangle.~
+** Processing line: ~ # Returns a primitive that is anchored/repositioned based off its rectangle.~
- Inside source: true
*** True Line Result
- # Returns a primitive that is anchored/repositioned based off its retangle.
+ # Returns a primitive that is anchored/repositioned based off its rectangle.
** Processing line: ~ # @gtk~
- Inside source: true
*** True Line Result
@@ -152787,22 +159962,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def self.intersect_rect? rect_one, rect_two, tolerance = 0.1
-** Processing line: ~ return false if rect_one.right - tolerance < rect_two.left + tolerance~
+** Processing line: ~ return false if ((rect_one.x + rect_one.w) - tolerance) < (rect_two.x + tolerance)~
- Inside source: true
*** True Line Result
- return false if rect_one.right - tolerance < rect_two.left + tolerance
-** Processing line: ~ return false if rect_one.left + tolerance > rect_two.right - tolerance~
+ return false if ((rect_one.x + rect_one.w) - tolerance) < (rect_two.x + tolerance)
+** Processing line: ~ return false if (rect_one.x + tolerance) > ((rect_two.x + rect_two.w) - tolerance)~
- Inside source: true
*** True Line Result
- return false if rect_one.left + tolerance > rect_two.right - tolerance
-** Processing line: ~ return false if rect_one.top - tolerance < rect_two.bottom + tolerance~
+ return false if (rect_one.x + tolerance) > ((rect_two.x + rect_two.w) - tolerance)
+** Processing line: ~ return false if ((rect_one.y + rect_one.h) - tolerance) < (rect_two.y + tolerance)~
- Inside source: true
*** True Line Result
- return false if rect_one.top - tolerance < rect_two.bottom + tolerance
-** Processing line: ~ return false if rect_one.bottom + tolerance > rect_two.top - tolerance~
+ return false if ((rect_one.y + rect_one.h) - tolerance) < (rect_two.y + tolerance)
+** Processing line: ~ return false if (rect_one.y + tolerance) > ((rect_two.y + rect_two.h) - tolerance)~
- Inside source: true
*** True Line Result
- return false if rect_one.bottom + tolerance > rect_two.top - tolerance
+ return false if (rect_one.y + tolerance) > ((rect_two.y + rect_two.h) - tolerance)
** Processing line: ~ return true~
- Inside source: true
*** True Line Result
@@ -152911,6 +160086,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
#{context_help}
+** Processing line: ~ \n#{e}~
+- Inside source: true
+*** True Line Result
+ \n#{e}
** Processing line: ~ S~
- Inside source: true
*** True Line Result
@@ -152951,10 +160130,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}."~
+** Processing line: ~ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}."
+ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -152979,10 +160158,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."~
+** Processing line: ~ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."
+ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -153015,10 +160194,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}."~
+** Processing line: ~ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}."
+ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -153043,10 +160222,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}."~
+** Processing line: ~ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}."
+ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -153071,10 +160250,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}"~
+** Processing line: ~ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}"
+ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -153091,30 +160270,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0
+** Processing line: ~ return nil if !inner_rect~
+- Inside source: true
+*** True Line Result
+ return nil if !inner_rect
+** Processing line: ~ return nil if !outer_rect~
+- Inside source: true
+*** True Line Result
+ return nil if !outer_rect
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ inner_rect.x + tolerance >= outer_rect.x - tolerance &&~
- Inside source: true
*** True Line Result
inner_rect.x + tolerance >= outer_rect.x - tolerance &&
-** Processing line: ~ inner_rect.right - tolerance <= outer_rect.right + tolerance &&~
+** Processing line: ~ (inner_rect.x + inner_rect.w) - tolerance <= (outer_rect.x + outer_rect.w) + tolerance &&~
- Inside source: true
*** True Line Result
- inner_rect.right - tolerance <= outer_rect.right + tolerance &&
+ (inner_rect.x + inner_rect.w) - tolerance <= (outer_rect.x + outer_rect.w) + tolerance &&
** Processing line: ~ inner_rect.y + tolerance >= outer_rect.y - tolerance &&~
- Inside source: true
*** True Line Result
inner_rect.y + tolerance >= outer_rect.y - tolerance &&
-** Processing line: ~ inner_rect.top - tolerance <= outer_rect.top + tolerance~
+** Processing line: ~ (inner_rect.y + inner_rect.h) - tolerance <= (outer_rect.y + outer_rect.h) + tolerance~
- Inside source: true
*** True Line Result
- inner_rect.top - tolerance <= outer_rect.top + tolerance
+ (inner_rect.y + inner_rect.h) - tolerance <= (outer_rect.y + outer_rect.h) + tolerance
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."~
+** Processing line: ~ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."
+ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -153251,10 +160442,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}."~
+** Processing line: ~ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}."
+ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -153307,10 +160498,66 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
rescue Exception => e
-** Processing line: ~ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]."~
+** Processing line: ~ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)].\n#{e}"~
- Inside source: true
*** True Line Result
- raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]."
+ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)].\n#{e}"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def self.rect_to_line rect~
+- Inside source: true
+*** True Line Result
+ def self.rect_to_line rect
+** Processing line: ~ l = rect.to_hash.line~
+- Inside source: true
+*** True Line Result
+ l = rect.to_hash.line
+** Processing line: ~ l.merge(x2: l.x + l.w - 1,~
+- Inside source: true
+*** True Line Result
+ l.merge(x2: l.x + l.w - 1,
+** Processing line: ~ y2: l.y + l.h)~
+- Inside source: true
+*** True Line Result
+ y2: l.y + l.h)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def self.rect_center_point rect~
+- Inside source: true
+*** True Line Result
+ def self.rect_center_point rect
+** Processing line: ~ { x: rect.x + rect.w.half, y: rect.y + rect.h.half }~
+- Inside source: true
+*** True Line Result
+ { x: rect.x + rect.w.half, y: rect.y + rect.h.half }
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def rect_center_point~
+- Inside source: true
+*** True Line Result
+ def rect_center_point
+** Processing line: ~ Geometry.rect_center_point self~
+- Inside source: true
+*** True Line Result
+ Geometry.rect_center_point self
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -154099,6 +161346,38 @@ 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: ~ def x~
+- Inside source: true
+*** True Line Result
+ def x
+** Processing line: ~ 0~
+- Inside source: true
+*** True Line Result
+ 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def y~
+- Inside source: true
+*** True Line Result
+ def y
+** Processing line: ~ 0~
+- Inside source: true
+*** True Line Result
+ 0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -154907,6 +162186,102 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def self.method_to_key_hash~
+- Inside source: true
+*** True Line Result
+ def self.method_to_key_hash
+** Processing line: ~ return @method_to_key_hash if @method_to_key_hash~
+- Inside source: true
+*** True Line Result
+ return @method_to_key_hash if @method_to_key_hash
+** Processing line: ~ @method_to_key_hash = {}~
+- Inside source: true
+*** True Line Result
+ @method_to_key_hash = {}
+** Processing line: ~ string_representation_overrides ||= {~
+- Inside source: true
+*** True Line Result
+ string_representation_overrides ||= {
+** Processing line: ~ backspace: '\b'~
+- Inside source: true
+*** True Line Result
+ backspace: '\b'
+** Processing line: ~ }~
+- Inside source: true
+*** True Line Result
+ }
+** Processing line: ~ char_to_method_hash.each do |k, v|~
+- Inside source: true
+*** True Line Result
+ char_to_method_hash.each do |k, v|
+** Processing line: ~ v.each do |vi|~
+- Inside source: true
+*** True Line Result
+ v.each do |vi|
+** Processing line: ~ t = { char_or_raw_key: k }~
+- Inside source: true
+*** True Line Result
+ t = { char_or_raw_key: k }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if k.is_a? Numeric~
+- Inside source: true
+*** True Line Result
+ if k.is_a? Numeric
+** Processing line: ~ t[:raw_key] = k~
+- Inside source: true
+*** True Line Result
+ t[:raw_key] = k
+** Processing line: ~ t[:string_representation] = "raw_key == #{k}"~
+- Inside source: true
+*** True Line Result
+ t[:string_representation] = "raw_key == #{k}"
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ t[:char] = k~
+- Inside source: true
+*** True Line Result
+ t[:char] = k
+** Processing line: ~ t[:string_representation] = "\"#{k.strip}\""~
+- Inside source: true
+*** True Line Result
+ t[:string_representation] = "\"#{k.strip}\""
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ @method_to_key_hash[vi] = t~
+- Inside source: true
+*** True Line Result
+ @method_to_key_hash[vi] = t
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ @method_to_key_hash~
+- Inside source: true
+*** True Line Result
+ @method_to_key_hash
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def self.char_to_method char, int = nil~
- Inside source: true
*** True Line Result
@@ -155363,46 +162738,54 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def method_missing m, *args
-** Processing line: ~ begin~
+** Processing line: ~ if KeyboardKeys.method_to_key_hash[m.without_ending_bang]~
- Inside source: true
*** True Line Result
- begin
-** Processing line: ~ define_singleton_method(m) do~
+ if KeyboardKeys.method_to_key_hash[m.without_ending_bang]
+** Processing line: ~ begin~
- Inside source: true
*** True Line Result
- define_singleton_method(m) do
-** Processing line: ~ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~
+ begin
+** Processing line: ~ define_singleton_method(m) do~
- Inside source: true
*** True Line Result
- r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)
-** Processing line: ~ clear_key m~
+ define_singleton_method(m) do
+** Processing line: ~ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~
- Inside source: true
*** True Line Result
- clear_key m
-** Processing line: ~ return r~
+ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)
+** Processing line: ~ clear_key m~
- Inside source: true
*** True Line Result
- return r
-** Processing line: ~ end~
+ clear_key m
+** Processing line: ~ return r~
- Inside source: true
*** True Line Result
- end
+ return r
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ return self.send m~
+** Processing line: ~ return self.send m~
- Inside source: true
*** True Line Result
- return self.send m
-** Processing line: ~ rescue Exception => e~
+ return self.send m
+** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
- rescue Exception => e
-** Processing line: ~ log_important "#{e}"~
+ rescue Exception => e
+** Processing line: ~ log_important "#{e}"~
+- Inside source: true
+*** True Line Result
+ log_important "#{e}"
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- log_important "#{e}"
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -155411,6 +162794,30 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ did_you_mean = KeyboardKeys.method_to_key_hash.find_all do |k, v|~
+- Inside source: true
+*** True Line Result
+ did_you_mean = KeyboardKeys.method_to_key_hash.find_all do |k, v|
+** Processing line: ~ k.to_s[0..1] == m.to_s[0..1]~
+- Inside source: true
+*** True Line Result
+ k.to_s[0..1] == m.to_s[0..1]
+** Processing line: ~ end.map {|k, v| ":#{k} (#{v[:string_representation]})" }~
+- Inside source: true
+*** True Line Result
+ end.map {|k, v| ":#{k} (#{v[:string_representation]})" }
+** Processing line: ~ did_you_mean_string = ""~
+- Inside source: true
+*** True Line Result
+ did_you_mean_string = ""
+** Processing line: ~ did_you_mean_string = ". Did you mean #{did_you_mean.join ", "}?"~
+- Inside source: true
+*** True Line Result
+ did_you_mean_string = ". Did you mean #{did_you_mean.join ", "}?"
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ raise <<-S~
- Inside source: true
*** True Line Result
@@ -155419,22 +162826,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
* ERROR:
-** Processing line: ~ There is no member on the keyboard called #{m}. Here is a to_s representation of what's available:~
+** Processing line: ~ #{KeyboardKeys.method_to_key_hash.map { |k, v| "** :#{k} #{v.string_representation}" }.join("\n")}~
- Inside source: true
*** True Line Result
- There is no member on the keyboard called #{m}. Here is a to_s representation of what's available:
+ #{KeyboardKeys.method_to_key_hash.map { |k, v| "** :#{k} #{v.string_representation}" }.join("\n")}
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}~
+** Processing line: ~ There is no key on the keyboard called :#{m}#{did_you_mean_string}.~
- Inside source: true
*** True Line Result
- #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}
-** Processing line: ~~
+ There is no key on the keyboard called :#{m}#{did_you_mean_string}.
+** Processing line: ~ Full list of available keys =:points_up:=.~
- Inside source: true
*** True Line Result
-
+ Full list of available keys =:points_up:=.
** Processing line: ~ S~
- Inside source: true
*** True Line Result
@@ -156967,6 +164374,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def directional_angle~
+- Inside source: true
+*** True Line Result
+ def directional_angle
+** Processing line: ~ keyboard.directional_angle || (controller_one && controller_one.directional_angle)~
+- Inside source: true
+*** True Line Result
+ keyboard.directional_angle || (controller_one && controller_one.directional_angle)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ # Returns a signal indicating right (`1`), left (`-1`), or neither ('0').~
- Inside source: true
*** True Line Result
@@ -157255,6 +164678,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# ./dragon/ios_wizard.rb
+** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński~
+- Inside source: true
+*** True Line Result
+ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński
** Processing line: ~ # Copyright 2019 DragonRuby LLC~
- Inside source: true
*** True Line Result
@@ -157271,42 +164698,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ class WizardException < Exception~
-- Inside source: true
-*** True Line Result
- class WizardException < Exception
-** Processing line: ~ attr_accessor :console_primitives~
+** Processing line: ~ class IOSWizard < Wizard~
- Inside source: true
*** True Line Result
- attr_accessor :console_primitives
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ def initialize *console_primitives~
-- Inside source: true
-*** True Line Result
- def initialize *console_primitives
-** Processing line: ~ @console_primitives = console_primitives~
-- Inside source: true
-*** True Line Result
- @console_primitives = console_primitives
-** 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: ~ class IOSWizard~
-- Inside source: true
-*** True Line Result
- class IOSWizard
+ class IOSWizard < Wizard
** Processing line: ~ def initialize~
- Inside source: true
*** True Line Result
@@ -157355,10 +164750,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def steps_development_build~
+** Processing line: ~ def prerequisite_steps~
- Inside source: true
*** True Line Result
- def steps_development_build
+ def prerequisite_steps
** Processing line: ~ [~
- Inside source: true
*** True Line Result
@@ -157375,14 +164770,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:check_for_certs,
-** Processing line: ~ :check_for_device,~
+** Processing line: ~ ]~
- Inside source: true
*** True Line Result
- :check_for_device,
-** Processing line: ~ :check_for_dev_profile,~
+ ]
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- :check_for_dev_profile,
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def app_metadata_retrieval_steps~
+- Inside source: true
+*** True Line Result
+ def app_metadata_retrieval_steps
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
** Processing line: ~ :determine_team_identifier,~
- Inside source: true
*** True Line Result
@@ -157395,18 +164802,74 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:determine_app_id,
-** Processing line: ~ :blow_away_temp,~
+** 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 steps_development_build~
+- Inside source: true
+*** True Line Result
+ def steps_development_build
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ *prerequisite_steps,~
+- Inside source: true
+*** True Line Result
+ *prerequisite_steps,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ :check_for_device,~
+- Inside source: true
+*** True Line Result
+ :check_for_device,
+** Processing line: ~ :check_for_dev_profile,~
+- Inside source: true
+*** True Line Result
+ :check_for_dev_profile,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ *app_metadata_retrieval_steps,~
+- Inside source: true
+*** True Line Result
+ *app_metadata_retrieval_steps,
+** Processing line: ~~
- Inside source: true
*** True Line Result
- :blow_away_temp,
+
+** Processing line: ~ :clear_tmp_directory,~
+- Inside source: true
+*** True Line Result
+ :clear_tmp_directory,
** Processing line: ~ :stage_app,~
- Inside source: true
*** True Line Result
:stage_app,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :development_write_info_plist,~
- Inside source: true
*** True Line Result
:development_write_info_plist,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :write_entitlements_plist,~
- Inside source: true
*** True Line Result
@@ -157415,14 +164878,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:compile_icons,
-** Processing line: ~ :create_payload_directory,~
+** Processing line: ~ :clear_payload_directory,~
- Inside source: true
*** True Line Result
- :create_payload_directory,
+ :clear_payload_directory,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ :create_payload_directory_dev,~
+- Inside source: true
+*** True Line Result
+ :create_payload_directory_dev,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ :create_payload,~
+- Inside source: true
+*** True Line Result
+ :create_payload,
** Processing line: ~ :code_sign_payload,~
- Inside source: true
*** True Line Result
:code_sign_payload,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :create_ipa,~
- Inside source: true
*** True Line Result
@@ -157451,46 +164934,54 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
[
-** Processing line: ~ :check_for_xcode,~
+** Processing line: ~ *prerequisite_steps,~
- Inside source: true
*** True Line Result
- :check_for_xcode,
-** Processing line: ~ :check_for_brew,~
-- Inside source: true
-*** True Line Result
- :check_for_brew,
-** Processing line: ~ :check_for_certs,~
+ *prerequisite_steps,
+** Processing line: ~~
- Inside source: true
*** True Line Result
- :check_for_certs,
+
** Processing line: ~ :check_for_distribution_profile,~
- Inside source: true
*** True Line Result
:check_for_distribution_profile,
-** Processing line: ~ :determine_team_identifier,~
+** Processing line: ~ :determine_app_version,~
- Inside source: true
*** True Line Result
- :determine_team_identifier,
-** Processing line: ~ :determine_app_name,~
+ :determine_app_version,
+** Processing line: ~~
- Inside source: true
*** True Line Result
- :determine_app_name,
-** Processing line: ~ :determine_app_id,~
+
+** Processing line: ~ *app_metadata_retrieval_steps,~
- Inside source: true
*** True Line Result
- :determine_app_id,
-** Processing line: ~ :blow_away_temp,~
+ *app_metadata_retrieval_steps,
+** Processing line: ~~
- Inside source: true
*** True Line Result
- :blow_away_temp,
+
+** Processing line: ~ :clear_tmp_directory,~
+- Inside source: true
+*** True Line Result
+ :clear_tmp_directory,
** Processing line: ~ :stage_app,~
- Inside source: true
*** True Line Result
:stage_app,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :production_write_info_plist,~
- Inside source: true
*** True Line Result
:production_write_info_plist,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :write_entitlements_plist,~
- Inside source: true
*** True Line Result
@@ -157499,14 +164990,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
:compile_icons,
-** Processing line: ~ :create_payload_directory,~
+** Processing line: ~ :clear_payload_directory,~
+- Inside source: true
+*** True Line Result
+ :clear_payload_directory,
+** Processing line: ~~
- Inside source: true
*** True Line Result
- :create_payload_directory,
+
+** Processing line: ~ :create_payload_directory_prod,~
+- Inside source: true
+*** True Line Result
+ :create_payload_directory_prod,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ :create_payload,~
+- Inside source: true
+*** True Line Result
+ :create_payload,
** Processing line: ~ :code_sign_payload,~
- Inside source: true
*** True Line Result
:code_sign_payload,
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :create_ipa,~
- Inside source: true
*** True Line Result
@@ -157647,6 +165158,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@certificate_name = nil
+** Processing line: ~ @app_version = opts[:version]~
+- Inside source: true
+*** True Line Result
+ @app_version = opts[:version]
+** Processing line: ~ @app_version = "1.0" if @opts[:env] == :dev && !@app_version~
+- Inside source: true
+*** True Line Result
+ @app_version = "1.0" if @opts[:env] == :dev && !@app_version
** Processing line: ~ init_wizard_status~
- Inside source: true
*** True Line Result
@@ -157731,6 +165250,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log_error e.to_s
+** Processing line: ~ log e.__backtrace_to_org__~
+- Inside source: true
+*** True Line Result
+ log e.__backtrace_to_org__
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -157739,6 +165262,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ init_wizard_status~
+- Inside source: true
+*** True Line Result
+ init_wizard_status
** Processing line: ~ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}"~
- Inside source: true
*** True Line Result
@@ -158163,38 +165690,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 determine_team_identifier~
+** Processing line: ~ def ios_metadata_template~
- Inside source: true
*** True Line Result
- def determine_team_identifier
-** Processing line: ~ @team_name = (team_identifier_from_provisioning_profile @opts[:env])~
+ def ios_metadata_template
+** Processing line: ~ <<-S~
- Inside source: true
*** True Line Result
- @team_name = (team_identifier_from_provisioning_profile @opts[:env])
-** Processing line: ~ log_info "Team Identifer is: #{@team_name}"~
+ <<-S
+** 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
- log_info "Team Identifer is: #{@team_name}"
-** Processing line: ~ end~
+ # 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
- end
+ # 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: ~ def determine_app_name~
+** 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
- def determine_app_name
-** Processing line: ~ @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data]~
+ # 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
- @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data]
-** Processing line: ~ log_info "App name is: #{@app_name}."~
+ 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
- log_info "App name is: #{@app_name}."
+ # 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: ~ S~
+- Inside source: true
+*** True Line Result
+ S
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -158203,134 +165746,146 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def provisioning_profile_xml environment~
+** Processing line: ~ def ios_metadata~
- Inside source: true
*** True Line Result
- def provisioning_profile_xml environment
-** Processing line: ~ xml = $gtk.read_file (provisioning_profile_path environment)~
+ def ios_metadata
+** Processing line: ~ contents = $gtk.read_file 'metadata/ios_metadata.txt'~
- Inside source: true
*** True Line Result
- xml = $gtk.read_file (provisioning_profile_path environment)
-** Processing line: ~ scrubbed = xml.each_line.map do |l|~
+ contents = $gtk.read_file 'metadata/ios_metadata.txt'
+** Processing line: ~~
- Inside source: true
*** True Line Result
- scrubbed = xml.each_line.map do |l|
-** Processing line: ~ if l.strip.start_with? "<"~
+
+** Processing line: ~ if !contents~
- Inside source: true
*** True Line Result
- if l.strip.start_with? "<"
-** Processing line: ~ if l.start_with? '</plist>'~
+ if !contents
+** Processing line: ~ $gtk.write_file 'metadata/ios_metadata.txt', ios_metadata_template~
- Inside source: true
*** True Line Result
- if l.start_with? '</plist>'
-** Processing line: ~ '</plist>'~
+ $gtk.write_file 'metadata/ios_metadata.txt', ios_metadata_template
+** Processing line: ~ contents = $gtk.read_file 'metadata/ios_metadata.txt'~
- Inside source: true
*** True Line Result
- '</plist>'
-** Processing line: ~ elsif l.include? "Apple Inc."~
+ contents = $gtk.read_file 'metadata/ios_metadata.txt'
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- elsif l.include? "Apple Inc."
-** Processing line: ~ nil~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- nil
-** Processing line: ~ elsif l.include? '<data>'~
+
+** Processing line: ~ kvps = contents.each_line~
- Inside source: true
*** True Line Result
- elsif l.include? '<data>'
-** Processing line: ~ nil~
+ kvps = contents.each_line
+** Processing line: ~ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }~
- Inside source: true
*** True Line Result
- nil
-** Processing line: ~ else~
+ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }
+** Processing line: ~ .map do |l|~
- Inside source: true
*** True Line Result
- else
-** Processing line: ~ l~
+ .map do |l|
+** Processing line: ~ key, value = l.split("=")~
- Inside source: true
*** True Line Result
- l
-** Processing line: ~ end~
+ key, value = l.split("=")
+** Processing line: ~ [key.strip.to_sym, value.strip]~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~ else~
+ [key.strip.to_sym, value.strip]
+** Processing line: ~ end.flatten~
- Inside source: true
*** True Line Result
- else
-** Processing line: ~ nil~
+ end.flatten
+** Processing line: ~ Hash[*kvps]~
- Inside source: true
*** True Line Result
- nil
-** Processing line: ~ end~
+ Hash[*kvps]
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~ end.reject { |l| !l }.join~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- end.reject { |l| !l }.join
-** Processing line: ~ $gtk.parse_xml scrubbed~
+
+** Processing line: ~ def game_metadata~
- Inside source: true
*** True Line Result
- $gtk.parse_xml scrubbed
-** Processing line: ~ end~
+ def game_metadata
+** Processing line: ~ contents = $gtk.read_file 'metadata/game_metadata.txt'~
- Inside source: true
*** True Line Result
- end
+ contents = $gtk.read_file 'metadata/game_metadata.txt'
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ def app_id_from_provisioning_profile environment~
+** Processing line: ~ kvps = contents.each_line~
- Inside source: true
*** True Line Result
- def app_id_from_provisioning_profile environment
-** Processing line: ~ application_identifier_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]~
+ kvps = contents.each_line
+** Processing line: ~ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }~
- Inside source: true
*** True Line Result
- application_identifier_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]
-** Processing line: ~ (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|~
+ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }
+** Processing line: ~ .map do |l|~
- Inside source: true
*** True Line Result
- (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|
-** Processing line: ~ if node[:children] && node[:children][0] && node[:children][0][:data] == "application-identifier"~
+ .map do |l|
+** Processing line: ~ key, value = l.split("=")~
- Inside source: true
*** True Line Result
- if node[:children] && node[:children][0] && node[:children][0][:data] == "application-identifier"
-** Processing line: ~ application_identifier_index = i~
+ key, value = l.split("=")
+** Processing line: ~ [key.strip.to_sym, value.strip]~
- Inside source: true
*** True Line Result
- application_identifier_index = i
-** Processing line: ~ break~
+ [key.strip.to_sym, value.strip]
+** Processing line: ~ end.flatten~
- Inside source: true
*** True Line Result
- break
-** Processing line: ~ end~
+ end.flatten
+** Processing line: ~ Hash[*kvps]~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~ end~
+ Hash[*kvps]
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- end
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ app_id_with_team_identifier = (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][application_identifier_index + 1][:children].first[:data]~
+** Processing line: ~ def raise_ios_metadata_required~
+- Inside source: true
+*** True Line Result
+ def raise_ios_metadata_required
+** Processing line: ~ raise WizardException.new(~
+- Inside source: true
+*** True Line Result
+ raise WizardException.new(
+** Processing line: ~ "* mygame/metadata/ios_metadata.txt needs to be filled out.",~
- Inside source: true
*** True Line Result
- app_id_with_team_identifier = (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][application_identifier_index + 1][:children].first[:data]
-** Processing line: ~ team_identifer = team_identifier_from_provisioning_profile environment~
+ "* 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.",~
- Inside source: true
*** True Line Result
- team_identifer = team_identifier_from_provisioning_profile environment
-** Processing line: ~ app_id_with_team_identifier.gsub "#{team_identifer}.", ""~
+ "You need to update metadata/ios_metadata.txt with a valid teamid, appname, and appid.",
+** Processing line: ~ "Instructions for where the values should come from are within metadata/ios_metadata.txt."~
- Inside source: true
*** True Line Result
- app_id_with_team_identifier.gsub "#{team_identifer}.", ""
+ "Instructions for where the values should come from are within metadata/ios_metadata.txt."
+** Processing line: ~ )~
+- Inside source: true
+*** True Line Result
+ )
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -158339,50 +165894,126 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def team_identifier_from_provisioning_profile environment~
+** Processing line: ~ def determine_team_identifier~
- Inside source: true
*** True Line Result
- def team_identifier_from_provisioning_profile environment
-** Processing line: ~ team_identifer_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]~
+ def determine_team_identifier
+** Processing line: ~ @team_id = (ios_metadata.teamid || "")~
- Inside source: true
*** True Line Result
- team_identifer_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]
-** Processing line: ~~
+ @team_id = (ios_metadata.teamid || "")
+** Processing line: ~ raise_ios_metadata_required if @team_id.strip.length == 0~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|~
+ raise_ios_metadata_required if @team_id.strip.length == 0
+** Processing line: ~ log_info "Team Identifer is: #{@team_id}"~
- Inside source: true
*** True Line Result
- (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|
-** Processing line: ~ if node[:children] && node[:children][0] && node[:children][0][:data] == "com.apple.developer.team-identifier"~
+ log_info "Team Identifer is: #{@team_id}"
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- if node[:children] && node[:children][0] && node[:children][0][:data] == "com.apple.developer.team-identifier"
-** Processing line: ~ team_identifer_index = i~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- team_identifer_index = i
-** Processing line: ~ break~
+
+** Processing line: ~ def determine_app_name~
- Inside source: true
*** True Line Result
- break
-** Processing line: ~ end~
+ def determine_app_name
+** Processing line: ~ @app_name = (ios_metadata.appname || "")~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~ end~
+ @app_name = (ios_metadata.appname || "")
+** Processing line: ~ raise_ios_metadata_required if @app_name.strip.length == 0~
- Inside source: true
*** True Line Result
- end
+ raise_ios_metadata_required if @app_name.strip.length == 0
+** Processing line: ~ log_info "App name is: #{@app_name}."~
+- Inside source: true
+*** True Line Result
+ log_info "App name is: #{@app_name}."
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data]~
+** Processing line: ~ def provisioning_profile_xml environment~
+- Inside source: true
+*** True Line Result
+ def provisioning_profile_xml environment
+** Processing line: ~ xml = $gtk.read_file (provisioning_profile_path environment)~
+- Inside source: true
+*** True Line Result
+ xml = $gtk.read_file (provisioning_profile_path environment)
+** Processing line: ~ scrubbed = xml.each_line.map do |l|~
+- Inside source: true
+*** True Line Result
+ scrubbed = xml.each_line.map do |l|
+** Processing line: ~ if l.strip.start_with? "<"~
+- Inside source: true
+*** True Line Result
+ if l.strip.start_with? "<"
+** Processing line: ~ if l.start_with? '</plist>'~
+- Inside source: true
+*** True Line Result
+ if l.start_with? '</plist>'
+** Processing line: ~ '</plist>'~
+- Inside source: true
+*** True Line Result
+ '</plist>'
+** Processing line: ~ elsif l.include? "Apple Inc."~
+- Inside source: true
+*** True Line Result
+ elsif l.include? "Apple Inc."
+** Processing line: ~ nil~
+- Inside source: true
+*** True Line Result
+ nil
+** Processing line: ~ elsif l.include? '<data>'~
+- Inside source: true
+*** True Line Result
+ elsif l.include? '<data>'
+** Processing line: ~ nil~
+- Inside source: true
+*** True Line Result
+ nil
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ l~
+- Inside source: true
+*** True Line Result
+ l
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ nil~
- Inside source: true
*** True Line Result
- (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data]
+ nil
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ end.reject { |l| !l }.join~
+- Inside source: true
+*** True Line Result
+ end.reject { |l| !l }.join
+** Processing line: ~ $gtk.parse_xml scrubbed~
+- Inside source: true
+*** True Line Result
+ $gtk.parse_xml scrubbed
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -158395,14 +166026,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def determine_app_id
-** Processing line: ~ @app_id = app_id_from_provisioning_profile @opts[:env]~
+** Processing line: ~ @app_id = ios_metadata.appid~
- Inside source: true
*** True Line Result
- @app_id = app_id_from_provisioning_profile @opts[:env]
-** Processing line: ~~
+ @app_id = ios_metadata.appid
+** Processing line: ~ raise_ios_metadata_required if @app_id.strip.length == 0~
- 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}"~
- Inside source: true
*** True Line Result
@@ -158475,10 +166106,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def blow_away_temp~
+** Processing line: ~ def clear_tmp_directory~
- Inside source: true
*** True Line Result
- def blow_away_temp
+ def clear_tmp_directory
** Processing line: ~ sh "rm -rf #{tmp_directory}"~
- Inside source: true
*** True Line Result
@@ -159039,10 +166670,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip~
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip~
+- Inside source: true
+*** True Line Result
+ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.txt", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip~
- Inside source: true
*** True Line Result
- $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip
+ $gtk.write_file_root "tmp/ios/Entitlements.txt", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -159191,10 +166826,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleInfoDictionaryVersion</key>
-** Processing line: ~ <string>6.0</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>6.0</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundlePackageType</key>~
- Inside source: true
*** True Line Result
@@ -159207,10 +166842,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleShortVersionString</key>
-** Processing line: ~ <string>5.6</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>5.6</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundleSignature</key>~
- Inside source: true
*** True Line Result
@@ -159223,10 +166858,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleVersion</key>
-** Processing line: ~ <string>5.6</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>5.6</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundleIcons</key>~
- Inside source: true
*** True Line Result
@@ -159819,10 +167454,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleInfoDictionaryVersion</key>
-** Processing line: ~ <string>6.0</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>6.0</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundleName</key>~
- Inside source: true
*** True Line Result
@@ -159843,10 +167478,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleShortVersionString</key>
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>5.2</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundleSignature</key>~
- Inside source: true
*** True Line Result
@@ -159875,10 +167510,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleVersion</key>
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>5.2</string>
+ <string>:app_version</string>
** Processing line: ~ <key>DTCompiler</key>~
- Inside source: true
*** True Line Result
@@ -160219,6 +167854,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
$gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip~
+- Inside source: true
+*** True Line Result
+ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -160431,10 +168070,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleInfoDictionaryVersion</key>
-** Processing line: ~ <string>6.0</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>6.0</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundleName</key>~
- Inside source: true
*** True Line Result
@@ -160455,10 +168094,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleShortVersionString</key>
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>5.2</string>
+ <string>:app_version</string>
** Processing line: ~ <key>CFBundleSignature</key>~
- Inside source: true
*** True Line Result
@@ -160487,10 +168126,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
<key>CFBundleVersion</key>
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
- Inside source: true
*** True Line Result
- <string>5.2</string>
+ <string>:app_version</string>
** Processing line: ~ <key>DTCompiler</key>~
- Inside source: true
*** True Line Result
@@ -160823,6 +168462,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
info_plist_string.gsub!(":app_id", @app_id)
+** Processing line: ~ info_plist_string.gsub!(":app_version", @app_version)~
+- Inside source: true
+*** True Line Result
+ info_plist_string.gsub!(":app_version", @app_version)
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -160831,6 +168474,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
$gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip~
+- Inside source: true
+*** True Line Result
+ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -160915,14 +168562,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 write_ip_address~
+** Processing line: ~ def embed_mobileprovision~
- Inside source: true
*** True Line Result
- def write_ip_address
-** Processing line: ~ $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip~
+ def embed_mobileprovision
+** Processing line: ~ sh %Q[cp #{@provisioning_profile_path} "#{app_path}/embedded.mobileprovision"]~
- Inside source: true
*** True Line Result
- $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip
+ sh %Q[cp #{@provisioning_profile_path} "#{app_path}/embedded.mobileprovision"]
+** Processing line: ~ sh %Q[/usr/bin/plutil -convert binary1 "#{app_path}/Info.plist"]~
+- Inside source: true
+*** True Line Result
+ sh %Q[/usr/bin/plutil -convert binary1 "#{app_path}/Info.plist"]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -160931,78 +168582,174 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def create_payload_directory~
+** Processing line: ~ def clear_payload_directory~
- Inside source: true
*** True Line Result
- def create_payload_directory
-** Processing line: ~ sh "cp #{@provisioning_profile_path} \"#{app_path}/embedded.mobileprovision\""~
+ def clear_payload_directory
+** Processing line: ~ sh %Q[rm "#{@app_name}".ipa]~
- Inside source: true
*** True Line Result
- sh "cp #{@provisioning_profile_path} \"#{app_path}/embedded.mobileprovision\""
-** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""~
+ sh %Q[rm "#{@app_name}".ipa]
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/app"]~
- Inside source: true
*** True Line Result
- sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""
-** Processing line: ~ write_ip_address~
+ sh %Q[rm -rf "#{app_path}/app"]
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/sounds"]~
- Inside source: true
*** True Line Result
- write_ip_address
-** Processing line: ~ sh "rm \"#{@app_name}\".ipa"~
+ sh %Q[rm -rf "#{app_path}/sounds"]
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/sprites"]~
- Inside source: true
*** True Line Result
- sh "rm \"#{@app_name}\".ipa"
-** Processing line: ~ sh "rm -rf \"#{app_path}/app\""~
+ sh %Q[rm -rf "#{app_path}/sprites"]
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/data"]~
- Inside source: true
*** True Line Result
- sh "rm -rf \"#{app_path}/app\""
-** Processing line: ~ sh "rm -rf \"#{app_path}/sounds\""~
+ sh %Q[rm -rf "#{app_path}/data"]
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/fonts"]~
- Inside source: true
*** True Line Result
- sh "rm -rf \"#{app_path}/sounds\""
-** Processing line: ~ sh "rm -rf \"#{app_path}/sprites\""~
+ sh %Q[rm -rf "#{app_path}/fonts"]
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- sh "rm -rf \"#{app_path}/sprites\""
-** Processing line: ~ sh "rm -rf \"#{app_path}/data\""~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- sh "rm -rf \"#{app_path}/data\""
-** Processing line: ~ sh "rm -rf \"#{app_path}/fonts\""~
+
+** Processing line: ~ def stage_app~
- Inside source: true
*** True Line Result
- sh "rm -rf \"#{app_path}/fonts\""
-** Processing line: ~ sh "cp -r \"#{root_folder}/app/\" \"#{app_path}/app/\""~
+ def stage_app
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/app/" "#{app_path}/app/"]~
- Inside source: true
*** True Line Result
- sh "cp -r \"#{root_folder}/app/\" \"#{app_path}/app/\""
-** Processing line: ~ sh "cp -r \"#{root_folder}/sounds/\" \"#{app_path}/sounds/\""~
+ sh %Q[cp -r "#{root_folder}/app/" "#{app_path}/app/"]
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/sounds/" "#{app_path}/sounds/"]~
- Inside source: true
*** True Line Result
- sh "cp -r \"#{root_folder}/sounds/\" \"#{app_path}/sounds/\""
-** Processing line: ~ sh "cp -r \"#{root_folder}/sprites/\" \"#{app_path}/sprites/\""~
+ sh %Q[cp -r "#{root_folder}/sounds/" "#{app_path}/sounds/"]
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/sprites/" "#{app_path}/sprites/"]~
- Inside source: true
*** True Line Result
- sh "cp -r \"#{root_folder}/sprites/\" \"#{app_path}/sprites/\""
-** Processing line: ~ sh "cp -r \"#{root_folder}/data/\" \"#{app_path}/data/\""~
+ sh %Q[cp -r "#{root_folder}/sprites/" "#{app_path}/sprites/"]
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/data/" "#{app_path}/data/"]~
- Inside source: true
*** True Line Result
- sh "cp -r \"#{root_folder}/data/\" \"#{app_path}/data/\""
-** Processing line: ~ sh "cp -r \"#{root_folder}/fonts/\" \"#{app_path}/fonts/\""~
+ sh %Q[cp -r "#{root_folder}/data/" "#{app_path}/data/"]
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/fonts/" "#{app_path}/fonts/"]~
- Inside source: true
*** True Line Result
- sh "cp -r \"#{root_folder}/fonts/\" \"#{app_path}/fonts/\""
-** Processing line: ~ sh "mkdir -p #{tmp_directory}/ipa_root/Payload"~
+ sh %Q[cp -r "#{root_folder}/fonts/" "#{app_path}/fonts/"]
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- sh "mkdir -p #{tmp_directory}/ipa_root/Payload"
-** Processing line: ~ sh "cp -r \"#{app_path}\" \"#{tmp_directory}/ipa_root/Payload\""~
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def create_payload~
+- Inside source: true
+*** True Line Result
+ def create_payload
+** Processing line: ~ sh %Q[mkdir -p #{tmp_directory}/ipa_root/Payload]~
+- Inside source: true
+*** True Line Result
+ sh %Q[mkdir -p #{tmp_directory}/ipa_root/Payload]
+** Processing line: ~ sh %Q[cp -r "#{app_path}" "#{tmp_directory}/ipa_root/Payload"]~
- Inside source: true
*** True Line Result
- sh "cp -r \"#{app_path}\" \"#{tmp_directory}/ipa_root/Payload\""
-** Processing line: ~ sh "chmod -R 755 \"#{tmp_directory}/ipa_root/Payload\""~
+ sh %Q[cp -r "#{app_path}" "#{tmp_directory}/ipa_root/Payload"]
+** Processing line: ~ sh %Q[chmod -R 755 "#{tmp_directory}/ipa_root/Payload"]~
- Inside source: true
*** True Line Result
- sh "chmod -R 755 \"#{tmp_directory}/ipa_root/Payload\""
+ sh %Q[chmod -R 755 "#{tmp_directory}/ipa_root/Payload"]
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def create_payload_directory_dev~
+- Inside source: true
+*** True Line Result
+ def create_payload_directory_dev
+** Processing line: ~ # write dev machine's ip address for hotloading~
+- Inside source: true
+*** True Line Result
+ # write dev machine's ip address for hotloading
+** Processing line: ~ $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip~
+- Inside source: true
+*** True Line Result
+ $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ embed_mobileprovision~
+- Inside source: true
+*** True Line Result
+ embed_mobileprovision
+** Processing line: ~ clear_payload_directory~
+- Inside source: true
+*** True Line Result
+ clear_payload_directory
+** Processing line: ~ stage_app~
+- Inside source: true
+*** True Line Result
+ stage_app
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def create_payload_directory_prod~
+- Inside source: true
+*** True Line Result
+ def create_payload_directory_prod
+** Processing line: ~ # production builds does not hotload ip address~
+- Inside source: true
+*** True Line Result
+ # production builds does not hotload ip address
+** Processing line: ~ sh %Q[rm "#{root_folder}/app/server_ip_address.txt"]~
+- Inside source: true
+*** True Line Result
+ sh %Q[rm "#{root_folder}/app/server_ip_address.txt"]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ embed_mobileprovision~
+- Inside source: true
+*** True Line Result
+ embed_mobileprovision
+** Processing line: ~ stage_app~
+- Inside source: true
+*** True Line Result
+ stage_app
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # production build marker~
+- Inside source: true
+*** True Line Result
+ # production build marker
+** Processing line: ~ sh %Q[mkdir -p "#{app_path}/metadata/"]~
+- Inside source: true
+*** True Line Result
+ sh %Q[mkdir -p "#{app_path}/metadata/"]
+** Processing line: ~ sh %Q[touch metadata/DRAGONRUBY_PRODUCTION_BUILD]~
+- Inside source: true
+*** True Line Result
+ sh %Q[touch metadata/DRAGONRUBY_PRODUCTION_BUILD]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -161131,22 +168878,70 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def print_publish_help
-** Processing line: ~ log_info "Go to https://appstoreconnect.apple.com/apps and create an App if you haven't already done so."~
+** Processing line: ~ has_transporter = (sh "ls /Applications/Transporter.app").include? "Contents"~
+- Inside source: true
+*** True Line Result
+ has_transporter = (sh "ls /Applications/Transporter.app").include? "Contents"
+** Processing line: ~ if !has_transporter~
+- Inside source: true
+*** True Line Result
+ if !has_transporter
+** Processing line: ~ $gtk.openurl "https://apps.apple.com/us/app/transporter/id1450874784?mt=12"~
- Inside source: true
*** True Line Result
- log_info "Go to https://appstoreconnect.apple.com/apps and create an App if you haven't already done so."
-** Processing line: ~ log_info "Go to https://appleid.apple.com and create a 'Application Specific Password'."~
+ $gtk.openurl "https://apps.apple.com/us/app/transporter/id1450874784?mt=12"
+** Processing line: ~ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}, version: \"#{@opts[:version]}\""~
- Inside source: true
*** True Line Result
- log_info "Go to https://appleid.apple.com and create a 'Application Specific Password'."
-** Processing line: ~ log_info "To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."~
+ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}, version: \"#{@opts[:version]}\""
+** Processing line: ~ raise WizardException.new(~
+- Inside source: true
+*** True Line Result
+ raise WizardException.new(
+** Processing line: ~ "* To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."~
- Inside source: true
*** True Line Result
- log_info "To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."
-** Processing line: ~ log_info "Your app is located at ./tmp/ios/#{@app_name}.ipa"~
+ "* To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."
+** Processing line: ~ )~
+- Inside source: true
+*** True Line Result
+ )
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ sh "mkdir ./tmp/ios/intermediary_artifacts"~
- Inside source: true
*** True Line Result
- log_info "Your app is located at ./tmp/ios/#{@app_name}.ipa"
+ sh "mkdir ./tmp/ios/intermediary_artifacts"
+** Processing line: ~ sh "mv \"#{tmp_directory}/#{@app_name}.app\" #{tmp_directory}/intermediary_artifacts/"~
+- Inside source: true
+*** True Line Result
+ sh "mv \"#{tmp_directory}/#{@app_name}.app\" #{tmp_directory}/intermediary_artifacts/"
+** Processing line: ~ sh "mv \"#{tmp_directory}/do_zip.sh\" #{tmp_directory}/intermediary_artifacts"~
+- Inside source: true
+*** True Line Result
+ sh "mv \"#{tmp_directory}/do_zip.sh\" #{tmp_directory}/intermediary_artifacts"
+** Processing line: ~ sh "mv \"#{tmp_directory}/Entitlements.plist\" #{tmp_directory}/intermediary_artifacts"~
+- Inside source: true
+*** True Line Result
+ sh "mv \"#{tmp_directory}/Entitlements.plist\" #{tmp_directory}/intermediary_artifacts"
+** Processing line: ~ sh "mv \"#{tmp_directory}/ipa_root\" #{tmp_directory}/intermediary_artifacts/"~
+- Inside source: true
+*** True Line Result
+ sh "mv \"#{tmp_directory}/ipa_root\" #{tmp_directory}/intermediary_artifacts/"
+** Processing line: ~ sh "open /Applications/Transporter.app"~
+- Inside source: true
+*** True Line Result
+ sh "open /Applications/Transporter.app"
+** Processing line: ~ sh "open ./tmp/ios/"~
+- Inside source: true
+*** True Line Result
+ sh "open ./tmp/ios/"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -161227,78 +169022,62 @@ Follows is a source code listing for all files that have been open sourced. This
- 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: ~*** itch_wizard.rb~
-- Header detected.
-*** True Line Result
-
-*** True Line Result
-*** itch_wizard.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/itch_wizard.rb~
+** Processing line: ~ def set_version version~
- Inside source: true
*** True Line Result
- # ./dragon/itch_wizard.rb
-** Processing line: ~ # Copyright 2019 DragonRuby LLC~
+ def set_version version
+** Processing line: ~ @app_version = version~
- Inside source: true
*** True Line Result
- # Copyright 2019 DragonRuby LLC
-** Processing line: ~ # MIT License~
+ @app_version = version
+** Processing line: ~ start env: @opts[:env], version: version~
- Inside source: true
*** True Line Result
- # MIT License
-** Processing line: ~ # itch_wizard.rb has been released under MIT (*only this file*).~
+ start env: @opts[:env], version: version
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- # itch_wizard.rb has been released under MIT (*only this file*).
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ class ItchWizard~
+** Processing line: ~ def app_version~
- Inside source: true
*** True Line Result
- class ItchWizard
-** Processing line: ~ def steps~
+ def app_version
+** Processing line: ~ log_info "Attempting to retrieve App Version from metadata/ios_metadata.txt."~
- Inside source: true
*** True Line Result
- def steps
-** Processing line: ~ [~
+ log_info "Attempting to retrieve App Version from metadata/ios_metadata.txt."
+** Processing line: ~ ios_version_number = (ios_metadata.version || "").strip~
- Inside source: true
*** True Line Result
- [
-** Processing line: ~ :check_metadata,~
+ ios_version_number = (ios_metadata.version || "").strip
+** Processing line: ~ if ios_version_number.length == 0~
- Inside source: true
*** True Line Result
- :check_metadata,
-** Processing line: ~ :deploy~
+ if ios_version_number.length == 0
+** Processing line: ~ log_info "Not found. Attempting to retrieve App Version from metadata/game_metadata.txt."~
- Inside source: true
*** True Line Result
- :deploy
-** Processing line: ~ ]~
+ log_info "Not found. Attempting to retrieve App Version from metadata/game_metadata.txt."
+** Processing line: ~ ios_version_number = (game_metadata.version || "").strip~
- Inside source: true
*** True Line Result
- ]
+ ios_version_number = (game_metadata.version || "").strip
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ ios_version_number~
+- Inside source: true
+*** True Line Result
+ ios_version_number
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -161307,94 +169086,94 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def metadata_file_path~
+** Processing line: ~ def determine_app_version~
- Inside source: true
*** True Line Result
- def metadata_file_path
-** Processing line: ~ "metadata/game_metadata.txt"~
+ def determine_app_version
+** Processing line: ~ @app_version = app_version~
- Inside source: true
*** True Line Result
- "metadata/game_metadata.txt"
+ @app_version = app_version
+** Processing line: ~ return if @app_version~
+- Inside source: true
+*** True Line Result
+ return if @app_version
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
-** Processing line: ~~
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ def get_metadata~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- def get_metadata
-** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
-- Inside source: true
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
*** True Line Result
- metadata = $gtk.read_file metadata_file_path
+#+end_src
** Processing line: ~~
-- Inside source: true
+- End of paragraph detected.
*** True Line Result
-** Processing line: ~ if !metadata~
-- Inside source: true
+** Processing line: ~*** itch_wizard.rb~
+- Header detected.
*** True Line Result
- if !metadata
-** Processing line: ~ write_blank_metadata~
-- Inside source: true
+
*** True Line Result
- write_blank_metadata
-** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
-- Inside source: true
+*** itch_wizard.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
*** True Line Result
- metadata = $gtk.read_file metadata_file_path
-** Processing line: ~ end~
-- Inside source: true
+
*** True Line Result
- end
-** Processing line: ~~
+#+begin_src ruby
+** Processing line: ~ # ./dragon/itch_wizard.rb~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~
+ # ./dragon/itch_wizard.rb
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
- Inside source: true
*** True Line Result
- dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
-** Processing line: ~~
+ # Copyright 2019 DragonRuby LLC
+** Processing line: ~ # MIT License~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ {~
+ # MIT License
+** Processing line: ~ # itch_wizard.rb has been released under MIT (*only this file*).~
- Inside source: true
*** True Line Result
- {
-** Processing line: ~ dev_id: dev_id.strip,~
+ # itch_wizard.rb has been released under MIT (*only this file*).
+** Processing line: ~~
- Inside source: true
*** True Line Result
- dev_id: dev_id.strip,
-** Processing line: ~ dev_title: dev_title.strip,~
+
+** Processing line: ~ class ItchWizard < Wizard~
- Inside source: true
*** True Line Result
- dev_title: dev_title.strip,
-** Processing line: ~ game_id: game_id.strip,~
+ class ItchWizard < Wizard
+** Processing line: ~ def steps~
- Inside source: true
*** True Line Result
- game_id: game_id.strip,
-** Processing line: ~ game_title: game_title.strip,~
+ def steps
+** Processing line: ~ [~
- Inside source: true
*** True Line Result
- game_title: game_title.strip,
-** Processing line: ~ version: version.strip,~
+ [
+** Processing line: ~ :check_metadata,~
- Inside source: true
*** True Line Result
- version: version.strip,
-** Processing line: ~ icon: icon.strip~
+ :check_metadata,
+** Processing line: ~ :deploy,~
- Inside source: true
*** True Line Result
- icon: icon.strip
-** Processing line: ~ }~
+ :deploy,
+** Processing line: ~ ]~
- Inside source: true
*** True Line Result
- }
+ ]
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -161471,10 +169250,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 metadata_text.each_line.to_a.length != 6~
+** Processing line: ~ if metadata_text.strip.each_line.to_a.length < 6~
- Inside source: true
*** True Line Result
- if metadata_text.each_line.to_a.length != 6
+ if metadata_text.strip.each_line.to_a.length < 6
** Processing line: ~ write_blank_metadata~
- Inside source: true
*** True Line Result
@@ -161519,10 +169298,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "* PROMPT: Please provide your username for Itch."
-** Processing line: ~ $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_dev_id \"#{metadata[:dev_id]}\""~
- Inside source: true
*** True Line Result
- $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\""
+ $console.set_command "$wizards.itch.set_dev_id \"#{metadata[:dev_id]}\""
** Processing line: ~ return :need_dev_id~
- Inside source: true
*** True Line Result
@@ -161543,10 +169322,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "* PROMPT: Please provide developer's/company's name that you want displayed."
-** Processing line: ~ $console.set_command "$wizards.itch.set_dev_title \"Your Name\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_dev_title \"#{metadata[:dev_title]}\""~
- Inside source: true
*** True Line Result
- $console.set_command "$wizards.itch.set_dev_title \"Your Name\""
+ $console.set_command "$wizards.itch.set_dev_title \"#{metadata[:dev_title]}\""
** Processing line: ~ return :need_dev_title~
- Inside source: true
*** True Line Result
@@ -161567,10 +169346,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "* PROMPT: Please provide the id for you game. This is the id you specified when you set up a new game page on Itch."
-** Processing line: ~ $console.set_command "$wizards.itch.set_game_id \"your-game-id\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_game_id \"#{metadata[:game_id]}\""~
- Inside source: true
*** True Line Result
- $console.set_command "$wizards.itch.set_game_id \"your-game-id\""
+ $console.set_command "$wizards.itch.set_game_id \"#{metadata[:game_id]}\""
** Processing line: ~ return :need_game_id~
- Inside source: true
*** True Line Result
@@ -161591,10 +169370,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "* PROMPT: Please provide the display name for your game. (This can include spaces)"
-** Processing line: ~ $console.set_command "$wizards.itch.set_game_title \"Your Game\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_game_title \"#{metadata[:game_title]}\""~
- Inside source: true
*** True Line Result
- $console.set_command "$wizards.itch.set_game_title \"Your Game\""
+ $console.set_command "$wizards.itch.set_game_title \"#{metadata[:game_title]}\""
** Processing line: ~ return :need_game_title~
- Inside source: true
*** True Line Result
@@ -161615,10 +169394,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "* PROMPT: Please provide the version for your game."
-** Processing line: ~ $console.set_command "$wizards.itch.set_version \"1.0\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_version \"#{metadata[:version]}\""~
- Inside source: true
*** True Line Result
- $console.set_command "$wizards.itch.set_version \"1.0\""
+ $console.set_command "$wizards.itch.set_version \"#{metadata[:version]}\""
** Processing line: ~ return :need_version~
- Inside source: true
*** True Line Result
@@ -161639,10 +169418,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "* PROMPT: Please provide icon path for your game."
-** Processing line: ~ $console.set_command "$wizards.itch.set_icon \"icon.png\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_icon \"#{metadata[:icon]}\""~
- Inside source: true
*** True Line Result
- $console.set_command "$wizards.itch.set_icon \"icon.png\""
+ $console.set_command "$wizards.itch.set_icon \"#{metadata[:icon]}\""
** Processing line: ~ return :need_icon~
- Inside source: true
*** True Line Result
@@ -161655,6 +169434,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ puts "here!! success!!!"~
+- Inside source: true
+*** True Line Result
+ puts "here!! success!!!"
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ return :success~
- Inside source: true
*** True Line Result
@@ -161675,10 +169462,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@dev_id = value
-** Processing line: ~ write_metadata~
-- Inside source: true
-*** True Line Result
- write_metadata
** Processing line: ~ start~
- Inside source: true
*** True Line Result
@@ -161699,10 +169482,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@dev_title = value
-** Processing line: ~ write_metadata~
-- Inside source: true
-*** True Line Result
- write_metadata
** Processing line: ~ start~
- Inside source: true
*** True Line Result
@@ -161723,10 +169502,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@game_id = value
-** Processing line: ~ write_metadata~
-- Inside source: true
-*** True Line Result
- write_metadata
** Processing line: ~ start~
- Inside source: true
*** True Line Result
@@ -161747,10 +169522,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@game_title = value
-** Processing line: ~ write_metadata~
-- Inside source: true
-*** True Line Result
- write_metadata
** Processing line: ~ start~
- Inside source: true
*** True Line Result
@@ -161771,10 +169542,6 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@version = value
-** Processing line: ~ write_metadata~
-- Inside source: true
-*** True Line Result
- write_metadata
** Processing line: ~ start~
- Inside source: true
*** True Line Result
@@ -161943,10 +169710,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
if @icon
-** Processing line: ~ text += "icon=metadata/#{@icon}\n"~
+** Processing line: ~ text += "icon=#{@icon}\n"~
- Inside source: true
*** True Line Result
- text += "icon=metadata/#{@icon}\n"
+ text += "icon=#{@icon}\n"
** Processing line: ~ else~
- Inside source: true
*** True Line Result
@@ -162015,10 +169782,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log_info "* Running dragonruby-publish: #{package_command}"
-** Processing line: ~ results = $gtk.exec package_command~
+** Processing line: ~ $gtk.openurl "http://itch.io/dashboard" if $gtk.platform == "Mac OS X"~
- Inside source: true
*** True Line Result
- results = $gtk.exec package_command
+ $gtk.openurl "http://itch.io/dashboard" if $gtk.platform == "Mac OS X"
+** Processing line: ~ if $gtk.platform? :mac~
+- Inside source: true
+*** True Line Result
+ if $gtk.platform? :mac
+** Processing line: ~ $gtk.exec "rm -rf ./builds"~
+- Inside source: true
+*** True Line Result
+ $gtk.exec "rm -rf ./builds"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~ results = $gtk.exec "#{package_command} --only-package"~
+- Inside source: true
+*** True Line Result
+ results = $gtk.exec "#{package_command} --only-package"
+** Processing line: ~ puts File.expand_path("./builds")~
+- Inside source: true
+*** True Line Result
+ puts File.expand_path("./builds")
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ log "#+begin_src"~
- Inside source: true
*** True Line Result
@@ -162031,6 +169822,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "#+end_src"
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if $gtk.platform? :mac~
+- Inside source: true
+*** True Line Result
+ if $gtk.platform? :mac
+** Processing line: ~ $gtk.exec "open ./builds/"~
+- Inside source: true
+*** True Line Result
+ $gtk.exec "open ./builds/"
+** Processing line: ~ elsif $gtk.platform? :windows~
+- Inside source: true
+*** True Line Result
+ elsif $gtk.platform? :windows
+** Processing line: ~ $gtk.exec "powershell \"ii .\""~
+- Inside source: true
+*** True Line Result
+ $gtk.exec "powershell \"ii .\""
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ $gtk.openurl "https://itch.io/dashboard"~
+- Inside source: true
+*** True Line Result
+ $gtk.openurl "https://itch.io/dashboard"
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ :success~
- Inside source: true
*** True Line Result
@@ -162071,10 +169898,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log_info "Running Itch Wizard Step: ~$wizards.itch.#{m}~"
-** Processing line: ~ result = (send m) || :success if @wizard_status[m][:result] != :success~
+** Processing line: ~ result = (send m) || :success~
- Inside source: true
*** True Line Result
- result = (send m) || :success if @wizard_status[m][:result] != :success
+ result = (send m) || :success
** Processing line: ~ @wizard_status[m][:result] = result~
- Inside source: true
*** True Line Result
@@ -163471,6 +171298,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def row_max_index~
+- Inside source: true
+*** True Line Result
+ def row_max_index
+** Processing line: ~ row_count - 1~
+- Inside source: true
+*** True Line Result
+ row_count - 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def col_count~
- Inside source: true
*** True Line Result
@@ -163487,6 +171330,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def col_max_index~
+- Inside source: true
+*** True Line Result
+ def col_max_index
+** Processing line: ~ col_count - 1~
+- Inside source: true
+*** True Line Result
+ col_count - 1
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def gutter_height~
- Inside source: true
*** True Line Result
@@ -163575,34 +171434,54 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
{
-** Processing line: ~ row: nil,~
+** Processing line: ~ row: nil,~
+- Inside source: true
+*** True Line Result
+ row: nil,
+** Processing line: ~ col: nil,~
+- Inside source: true
+*** True Line Result
+ col: nil,
+** Processing line: ~ h: 1,~
+- Inside source: true
+*** True Line Result
+ h: 1,
+** Processing line: ~ w: 1,~
+- Inside source: true
+*** True Line Result
+ w: 1,
+** Processing line: ~ dx: 0,~
+- Inside source: true
+*** True Line Result
+ dx: 0,
+** Processing line: ~ dx_ratio: 1,~
- Inside source: true
*** True Line Result
- row: nil,
-** Processing line: ~ col: nil,~
+ dx_ratio: 1,
+** Processing line: ~ dy: 0,~
- Inside source: true
*** True Line Result
- col: nil,
-** Processing line: ~ h: 1,~
+ dy: 0,
+** Processing line: ~ dy_ratio: 1,~
- Inside source: true
*** True Line Result
- h: 1,
-** Processing line: ~ w: 1,~
+ dy_ratio: 1,
+** Processing line: ~ dh_ratio: 1,~
- Inside source: true
*** True Line Result
- w: 1,
-** Processing line: ~ dx: 0,~
+ dh_ratio: 1,
+** Processing line: ~ dw_ratio: 1,~
- Inside source: true
*** True Line Result
- dx: 0,
-** Processing line: ~ dy: 0,~
+ dw_ratio: 1,
+** Processing line: ~ merge: nil,~
- Inside source: true
*** True Line Result
- dy: 0,
-** Processing line: ~ rect: :control_rect~
+ merge: nil,
+** Processing line: ~ rect: :control_rect~
- Inside source: true
*** True Line Result
- rect: :control_rect
+ rect: :control_rect
** Processing line: ~ }~
- Inside source: true
*** True Line Result
@@ -163615,14 +171494,418 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def rect opts~
+** Processing line: ~ def row n~
+- Inside source: true
+*** True Line Result
+ def row n
+** Processing line: ~ (rect row: n, col: 0, w: 0, h: 0).x~
+- Inside source: true
+*** True Line Result
+ (rect row: n, col: 0, w: 0, h: 0).x
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def row_from_bottom n~
+- Inside source: true
+*** True Line Result
+ def row_from_bottom n
+** Processing line: ~ (rect row: row_count - n, col: 0, w: 0, h: 0).x~
+- Inside source: true
+*** True Line Result
+ (rect row: row_count - n, col: 0, w: 0, h: 0).x
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def col n~
+- Inside source: true
+*** True Line Result
+ def col n
+** Processing line: ~ (rect row: 0, col: n, w: 0, h: 0).y~
+- Inside source: true
+*** True Line Result
+ (rect row: 0, col: n, w: 0, h: 0).y
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def col_from_right n~
+- Inside source: true
+*** True Line Result
+ def col_from_right n
+** Processing line: ~ (rect row: 0, col: col_max_index - n, w: 0, h: 0).y~
+- Inside source: true
+*** True Line Result
+ (rect row: 0, col: col_max_index - n, w: 0, h: 0).y
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def w n~
+- Inside source: true
+*** True Line Result
+ def w n
+** Processing line: ~ (rect row: 0, col: 0, w: n, h: 1).w~
+- Inside source: true
+*** True Line Result
+ (rect row: 0, col: 0, w: n, h: 1).w
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def h n~
+- Inside source: true
+*** True Line Result
+ def h n
+** Processing line: ~ (rect row: 0, col: 0, w: 1, h: n).h~
+- Inside source: true
+*** True Line Result
+ (rect row: 0, col: 0, w: 1, h: n).h
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def rect_group opts~
+- Inside source: true
+*** True Line Result
+ def rect_group opts
+** Processing line: ~ group = opts.group~
+- Inside source: true
+*** True Line Result
+ group = opts.group
+** Processing line: ~ r = opts.row || 0~
+- Inside source: true
+*** True Line Result
+ r = opts.row || 0
+** Processing line: ~ r = row_max_index - opts.row_from_bottom if opts.row_from_bottom~
+- Inside source: true
+*** True Line Result
+ r = row_max_index - opts.row_from_bottom if opts.row_from_bottom
+** Processing line: ~ c = opts.col || 0~
+- Inside source: true
+*** True Line Result
+ c = opts.col || 0
+** Processing line: ~ c = col_max_index - opts.col_from_right if opts.col_from_right~
+- Inside source: true
+*** True Line Result
+ c = col_max_index - opts.col_from_right if opts.col_from_right
+** Processing line: ~ drow = opts.drow || 0~
+- Inside source: true
+*** True Line Result
+ drow = opts.drow || 0
+** Processing line: ~ dcol = opts.dcol || 0~
+- Inside source: true
+*** True Line Result
+ dcol = opts.dcol || 0
+** Processing line: ~ w = opts.w || 0~
+- Inside source: true
+*** True Line Result
+ w = opts.w || 0
+** Processing line: ~ h = opts.h || 0~
+- Inside source: true
+*** True Line Result
+ h = opts.h || 0
+** Processing line: ~ merge = opts[:merge]~
+- Inside source: true
+*** True Line Result
+ merge = opts[:merge]
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ running_row = r~
+- Inside source: true
+*** True Line Result
+ running_row = r
+** Processing line: ~ running_col = c~
+- Inside source: true
+*** True Line Result
+ running_col = c
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ running_col = calc_col_offset(opts.col_offset) if opts.col_offset~
+- Inside source: true
+*** True Line Result
+ running_col = calc_col_offset(opts.col_offset) if opts.col_offset
+** Processing line: ~ running_row = calc_row_offset(opts.row_offset) if opts.row_offset~
+- Inside source: true
+*** True Line Result
+ running_row = calc_row_offset(opts.row_offset) if opts.row_offset
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ group.map do |i|~
+- Inside source: true
+*** True Line Result
+ group.map do |i|
+** Processing line: ~ group_layout_opts = i.layout || {}~
+- Inside source: true
+*** True Line Result
+ group_layout_opts = i.layout || {}
+** Processing line: ~ group_layout_opts = group_layout_opts.merge row: running_row,~
+- Inside source: true
+*** True Line Result
+ group_layout_opts = group_layout_opts.merge row: running_row,
+** Processing line: ~ col: running_col,~
+- Inside source: true
+*** True Line Result
+ col: running_col,
+** Processing line: ~ merge: merge,~
+- Inside source: true
+*** True Line Result
+ merge: merge,
+** Processing line: ~ w: w, h: h~
+- Inside source: true
+*** True Line Result
+ w: w, h: h
+** Processing line: ~ result = (rect group_layout_opts).merge i~
+- Inside source: true
+*** True Line Result
+ result = (rect group_layout_opts).merge i
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if (i.is_a? Hash) && (i.primitive_marker == :label)~
+- Inside source: true
+*** True Line Result
+ if (i.is_a? Hash) && (i.primitive_marker == :label)
+** Processing line: ~ if i.alignment_enum == 1~
+- Inside source: true
+*** True Line Result
+ if i.alignment_enum == 1
+** Processing line: ~ result.x += result.w.half~
+- Inside source: true
+*** True Line Result
+ result.x += result.w.half
+** Processing line: ~ elsif i.alignment_enum == 2~
+- Inside source: true
+*** True Line Result
+ elsif i.alignment_enum == 2
+** Processing line: ~ result.x += result.w~
+- Inside source: true
+*** True Line Result
+ result.x += result.w
+** 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: ~ running_row += drow~
+- Inside source: true
+*** True Line Result
+ running_row += drow
+** Processing line: ~ running_col += dcol~
+- Inside source: true
+*** True Line Result
+ running_col += dcol
+** Processing line: ~ result~
+- Inside source: true
+*** True Line Result
+ 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 calc_row_offset opts = {}~
+- Inside source: true
+*** True Line Result
+ def calc_row_offset opts = {}
+** Processing line: ~ count = opts[:count] || opts[:length] || 0~
+- Inside source: true
+*** True Line Result
+ count = opts[:count] || opts[:length] || 0
+** Processing line: ~ h = opts.h || 1~
+- Inside source: true
+*** True Line Result
+ h = opts.h || 1
+** Processing line: ~ (row_count - (count * h)) / 2.0~
+- Inside source: true
+*** True Line Result
+ (row_count - (count * h)) / 2.0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def calc_col_offset opts = {}~
+- Inside source: true
+*** True Line Result
+ def calc_col_offset opts = {}
+** Processing line: ~ count = opts[:count] || opts[:length] || 0~
+- Inside source: true
+*** True Line Result
+ count = opts[:count] || opts[:length] || 0
+** Processing line: ~ w = opts.w || 1~
+- Inside source: true
+*** True Line Result
+ w = opts.w || 1
+** Processing line: ~ (col_count - (count * w)) / 2.0~
+- Inside source: true
+*** True Line Result
+ (col_count - (count * w)) / 2.0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def point opts = {}~
+- Inside source: true
+*** True Line Result
+ def point opts = {}
+** Processing line: ~ opts.w = 1~
+- Inside source: true
+*** True Line Result
+ opts.w = 1
+** Processing line: ~ opts.h = 1~
+- Inside source: true
+*** True Line Result
+ opts.h = 1
+** Processing line: ~ opts.row ||= 0~
+- Inside source: true
+*** True Line Result
+ opts.row ||= 0
+** Processing line: ~ opts.col ||= 0~
+- Inside source: true
+*** True Line Result
+ opts.col ||= 0
+** Processing line: ~ r = rect opts~
+- Inside source: true
+*** True Line Result
+ r = rect opts
+** Processing line: ~ r.x += r.w * opts.col_anchor if opts.col_anchor~
+- Inside source: true
+*** True Line Result
+ r.x += r.w * opts.col_anchor if opts.col_anchor
+** Processing line: ~ r.y += r.h * opts.row_anchor if opts.row_anchor~
+- Inside source: true
+*** True Line Result
+ r.y += r.h * opts.row_anchor if opts.row_anchor
+** Processing line: ~ r~
+- Inside source: true
+*** True Line Result
+ r
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def rect *all_opts~
- Inside source: true
*** True Line Result
- def rect opts
+ def rect *all_opts
+** Processing line: ~ if all_opts.length == 1~
+- Inside source: true
+*** True Line Result
+ if all_opts.length == 1
+** Processing line: ~ opts = all_opts.first~
+- Inside source: true
+*** True Line Result
+ opts = all_opts.first
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ opts = {}~
+- Inside source: true
+*** True Line Result
+ opts = {}
+** Processing line: ~ all_opts.each do |o|~
+- Inside source: true
+*** True Line Result
+ all_opts.each do |o|
+** Processing line: ~ opts.merge! o~
+- Inside source: true
+*** True Line Result
+ opts.merge! o
+** 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: ~ opts.row = row_max_index - opts.row_from_bottom if opts.row_from_bottom~
+- Inside source: true
+*** True Line Result
+ opts.row = row_max_index - opts.row_from_bottom if opts.row_from_bottom
+** Processing line: ~ opts.col = col_max_index - opts.col_from_right if opts.col_from_right~
+- Inside source: true
+*** True Line Result
+ opts.col = col_max_index - opts.col_from_right if opts.col_from_right
** Processing line: ~ opts = rect_defaults.merge opts~
- Inside source: true
*** True Line Result
opts = rect_defaults.merge opts
+** Processing line: ~ opts.row ||= 0~
+- Inside source: true
+*** True Line Result
+ opts.row ||= 0
+** Processing line: ~ opts.col ||= 0~
+- Inside source: true
+*** True Line Result
+ opts.col ||= 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ result = send opts[:rect]~
- Inside source: true
*** True Line Result
@@ -163651,10 +171934,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
w: col.w,
-** Processing line: ~ h: row.h~
+** Processing line: ~ h: row.h,~
+- Inside source: true
+*** True Line Result
+ h: row.h,
+** Processing line: ~ center_x: col.center_x,~
+- Inside source: true
+*** True Line Result
+ center_x: col.center_x,
+** Processing line: ~ center_y: row.center_y~
- Inside source: true
*** True Line Result
- h: row.h
+ center_y: row.center_y
** Processing line: ~ elsif opts[:row] && !opts[:col]~
- Inside source: true
*** True Line Result
@@ -163803,22 +172094,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ result[:x] += opts[:dx] if opts[:dx]~
+** Processing line: ~ result[:x] += opts[:dx] if opts[:dx]~
+- Inside source: true
+*** True Line Result
+ result[:x] += opts[:dx] if opts[:dx]
+** Processing line: ~ result[:x] *= opts[:dx_ratio] if opts[:dx_ratio]~
+- Inside source: true
+*** True Line Result
+ result[:x] *= opts[:dx_ratio] if opts[:dx_ratio]
+** Processing line: ~ result[:y] += opts[:dy] if opts[:dy]~
+- Inside source: true
+*** True Line Result
+ result[:y] += opts[:dy] if opts[:dy]
+** Processing line: ~ result[:y] *= opts[:dy_ratio] if opts[:dy_ratio]~
+- Inside source: true
+*** True Line Result
+ result[:y] *= opts[:dy_ratio] if opts[:dy_ratio]
+** Processing line: ~ result[:w] += opts[:dw] if opts[:dw]~
- Inside source: true
*** True Line Result
- result[:x] += opts[:dx] if opts[:dx]
-** Processing line: ~ result[:y] += opts[:dy] if opts[:dy]~
+ result[:w] += opts[:dw] if opts[:dw]
+** Processing line: ~ result[:w] *= opts[:dw_ratio] if opts[:dw_ratio]~
- Inside source: true
*** True Line Result
- result[:y] += opts[:dy] if opts[:dy]
-** Processing line: ~ result[:w] += opts[:dw] if opts[:dw]~
+ result[:w] *= opts[:dw_ratio] if opts[:dw_ratio]
+** Processing line: ~ result[:h] += opts[:dh] if opts[:dh]~
- Inside source: true
*** True Line Result
- result[:w] += opts[:dw] if opts[:dw]
-** Processing line: ~ result[:h] += opts[:dh] if opts[:dh]~
+ result[:h] += opts[:dh] if opts[:dh]
+** Processing line: ~ result[:h] *= opts[:dh_ratio] if opts[:dh_ratio]~
- Inside source: true
*** True Line Result
- result[:h] += opts[:dh] if opts[:dh]
+ result[:h] *= opts[:dh_ratio] if opts[:dh_ratio]
+** Processing line: ~ result.merge! opts[:merge] if opts[:merge]~
+- Inside source: true
+*** True Line Result
+ result.merge! opts[:merge] if opts[:merge]
** Processing line: ~ result[:row] = opts[:row]~
- Inside source: true
*** True Line Result
@@ -163831,6 +172142,18 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ result[:h] = result[:h].clamp 0~
+- Inside source: true
+*** True Line Result
+ result[:h] = result[:h].clamp 0
+** Processing line: ~ result[:w] = result[:w].clamp 0~
+- Inside source: true
+*** True Line Result
+ result[:w] = result[:w].clamp 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ if $gtk.args.grid.name == :center~
- Inside source: true
*** True Line Result
@@ -163967,10 +172290,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ result = control_rect.merge y: row_y, h: row_h~
+** Processing line: ~ result = control_rect.merge y: row_y, h: row_h, center_y: (row_y + row_h.half)~
- Inside source: true
*** True Line Result
- result = control_rect.merge y: row_y, h: row_h
+ result = control_rect.merge y: row_y, h: row_h, center_y: (row_y + row_h.half)
** Processing line: ~ @rect_cache[:row][index][h] = result~
- Inside source: true
*** True Line Result
@@ -164059,10 +172382,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ result = control_rect.merge x: col_x, w: col_w~
+** Processing line: ~ result = control_rect.merge x: col_x, w: col_w, center_x: (col_x + col_w.half)~
- Inside source: true
*** True Line Result
- result = control_rect.merge x: col_x, w: col_w
+ result = control_rect.merge x: col_x, w: col_w, center_x: (col_x + col_w.half)
** Processing line: ~ @rect_cache[:col][index][w] = result~
- Inside source: true
*** True Line Result
@@ -164263,6 +172586,86 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def debug_primitives opts = {}~
+- Inside source: true
+*** True Line Result
+ def debug_primitives opts = {}
+** Processing line: ~ @primitives ||= col_count.map_with_index do |col|~
+- Inside source: true
+*** True Line Result
+ @primitives ||= col_count.map_with_index do |col|
+** Processing line: ~ row_count.map_with_index do |row|~
+- Inside source: true
+*** True Line Result
+ row_count.map_with_index do |row|
+** Processing line: ~ cell = rect row: row, col: col~
+- Inside source: true
+*** True Line Result
+ cell = rect row: row, col: col
+** Processing line: ~ center = Geometry.rect_center_point cell~
+- Inside source: true
+*** True Line Result
+ center = Geometry.rect_center_point cell
+** Processing line: ~ [~
+- Inside source: true
+*** True Line Result
+ [
+** Processing line: ~ cell.merge(opts).border,~
+- Inside source: true
+*** True Line Result
+ cell.merge(opts).border,
+** Processing line: ~ cell.merge(opts)~
+- Inside source: true
+*** True Line Result
+ cell.merge(opts)
+** Processing line: ~ .label!(x: center.x,~
+- Inside source: true
+*** True Line Result
+ .label!(x: center.x,
+** Processing line: ~ y: center.y,~
+- Inside source: true
+*** True Line Result
+ y: center.y,
+** Processing line: ~ text: "#{row},#{col}",~
+- Inside source: true
+*** True Line Result
+ text: "#{row},#{col}",
+** Processing line: ~ size_enum: -3,~
+- Inside source: true
+*** True Line Result
+ size_enum: -3,
+** Processing line: ~ vertical_alignment_enum: 1,~
+- Inside source: true
+*** True Line Result
+ vertical_alignment_enum: 1,
+** Processing line: ~ alignment_enum: 1)~
+- Inside source: true
+*** True Line Result
+ alignment_enum: 1)
+** 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: ~ @primitives~
+- Inside source: true
+*** True Line Result
+ @primitives
+** 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
@@ -164315,6 +172718,34 @@ 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: ~ def reset~
+- Inside source: true
+*** True Line Result
+ def reset
+** Processing line: ~ @primitives = nil~
+- Inside source: true
+*** True Line Result
+ @primitives = nil
+** Processing line: ~ @rect_cache ||= {}~
+- Inside source: true
+*** True Line Result
+ @rect_cache ||= {}
+** Processing line: ~ @rect_cache.clear~
+- Inside source: true
+*** True Line Result
+ @rect_cache.clear
+** 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
@@ -164875,6 +173306,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 self.reset~
+- Inside source: true
+*** True Line Result
+ def self.reset
+** Processing line: ~ @once = {}~
+- Inside source: true
+*** True Line Result
+ @once = {}
+** 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 self.puts_once *ids, message~
- Inside source: true
*** True Line Result
@@ -165419,6 +173870,198 @@ Follows is a source code listing for all files that have been open sourced. This
- End of paragraph detected.
*** True Line Result
+** Processing line: ~*** metadata.rb~
+- Header detected.
+*** True Line Result
+
+*** True Line Result
+*** metadata.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/metadata.rb~
+- Inside source: true
+*** True Line Result
+ # ./dragon/metadata.rb
+** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński~
+- Inside source: true
+*** True Line Result
+ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński
+** Processing line: ~ # Copyright 2021 DragonRuby LLC~
+- Inside source: true
+*** True Line Result
+ # Copyright 2021 DragonRuby LLC
+** Processing line: ~ # MIT License~
+- Inside source: true
+*** True Line Result
+ # MIT License
+** Processing line: ~ # metadata.rb has been released under MIT (*only this file*).~
+- Inside source: true
+*** True Line Result
+ # metadata.rb has been released under MIT (*only this file*).
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ module Metadata~
+- Inside source: true
+*** True Line Result
+ module Metadata
+** Processing line: ~ def metadata_file_path~
+- Inside source: true
+*** True Line Result
+ def metadata_file_path
+** Processing line: ~ "metadata/game_metadata.txt"~
+- Inside source: true
+*** True Line Result
+ "metadata/game_metadata.txt"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_metadata~
+- Inside source: true
+*** True Line Result
+ def get_metadata
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+- Inside source: true
+*** True Line Result
+ metadata = $gtk.read_file metadata_file_path
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if !metadata~
+- Inside source: true
+*** True Line Result
+ if !metadata
+** Processing line: ~ write_blank_metadata~
+- Inside source: true
+*** True Line Result
+ write_blank_metadata
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+- Inside source: true
+*** True Line Result
+ metadata = $gtk.read_file metadata_file_path
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~
+- Inside source: true
+*** True Line Result
+ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ dev_id: dev_id.strip,~
+- Inside source: true
+*** True Line Result
+ dev_id: dev_id.strip,
+** Processing line: ~ dev_title: dev_title.strip,~
+- Inside source: true
+*** True Line Result
+ dev_title: dev_title.strip,
+** Processing line: ~ game_id: game_id.strip,~
+- Inside source: true
+*** True Line Result
+ game_id: game_id.strip,
+** Processing line: ~ game_title: game_title.strip,~
+- Inside source: true
+*** True Line Result
+ game_title: game_title.strip,
+** Processing line: ~ version: version.strip,~
+- Inside source: true
+*** True Line Result
+ version: version.strip,
+** Processing line: ~ icon: icon.strip~
+- Inside source: true
+*** True Line Result
+ icon: icon.strip
+** 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 write_blank_metadata~
+- Inside source: true
+*** True Line Result
+ def write_blank_metadata
+** Processing line: ~ $gtk.write_file metadata_file_path, <<-S.strip~
+- Inside source: true
+*** True Line Result
+ $gtk.write_file metadata_file_path, <<-S.strip
+** Processing line: ~ #devid=myname~
+- Inside source: true
+*** True Line Result
+ #devid=myname
+** Processing line: ~ #devtitle=My Name~
+- Inside source: true
+*** True Line Result
+ #devtitle=My Name
+** Processing line: ~ #gameid=mygame~
+- Inside source: true
+*** True Line Result
+ #gameid=mygame
+** Processing line: ~ #gametitle=My Game~
+- Inside source: true
+*** True Line Result
+ #gametitle=My Game
+** Processing line: ~ #version=0.1~
+- Inside source: true
+*** True Line Result
+ #version=0.1
+** Processing line: ~ #icon=metadata/icon.png~
+- Inside source: true
+*** True Line Result
+ #icon=metadata/icon.png
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** 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: ~*** numeric.rb~
- Header detected.
*** True Line Result
@@ -165495,6 +174138,122 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def to_layout_row opts = {}~
+- Inside source: true
+*** True Line Result
+ def to_layout_row opts = {}
+** Processing line: ~ $layout.rect(row: self,~
+- Inside source: true
+*** True Line Result
+ $layout.rect(row: self,
+** Processing line: ~ col: opts.col || 0,~
+- Inside source: true
+*** True Line Result
+ col: opts.col || 0,
+** Processing line: ~ w: opts.w || 0,~
+- Inside source: true
+*** True Line Result
+ w: opts.w || 0,
+** Processing line: ~ h: opts.h || 0).y~
+- Inside source: true
+*** True Line Result
+ h: opts.h || 0).y
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_layout_col opts = {}~
+- Inside source: true
+*** True Line Result
+ def to_layout_col opts = {}
+** Processing line: ~ $layout.rect(row: 0,~
+- Inside source: true
+*** True Line Result
+ $layout.rect(row: 0,
+** Processing line: ~ col: self,~
+- Inside source: true
+*** True Line Result
+ col: self,
+** Processing line: ~ w: opts.w || 0,~
+- Inside source: true
+*** True Line Result
+ w: opts.w || 0,
+** Processing line: ~ h: opts.h || 0).x~
+- Inside source: true
+*** True Line Result
+ h: opts.h || 0).x
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_layout_w~
+- Inside source: true
+*** True Line Result
+ def to_layout_w
+** Processing line: ~ $layout.rect(row: 0, col: 0, w: self, h: 1).w~
+- Inside source: true
+*** True Line Result
+ $layout.rect(row: 0, col: 0, w: self, h: 1).w
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_layout_h~
+- Inside source: true
+*** True Line Result
+ def to_layout_h
+** Processing line: ~ $layout.rect(row: 0, col: 0, w: 1, h: self).h~
+- Inside source: true
+*** True Line Result
+ $layout.rect(row: 0, col: 0, w: 1, h: self).h
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_layout_row_from_bottom opts = {}~
+- Inside source: true
+*** True Line Result
+ def to_layout_row_from_bottom opts = {}
+** Processing line: ~ ($layout.row_max_index - self).to_layout_row opts~
+- Inside source: true
+*** True Line Result
+ ($layout.row_max_index - self).to_layout_row opts
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def to_layout_col_from_right opts = {}~
+- Inside source: true
+*** True Line Result
+ def to_layout_col_from_right opts = {}
+** Processing line: ~ ($layout.col_max_index - self).to_layout_col opts~
+- Inside source: true
+*** True Line Result
+ ($layout.col_max_index - self).to_layout_col opts
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -165555,6 +174314,38 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def third~
+- Inside source: true
+*** True Line Result
+ def third
+** Processing line: ~ self / 3.0~
+- Inside source: true
+*** True Line Result
+ self / 3.0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def quarter~
+- Inside source: true
+*** True Line Result
+ def quarter
+** Processing line: ~ self / 4.0~
+- Inside source: true
+*** True Line Result
+ self / 4.0
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def to_byte~
- Inside source: true
*** True Line Result
@@ -165571,6 +174362,38 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def clamp *opts~
+- Inside source: true
+*** True Line Result
+ def clamp *opts
+** Processing line: ~ min = (opts.at 0)~
+- Inside source: true
+*** True Line Result
+ min = (opts.at 0)
+** Processing line: ~ max = (opts.at 1)~
+- Inside source: true
+*** True Line Result
+ max = (opts.at 1)
+** Processing line: ~ return min if min && self < min~
+- Inside source: true
+*** True Line Result
+ return min if min && self < min
+** Processing line: ~ return max if max && self > max~
+- Inside source: true
+*** True Line Result
+ return max if max && self > max
+** Processing line: ~ return self~
+- Inside source: true
+*** True Line Result
+ return self
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def clamp_wrap min, max~
- Inside source: true
*** True Line Result
@@ -166467,10 +175290,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # Converts a number representing an angle in radians to degress.~
+** Processing line: ~ # Converts a number representing an angle in radians to degrees.~
- Inside source: true
*** True Line Result
- # Converts a number representing an angle in radians to degress.
+ # Converts a number representing an angle in radians to degrees.
** Processing line: ~ #~
- Inside source: true
*** True Line Result
@@ -166535,10 +175358,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # Returns a normal vector for a number that represents an angle in degress.~
+** Processing line: ~ # Returns a normal vector for a number that represents an angle in degrees.~
- Inside source: true
*** True Line Result
- # Returns a normal vector for a number that represents an angle in degress.
+ # Returns a normal vector for a number that represents an angle in degrees.
** Processing line: ~ #~
- Inside source: true
*** True Line Result
@@ -166563,10 +175386,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # Returns the y component of a normal vector for a number that represents an angle in degress.~
+** Processing line: ~ # Returns the y component of a normal vector for a number that represents an angle in degrees.~
- Inside source: true
*** True Line Result
- # Returns the y component of a normal vector for a number that represents an angle in degress.
+ # Returns the y component of a normal vector for a number that represents an angle in degrees.
** Processing line: ~ #~
- Inside source: true
*** True Line Result
@@ -166591,10 +175414,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # Returns the x component of a normal vector for a number that represents an angle in degress.~
+** Processing line: ~ # Returns the x component of a normal vector for a number that represents an angle in degrees.~
- Inside source: true
*** True Line Result
- # Returns the x component of a normal vector for a number that represents an angle in degress.
+ # Returns the x component of a normal vector for a number that represents an angle in degrees.
** Processing line: ~ #~
- Inside source: true
*** True Line Result
@@ -166699,6 +175522,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 multiply n~
+- Inside source: true
+*** True Line Result
+ def multiply n
+** Processing line: ~ self * n~
+- Inside source: true
+*** True Line Result
+ self * n
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def fmult n~
+- Inside source: true
+*** True Line Result
+ def fmult n
+** Processing line: ~ self * n.to_f~
+- Inside source: true
+*** True Line Result
+ self * n.to_f
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def imult n~
+- Inside source: true
+*** True Line Result
+ def imult n
+** Processing line: ~ (self * n).to_i~
+- Inside source: true
+*** True Line Result
+ (self * n).to_i
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def mult n~
- Inside source: true
*** True Line Result
@@ -167183,30 +176054,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 true if __original_eq_eq__ other~
-- Inside source: true
-*** True Line Result
- return true if __original_eq_eq__ other
-** Processing line: ~ return __original_eq_eq__ other.entity_id if other.is_a? OpenEntity~
-- Inside source: true
-*** True Line Result
- return __original_eq_eq__ other.entity_id if other.is_a? OpenEntity
-** Processing line: ~ return false~
-- Inside source: true
-*** True Line Result
- return false
-** 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
@@ -167551,14 +176398,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def - other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self - other~
- Inside source: true
*** True Line Result
- super
+ self - other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167579,14 +176426,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def + other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self + other~
- Inside source: true
*** True Line Result
- super
+ self + other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167607,14 +176454,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def * other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self * other~
- Inside source: true
*** True Line Result
- super
+ self * other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167635,14 +176482,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def / other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self / other~
- Inside source: true
*** True Line Result
- super
+ self / other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167759,6 +176606,22 @@ 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: ~ def mid? l, r~
+- Inside source: true
+*** True Line Result
+ def mid? l, r
+** Processing line: ~ (between? l, r) || (between? r, l)~
+- Inside source: true
+*** True Line Result
+ (between? l, r) || (between? r, l)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -167863,14 +176726,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def + other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self + other~
- Inside source: true
*** True Line Result
- super
+ self + other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167891,14 +176754,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def * other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self * other~
- Inside source: true
*** True Line Result
- super
+ self * other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167919,14 +176782,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def / other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self / other~
- Inside source: true
*** True Line Result
- super
+ self / other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167947,14 +176810,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def - other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
-** Processing line: ~ super~
+ return self unless other
+** Processing line: ~ self - other~
- Inside source: true
*** True Line Result
- super
+ self - other
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -167971,30 +176834,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 true if __original_eq_eq__ other~
-- Inside source: true
-*** True Line Result
- return true if __original_eq_eq__ other
-** Processing line: ~ return __original_eq_eq__ other.entity_id if other.is_a? GTK::OpenEntity~
-- Inside source: true
-*** True Line Result
- return __original_eq_eq__ other.entity_id if other.is_a? GTK::OpenEntity
-** Processing line: ~ return false~
-- Inside source: true
-*** True Line Result
- return false
-** 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
@@ -168219,10 +177058,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def - other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
+ return self unless other
** Processing line: ~ super~
- Inside source: true
*** True Line Result
@@ -168247,10 +177086,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def + other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
+ return self unless other
** Processing line: ~ super~
- Inside source: true
*** True Line Result
@@ -168275,10 +177114,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def * other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
+ return self unless other
** Processing line: ~ super~
- Inside source: true
*** True Line Result
@@ -168303,10 +177142,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def / other
-** Processing line: ~ return nil unless other~
+** Processing line: ~ return self unless other~
- Inside source: true
*** True Line Result
- return nil unless other
+ return self unless other
** Processing line: ~ super~
- Inside source: true
*** True Line Result
@@ -168491,6 +177330,22 @@ 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: ~ 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
@@ -168719,10 +177574,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@local_state.hotload_client ||= @local_state.new_entity(:hotload_client,
-** Processing line: ~ notes: "This enitity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",~
+** Processing line: ~ notes: "This entity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",~
- Inside source: true
*** True Line Result
- notes: "This enitity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",
+ notes: "This entity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",
** Processing line: ~ changes: { },~
- Inside source: true
*** True Line Result
@@ -169427,10 +178282,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
token = (word.split " ")[-1]
-** Processing line: ~ dots = (token.split ".")~
+** Processing line: ~ dots = (token.split ".").flat_map { |s| s.split "[" }.flat_map { |s| s.split "]" }.flat_map { |s| s.split "(" }.flat_map { |s| s.split ")" }~
- Inside source: true
*** True Line Result
- dots = (token.split ".")
+ dots = (token.split ".").flat_map { |s| s.split "[" }.flat_map { |s| s.split "]" }.flat_map { |s| s.split "(" }.flat_map { |s| s.split ")" }
** Processing line: ~ dot = dots[-1]~
- Inside source: true
*** True Line Result
@@ -169511,6 +178366,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
keys = keys.map { |k| k.to_s }
+** Processing line: ~ keys = keys.reject { |k| k.include? '"' }~
+- Inside source: true
+*** True Line Result
+ keys = keys.reject { |k| k.include? '"' }
+** Processing line: ~ .reject { |k| k.start_with? "'" }~
+- Inside source: true
+*** True Line Result
+ .reject { |k| k.start_with? "'" }
+** Processing line: ~ .reject { |k| k.include? "," }~
+- Inside source: true
+*** True Line Result
+ .reject { |k| k.include? "," }
+** Processing line: ~ .reject { |k| k.start_with? "#" }~
+- Inside source: true
+*** True Line Result
+ .reject { |k| k.start_with? "#" }
** Processing line: ~ others = ["def", "end"] +~
- Inside source: true
*** True Line Result
@@ -169739,6 +178610,22 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ if dot[0].upcase == dot[0] && (Object.const_defined? dot.to_sym)~
+- Inside source: true
+*** True Line Result
+ if dot[0].upcase == dot[0] && (Object.const_defined? dot.to_sym)
+** Processing line: ~ return (Object.const_get dot.to_sym).autocomplete_methods~
+- Inside source: true
+*** True Line Result
+ return (Object.const_get dot.to_sym).autocomplete_methods
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ start_collecting = false~
- Inside source: true
*** True Line Result
@@ -169799,10 +178686,26 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ return autocomplete_filter_methods target.as_hash.keys~
+** Processing line: ~ if target.respond_to? :as_hash~
+- Inside source: true
+*** True Line Result
+ if target.respond_to? :as_hash
+** Processing line: ~ return autocomplete_filter_methods target.as_hash.keys~
+- Inside source: true
+*** True Line Result
+ return autocomplete_filter_methods target.as_hash.keys
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ return autocomplete_filter_methods target.autocomplete_methods~
- Inside source: true
*** True Line Result
- return autocomplete_filter_methods target.as_hash.keys
+ return autocomplete_filter_methods target.autocomplete_methods
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -169815,6 +178718,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ text = text.each_line.reject { |l| l.strip.start_with? "#" }.join "\n"~
+- Inside source: true
+*** True Line Result
+ text = text.each_line.reject { |l| l.strip.start_with? "#" }.join "\n"
+** Processing line: ~ text = text.each_line.map { |l| l.split("#").first }.join "\n"~
+- Inside source: true
+*** True Line Result
+ text = text.each_line.map { |l| l.split("#").first }.join "\n"
** Processing line: ~ text.gsub!("[", " ")~
- Inside source: true
*** True Line Result
@@ -169879,22 +178790,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: ~*** runtime/draw.rb~
+** Processing line: ~*** runtime/benchmark.rb~
- Header detected.
*** True Line Result
*** True Line Result
-*** runtime/draw.rb
+*** runtime/benchmark.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/runtime/draw.rb~
+** Processing line: ~ # ./dragon/runtime/benchmark.rb~
- Inside source: true
*** True Line Result
- # ./dragon/runtime/draw.rb
+ # ./dragon/runtime/benchmark.rb
** Processing line: ~ # Copyright 2019 DragonRuby LLC~
- Inside source: true
*** True Line Result
@@ -169903,10 +178814,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
# MIT License
-** Processing line: ~ # draw.rb has been released under MIT (*only this file*).~
+** Processing line: ~ # benchmark.rb has been released under MIT (*only this file*).~
- Inside source: true
*** True Line Result
- # draw.rb has been released under MIT (*only this file*).
+ # benchmark.rb has been released under MIT (*only this file*).
** Processing line: ~~
- Inside source: true
*** True Line Result
@@ -169919,66 +178830,46 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
class Runtime
-** Processing line: ~ module Draw~
-- Inside source: true
-*** True Line Result
- module Draw
-** Processing line: ~ def primitives pass~
-- Inside source: true
-*** True Line Result
- def primitives pass
-** Processing line: ~ if $top_level.respond_to? :primitives_override~
-- Inside source: true
-*** True Line Result
- if $top_level.respond_to? :primitives_override
-** Processing line: ~ return $top_level.tick_render @args, pass~
+** Processing line: ~ module Benchmark~
- Inside source: true
*** True Line Result
- return $top_level.tick_render @args, pass
-** Processing line: ~ end~
+ module Benchmark
+** Processing line: ~ def benchmark_single iterations, name, proc~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # Don't change this draw order unless you understand~
+ def benchmark_single iterations, name, proc
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- # Don't change this draw order unless you understand
-** Processing line: ~ # the implications.~
+ log <<-S
+** Processing line: ~ ** Invoking :#{name}...~
- Inside source: true
*** True Line Result
- # the implications.
-** Processing line: ~~
-- Inside source: true
-*** True Line Result
-
-** Processing line: ~ # pass.solids.each { |s| draw_solid s }~
+ ** Invoking :#{name}...
+** Processing line: ~ S~
- Inside source: true
*** True Line Result
- # pass.solids.each { |s| draw_solid s }
-** Processing line: ~ # while loops are faster than each with block~
+ S
+** Processing line: ~ time_start = Time.now~
- Inside source: true
*** True Line Result
- # while loops are faster than each with block
+ time_start = Time.now
** Processing line: ~ idx = 0~
- Inside source: true
*** True Line Result
idx = 0
-** Processing line: ~ length = pass.solids.length~
+** Processing line: ~ r = nil~
- Inside source: true
*** True Line Result
- length = pass.solids.length
-** Processing line: ~ while idx < pass.solids.length~
+ r = nil
+** Processing line: ~ while idx < iterations~
- Inside source: true
*** True Line Result
- while idx < pass.solids.length
-** Processing line: ~ draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster~
+ while idx < iterations
+** Processing line: ~ r = proc.call~
- Inside source: true
*** True Line Result
- draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster
+ r = proc.call
** Processing line: ~ idx += 1~
- Inside source: true
*** True Line Result
@@ -169991,158 +178882,182 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.static_solids.each { |s| draw_solid s }~
+** Processing line: ~ result = (Time.now - time_start).round 3~
- Inside source: true
*** True Line Result
- # pass.static_solids.each { |s| draw_solid s }
-** Processing line: ~ idx = 0~
+ result = (Time.now - time_start).round 3
+** Processing line: ~~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_solids.length~
+
+** Processing line: ~ { name: name,~
- Inside source: true
*** True Line Result
- length = pass.static_solids.length
-** Processing line: ~ while idx < length~
+ { name: name,
+** Processing line: ~ time: result,~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_solid (pass.static_solids.at idx)~
+ time: result,
+** Processing line: ~ time_ms: (result * 1000).to_i }~
- Inside source: true
*** True Line Result
- draw_solid (pass.static_solids.at idx)
-** Processing line: ~ idx += 1~
+ time_ms: (result * 1000).to_i }
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- end
+
+** Processing line: ~ def benchmark opts = {}~
+- Inside source: true
+*** True Line Result
+ def benchmark opts = {}
+** Processing line: ~ iterations = opts.iterations~
+- Inside source: true
+*** True Line Result
+ iterations = opts.iterations
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.sprites.each { |s| draw_sprite s }~
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- # pass.sprites.each { |s| draw_sprite s }
-** Processing line: ~ idx = 0~
+ log <<-S
+** Processing line: ~ * BENCHMARK: Started~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.sprites.length~
+ * BENCHMARK: Started
+** Processing line: ~ ** Caller: #{(caller || []).first}~
- Inside source: true
*** True Line Result
- length = pass.sprites.length
-** Processing line: ~ while idx < length~
+ ** Caller: #{(caller || []).first}
+** Processing line: ~ ** Iterations: #{iterations}~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_sprite (pass.sprites.at idx)~
+ ** Iterations: #{iterations}
+** Processing line: ~ S~
- Inside source: true
*** True Line Result
- draw_sprite (pass.sprites.at idx)
-** Processing line: ~ idx += 1~
+ S
+** Processing line: ~ procs = opts.find_all { |k, v| v.respond_to? :call }~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ procs = opts.find_all { |k, v| v.respond_to? :call }
+** Processing line: ~~
- Inside source: true
*** True Line Result
- end
+
+** Processing line: ~ times = procs.map do |(name, proc)|~
+- Inside source: true
+*** True Line Result
+ times = procs.map do |(name, proc)|
+** Processing line: ~ benchmark_single iterations, name, proc~
+- Inside source: true
+*** True Line Result
+ benchmark_single iterations, name, proc
+** Processing line: ~ end.sort_by { |r| r.time }~
+- Inside source: true
+*** True Line Result
+ end.sort_by { |r| r.time }
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.static_sprites.each { |s| draw_sprite s }~
+** Processing line: ~ first_place = times.first~
- Inside source: true
*** True Line Result
- # pass.static_sprites.each { |s| draw_sprite s }
-** Processing line: ~ idx = 0~
+ first_place = times.first
+** Processing line: ~ second_place = times.second || first_place~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_sprites.length~
+ second_place = times.second || first_place
+** Processing line: ~~
- Inside source: true
*** True Line Result
- length = pass.static_sprites.length
-** Processing line: ~ while idx < length~
+
+** Processing line: ~ times = times.map do |candidate|~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_sprite (pass.static_sprites.at idx)~
+ times = times.map do |candidate|
+** Processing line: ~ average_time = first_place.time~
- Inside source: true
*** True Line Result
- draw_sprite (pass.static_sprites.at idx)
-** Processing line: ~ idx += 1~
+ average_time = first_place.time
+** Processing line: ~ .add(candidate.time)~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ .add(candidate.time)
+** Processing line: ~ .abs~
- Inside source: true
*** True Line Result
- end
+ .abs
+** Processing line: ~ .fdiv(2)~
+- Inside source: true
+*** True Line Result
+ .fdiv(2)
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.primitives.each { |p| draw_primitive p }~
+** Processing line: ~ difference_percentage = 0~
- Inside source: true
*** True Line Result
- # pass.primitives.each { |p| draw_primitive p }
-** Processing line: ~ idx = 0~
+ difference_percentage = 0
+** Processing line: ~ if average_time == 0~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.primitives.length~
+ if average_time == 0
+** Processing line: ~ difference_percentage = 0~
- Inside source: true
*** True Line Result
- length = pass.primitives.length
-** Processing line: ~ while idx < length~
+ difference_percentage = 0
+** Processing line: ~ else~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_primitive (pass.primitives.at idx)~
+ else
+** Processing line: ~ difference_percentage = first_place.time~
- Inside source: true
*** True Line Result
- draw_primitive (pass.primitives.at idx)
-** Processing line: ~ idx += 1~
+ difference_percentage = first_place.time
+** Processing line: ~ .subtract(candidate.time)~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ .subtract(candidate.time)
+** Processing line: ~ .abs~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~~
+ .abs
+** Processing line: ~ .fdiv(average_time)~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ # pass.static_primitives.each { |p| draw_primitive p }~
+ .fdiv(average_time)
+** Processing line: ~ .imult(100)~
- Inside source: true
*** True Line Result
- # pass.static_primitives.each { |p| draw_primitive p }
-** Processing line: ~ idx = 0~
+ .imult(100)
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_primitives.length~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- length = pass.static_primitives.length
-** Processing line: ~ while idx < length~
+
+** Processing line: ~ difference_time = ((first_place.time - candidate.time) * 1000).round~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_primitive (pass.static_primitives.at idx)~
+ difference_time = ((first_place.time - candidate.time) * 1000).round
+** Processing line: ~ candidate.merge(difference_percentage: difference_percentage,~
- Inside source: true
*** True Line Result
- draw_primitive (pass.static_primitives.at idx)
-** Processing line: ~ idx += 1~
+ candidate.merge(difference_percentage: difference_percentage,
+** Processing line: ~ difference_time: difference_time)~
- Inside source: true
*** True Line Result
- idx += 1
+ difference_time: difference_time)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170151,30 +179066,42 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.labels.each { |l| draw_label l }~
+** Processing line: ~ too_small_to_measure = false~
- Inside source: true
*** True Line Result
- # pass.labels.each { |l| draw_label l }
-** Processing line: ~ idx = 0~
+ too_small_to_measure = false
+** Processing line: ~ if (first_place.time + second_place.time) == 0~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.labels.length~
+ if (first_place.time + second_place.time) == 0
+** Processing line: ~ too_small_to_measure = true~
- Inside source: true
*** True Line Result
- length = pass.labels.length
-** Processing line: ~ while idx < length~
+ too_small_to_measure = true
+** Processing line: ~ difference_percentage = 0~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_label (pass.labels.at idx)~
+ difference_percentage = 0
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- draw_label (pass.labels.at idx)
-** Processing line: ~ idx += 1~
+ log <<-S
+** Processing line: ~ * BENCHMARK: Average time for experiments were too small. Increase the number of iterations.~
- Inside source: true
*** True Line Result
- idx += 1
+ * BENCHMARK: Average time for experiments were too small. Increase the number of iterations.
+** Processing line: ~ S~
+- Inside source: true
+*** True Line Result
+ S
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ difference_percentage = (((first_place.time - second_place.time).abs.fdiv((first_place.time + second_place.time).abs.fdiv(2))) * 100).round~
+- Inside source: true
+*** True Line Result
+ difference_percentage = (((first_place.time - second_place.time).abs.fdiv((first_place.time + second_place.time).abs.fdiv(2))) * 100).round
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170183,126 +179110,118 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.static_labels.each { |l| draw_label l }~
+** Processing line: ~ difference_time = first_place.time.-(second_place.time).*(1000).abs.round~
- Inside source: true
*** True Line Result
- # pass.static_labels.each { |l| draw_label l }
-** Processing line: ~ idx = 0~
+ difference_time = first_place.time.-(second_place.time).*(1000).abs.round
+** Processing line: ~~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_labels.length~
+
+** Processing line: ~ r = {~
- Inside source: true
*** True Line Result
- length = pass.static_labels.length
-** Processing line: ~ while idx < length~
+ r = {
+** Processing line: ~ iterations: iterations,~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_label (pass.static_labels.at idx)~
+ iterations: iterations,
+** Processing line: ~ first_place: first_place,~
- Inside source: true
*** True Line Result
- draw_label (pass.static_labels.at idx)
-** Processing line: ~ idx += 1~
+ first_place: first_place,
+** Processing line: ~ second_place: second_place,~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ second_place: second_place,
+** Processing line: ~ difference_time: difference_time,~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~~
+ difference_time: difference_time,
+** Processing line: ~ difference_percentage: difference_percentage,~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ # pass.lines.each { |l| draw_line l }~
+ difference_percentage: difference_percentage,
+** Processing line: ~ times: times,~
- Inside source: true
*** True Line Result
- # pass.lines.each { |l| draw_line l }
-** Processing line: ~ idx = 0~
+ times: times,
+** Processing line: ~ too_small_to_measure: too_small_to_measure~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.lines.length~
-- Inside source: true
-*** True Line Result
- length = pass.lines.length
-** Processing line: ~ while idx < length~
+ too_small_to_measure: too_small_to_measure
+** Processing line: ~ }~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_line (pass.lines.at idx)~
+ }
+** Processing line: ~~
- Inside source: true
*** True Line Result
- draw_line (pass.lines.at idx)
-** Processing line: ~ idx += 1~
+
+** Processing line: ~ log_message = []~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ log_message = []
+** Processing line: ~ only_one_result = first_place.name == second_place.name~
- Inside source: true
*** True Line Result
- end
+ only_one_result = first_place.name == second_place.name
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.static_lines.each { |l| draw_line l }~
-- Inside source: true
-*** True Line Result
- # pass.static_lines.each { |l| draw_line l }
-** Processing line: ~ idx = 0~
+** Processing line: ~ if only_one_result~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_lines.length~
+ if only_one_result
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- length = pass.static_lines.length
-** Processing line: ~ while idx < pass.static_lines.length~
+ log <<-S
+** Processing line: ~ * BENCHMARK: #{r.first_place.name} completed in #{r.first_place.time_ms}ms."~
- Inside source: true
*** True Line Result
- while idx < pass.static_lines.length
-** Processing line: ~ draw_line (pass.static_lines.at idx)~
+ * BENCHMARK: #{r.first_place.name} completed in #{r.first_place.time_ms}ms."
+** Processing line: ~ S~
- Inside source: true
*** True Line Result
- draw_line (pass.static_lines.at idx)
-** Processing line: ~ idx += 1~
+ S
+** Processing line: ~ else~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ else
+** Processing line: ~ log <<-S~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~~
+ log <<-S
+** Processing line: ~ * BENCHMARK: #{r.message}~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ # pass.borders.each { |b| draw_border b }~
+ * BENCHMARK: #{r.message}
+** Processing line: ~ ** Fastest: #{r.first_place.name.inspect}~
- Inside source: true
*** True Line Result
- # pass.borders.each { |b| draw_border b }
-** Processing line: ~ idx = 0~
+ ** Fastest: #{r.first_place.name.inspect}
+** Processing line: ~ ** Second: #{r.second_place.name.inspect}~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.borders.length~
+ ** Second: #{r.second_place.name.inspect}
+** Processing line: ~ ** Margin: #{r.difference_percentage}% (#{r.difference_time.abs}ms) #{r.first_place.time_ms}ms vs #{r.second_place.time_ms}ms.~
- Inside source: true
*** True Line Result
- length = pass.borders.length
-** Processing line: ~ while idx < length~
+ ** Margin: #{r.difference_percentage}% (#{r.difference_time.abs}ms) #{r.first_place.time_ms}ms vs #{r.second_place.time_ms}ms.
+** Processing line: ~ ** Times:~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_border (pass.borders.at idx)~
+ ** Times:
+** Processing line: ~ #{r.times.map { |t| "*** #{t.name}: #{t.time_ms}ms (#{t.difference_percentage}% #{t.difference_time.abs}ms)." }.join("\n")}~
- Inside source: true
*** True Line Result
- draw_border (pass.borders.at idx)
-** Processing line: ~ idx += 1~
+ #{r.times.map { |t| "*** #{t.name}: #{t.time_ms}ms (#{t.difference_percentage}% #{t.difference_time.abs}ms)." }.join("\n")}
+** Processing line: ~ S~
- Inside source: true
*** True Line Result
- idx += 1
+ S
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170311,102 +179230,94 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.static_borders.each { |b| draw_border b }~
+** Processing line: ~ r~
- Inside source: true
*** True Line Result
- # pass.static_borders.each { |b| draw_border b }
-** Processing line: ~ idx = 0~
+ r
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_borders.length~
+ end
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- length = pass.static_borders.length
-** Processing line: ~ while idx < length~
+ end
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_border (pass.static_borders.at idx)~
+ end
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- draw_border (pass.static_borders.at idx)
-** Processing line: ~ idx += 1~
+ end
+** Processing line: ~~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
-- Inside source: true
+
+** Processing line: ~#+end_src~
+- Line was identified as the end of a code block.
*** True Line Result
- end
+#+end_src
** Processing line: ~~
-- Inside source: true
+- End of paragraph detected.
*** True Line Result
-** Processing line: ~ if !$gtk.production~
-- Inside source: true
+** Processing line: ~*** runtime/draw.rb~
+- Header detected.
*** True Line Result
- if !$gtk.production
-** Processing line: ~ # pass.debug.each { |r| draw_primitive r }~
-- Inside source: true
+
*** True Line Result
- # pass.debug.each { |r| draw_primitive r }
-** Processing line: ~ idx = 0~
-- Inside source: true
+*** runtime/draw.rb
+** Processing line: ~#+begin_src ruby~
+- Line was identified as the beginning of a code block.
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.debug.length~
-- Inside source: true
+
*** True Line Result
- length = pass.debug.length
-** Processing line: ~ while idx < length~
+#+begin_src ruby
+** Processing line: ~ # ./dragon/runtime/draw.rb~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_primitive (pass.debug.at idx)~
+ # ./dragon/runtime/draw.rb
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
- Inside source: true
*** True Line Result
- draw_primitive (pass.debug.at idx)
-** Processing line: ~ idx += 1~
+ # Copyright 2019 DragonRuby LLC
+** Processing line: ~ # MIT License~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ # MIT License
+** Processing line: ~ # draw.rb has been released under MIT (*only this file*).~
- Inside source: true
*** True Line Result
- end
+ # draw.rb has been released under MIT (*only this file*).
** Processing line: ~~
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.static_debug.each { |r| draw_primitive r }~
-- Inside source: true
-*** True Line Result
- # pass.static_debug.each { |r| draw_primitive r }
-** Processing line: ~ idx = 0~
+** Processing line: ~ module GTK~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_debug.length~
+ module GTK
+** Processing line: ~ class Runtime~
- Inside source: true
*** True Line Result
- length = pass.static_debug.length
-** Processing line: ~ while idx < length~
+ class Runtime
+** Processing line: ~ module Draw~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_primitive (pass.static_debug.at idx)~
+ module Draw
+** Processing line: ~ def primitives pass~
- Inside source: true
*** True Line Result
- draw_primitive (pass.static_debug.at idx)
-** Processing line: ~ idx += 1~
+ def primitives pass
+** Processing line: ~ if $top_level.respond_to? :primitives_override~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ if $top_level.respond_to? :primitives_override
+** Processing line: ~ return $top_level.tick_render @args, pass~
- Inside source: true
*** True Line Result
- end
+ return $top_level.tick_render @args, pass
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170415,66 +179326,86 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ # pass.reserved.each { |r| draw_primitive r }~
+** Processing line: ~ fn.each_send pass.solids, self, :draw_solid~
- Inside source: true
*** True Line Result
- # pass.reserved.each { |r| draw_primitive r }
-** Processing line: ~ idx = 0~
+ fn.each_send pass.solids, self, :draw_solid
+** Processing line: ~ fn.each_send pass.static_solids, self, :draw_solid~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.reserved.length~
+ fn.each_send pass.static_solids, self, :draw_solid
+** Processing line: ~ fn.each_send pass.sprites, self, :draw_sprite~
- Inside source: true
*** True Line Result
- length = pass.reserved.length
-** Processing line: ~ while idx < length~
+ fn.each_send pass.sprites, self, :draw_sprite
+** Processing line: ~ fn.each_send pass.static_sprites, self, :draw_sprite~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_primitive (pass.reserved.at idx)~
+ fn.each_send pass.static_sprites, self, :draw_sprite
+** Processing line: ~ fn.each_send pass.primitives, self, :draw_primitive~
- Inside source: true
*** True Line Result
- draw_primitive (pass.reserved.at idx)
-** Processing line: ~ idx += 1~
+ fn.each_send pass.primitives, self, :draw_primitive
+** Processing line: ~ fn.each_send pass.static_primitives, self, :draw_primitive~
- Inside source: true
*** True Line Result
- idx += 1
-** Processing line: ~ end~
+ fn.each_send pass.static_primitives, self, :draw_primitive
+** Processing line: ~ fn.each_send pass.labels, self, :draw_label~
- Inside source: true
*** True Line Result
- end
-** Processing line: ~~
+ fn.each_send pass.labels, self, :draw_label
+** Processing line: ~ fn.each_send pass.static_labels, self, :draw_label~
- Inside source: true
*** True Line Result
-
-** Processing line: ~ # pass.static_reserved.each { |r| draw_primitive r }~
+ fn.each_send pass.static_labels, self, :draw_label
+** Processing line: ~ fn.each_send pass.lines, self, :draw_line~
- Inside source: true
*** True Line Result
- # pass.static_reserved.each { |r| draw_primitive r }
-** Processing line: ~ idx = 0~
+ fn.each_send pass.lines, self, :draw_line
+** Processing line: ~ fn.each_send pass.static_lines, self, :draw_line~
- Inside source: true
*** True Line Result
- idx = 0
-** Processing line: ~ length = pass.static_reserved.length~
+ fn.each_send pass.static_lines, self, :draw_line
+** Processing line: ~ fn.each_send pass.borders, self, :draw_border~
- Inside source: true
*** True Line Result
- length = pass.static_reserved.length
-** Processing line: ~ while idx < length~
+ fn.each_send pass.borders, self, :draw_border
+** Processing line: ~ fn.each_send pass.static_borders, self, :draw_border~
- Inside source: true
*** True Line Result
- while idx < length
-** Processing line: ~ draw_primitive (pass.static_reserved.at idx)~
+ fn.each_send pass.static_borders, self, :draw_border
+** Processing line: ~~
- Inside source: true
*** True Line Result
- draw_primitive (pass.static_reserved.at idx)
-** Processing line: ~ idx += 1~
+
+** Processing line: ~ if !$gtk.production~
- Inside source: true
*** True Line Result
- idx += 1
+ if !$gtk.production
+** Processing line: ~ fn.each_send pass.debug, self, :draw_primitive~
+- Inside source: true
+*** True Line Result
+ fn.each_send pass.debug, self, :draw_primitive
+** Processing line: ~ fn.each_send pass.static_debug, self, :draw_primitive~
+- Inside source: true
+*** True Line Result
+ fn.each_send pass.static_debug, self, :draw_primitive
** Processing line: ~ end~
- Inside source: true
*** True Line Result
end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ fn.each_send pass.reserved, self, :draw_primitive~
+- Inside source: true
+*** True Line Result
+ fn.each_send pass.reserved, self, :draw_primitive
+** Processing line: ~ fn.each_send pass.static_reserved, self, :draw_primitive~
+- Inside source: true
+*** True Line Result
+ fn.each_send pass.static_reserved, self, :draw_primitive
** Processing line: ~ rescue Exception => e~
- Inside source: true
*** True Line Result
@@ -170515,10 +179446,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: ~ @ffi_draw.draw_solid s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a~
+** Processing line: ~ @ffi_draw.draw_solid_2 s.x, s.y, s.w, s.h,~
+- Inside source: true
+*** True Line Result
+ @ffi_draw.draw_solid_2 s.x, s.y, s.w, s.h,
+** Processing line: ~ s.r, s.g, s.b, s.a,~
- Inside source: true
*** True Line Result
- @ffi_draw.draw_solid s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a
+ s.r, s.g, s.b, s.a,
+** Processing line: ~ (s.blendmode_enum || 1)~
+- Inside source: true
+*** True Line Result
+ (s.blendmode_enum || 1)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170559,14 +179498,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
-** Processing line: ~ @ffi_draw.draw_sprite_3 s.x, s.y, s.w, s.h,~
+** Processing line: ~ @ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,~
- Inside source: true
*** True Line Result
- @ffi_draw.draw_sprite_3 s.x, s.y, s.w, s.h,
-** Processing line: ~ s.path.s_or_default,~
+ @ffi_draw.draw_sprite_4 s.x, s.y, s.w, s.h,
+** Processing line: ~ (s.path || '').to_s,~
- Inside source: true
*** True Line Result
- s.path.s_or_default,
+ (s.path || '').to_s,
** Processing line: ~ s.angle,~
- Inside source: true
*** True Line Result
@@ -170587,10 +179526,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
s.angle_anchor_x, s.angle_anchor_y,
-** Processing line: ~ s.source_x, s.source_y, s.source_w, s.source_h~
+** Processing line: ~ s.source_x, s.source_y, s.source_w, s.source_h,~
+- Inside source: true
+*** True Line Result
+ s.source_x, s.source_y, s.source_w, s.source_h,
+** Processing line: ~ (s.blendmode_enum || 1)~
- Inside source: true
*** True Line Result
- s.source_x, s.source_y, s.source_w, s.source_h
+ (s.blendmode_enum || 1)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170631,10 +179574,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: ~ @ffi_draw.draw_screenshot s.path.s_or_default,~
+** Processing line: ~ @ffi_draw.draw_screenshot (s.path || '').to_s,~
- Inside source: true
*** True Line Result
- @ffi_draw.draw_screenshot s.path.s_or_default,
+ @ffi_draw.draw_screenshot (s.path || '').to_s,
** Processing line: ~ s.x, s.y, s.w, s.h,~
- Inside source: true
*** True Line Result
@@ -170703,22 +179646,34 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
-** Processing line: ~ @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,~
+** Processing line: ~ @ffi_draw.draw_label_3 l.x, l.y,~
- Inside source: true
*** True Line Result
- @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,
-** Processing line: ~ l.size_enum, l.alignment_enum,~
+ @ffi_draw.draw_label_3 l.x, l.y,
+** Processing line: ~ (l.text || '').to_s,~
- Inside source: true
*** True Line Result
- l.size_enum, l.alignment_enum,
-** Processing line: ~ l.r, l.g, l.b, l.a,~
+ (l.text || '').to_s,
+** Processing line: ~ l.size_enum, l.alignment_enum,~
- Inside source: true
*** True Line Result
- l.r, l.g, l.b, l.a,
-** Processing line: ~ l.font.s_or_default(nil)~
+ l.size_enum, l.alignment_enum,
+** Processing line: ~ l.r, l.g, l.b, l.a,~
- Inside source: true
*** True Line Result
- l.font.s_or_default(nil)
+ l.r, l.g, l.b, l.a,
+** Processing line: ~ l.font,~
+- Inside source: true
+*** True Line Result
+ l.font,
+** Processing line: ~ (l.vertical_alignment_enum || 2),~
+- Inside source: true
+*** True Line Result
+ (l.vertical_alignment_enum || 2),
+** Processing line: ~ (l.blendmode_enum || 1)~
+- Inside source: true
+*** True Line Result
+ (l.blendmode_enum || 1)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170759,10 +179714,66 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
else
-** Processing line: ~ @ffi_draw.draw_line l.x, l.y, l.x2, l.y2, l.r, l.g, l.b, l.a~
+** Processing line: ~ if l.x2~
+- Inside source: true
+*** True Line Result
+ if l.x2
+** Processing line: ~ @ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,~
+- Inside source: true
+*** True Line Result
+ @ffi_draw.draw_line_2 l.x, l.y, l.x2, l.y2,
+** Processing line: ~ l.r, l.g, l.b, l.a,~
+- Inside source: true
+*** True Line Result
+ l.r, l.g, l.b, l.a,
+** Processing line: ~ (l.blendmode_enum || 1)~
+- Inside source: true
+*** True Line Result
+ (l.blendmode_enum || 1)
+** Processing line: ~ else~
+- Inside source: true
+*** True Line Result
+ else
+** Processing line: ~ w = l.w || 0~
+- Inside source: true
+*** True Line Result
+ w = l.w || 0
+** Processing line: ~ w = 1 if w == 0~
+- Inside source: true
+*** True Line Result
+ w = 1 if w == 0
+** Processing line: ~ h = l.h || 0~
+- Inside source: true
+*** True Line Result
+ h = l.h || 0
+** Processing line: ~ h = 1 if h == 0~
+- Inside source: true
+*** True Line Result
+ h = 1 if h == 0
+** Processing line: ~ @ffi_draw.draw_line_2 l.x, l.y,~
- Inside source: true
*** True Line Result
- @ffi_draw.draw_line l.x, l.y, l.x2, l.y2, l.r, l.g, l.b, l.a
+ @ffi_draw.draw_line_2 l.x, l.y,
+** Processing line: ~ l.x + w - 1,~
+- Inside source: true
+*** True Line Result
+ l.x + w - 1,
+** Processing line: ~ l.y + h - 1,~
+- Inside source: true
+*** True Line Result
+ l.y + h - 1,
+** Processing line: ~ l.r, l.g, l.b, l.a,~
+- Inside source: true
+*** True Line Result
+ l.r, l.g, l.b, l.a,
+** Processing line: ~ (l.blendmode_enum || 1)~
+- Inside source: true
+*** True Line Result
+ (l.blendmode_enum || 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170803,10 +179814,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: ~ @ffi_draw.draw_border s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a~
+** Processing line: ~ @ffi_draw.draw_border_2 s.x, s.y, s.w, s.h,~
+- Inside source: true
+*** True Line Result
+ @ffi_draw.draw_border_2 s.x, s.y, s.w, s.h,
+** Processing line: ~ s.r, s.g, s.b, s.a,~
+- Inside source: true
+*** True Line Result
+ s.r, s.g, s.b, s.a,
+** Processing line: ~ (s.blendmode_enum || 1)~
- Inside source: true
*** True Line Result
- @ffi_draw.draw_border s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a
+ (s.blendmode_enum || 1)
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -170883,10 +179902,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: ~ end~
- Inside source: true
*** True Line Result
@@ -171755,10 +180770,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
[
-** Processing line: ~ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid,~
+** Processing line: ~ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid!,~
- Inside source: true
*** True Line Result
- { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid,
+ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid!,
** Processing line: ~ {~
- Inside source: true
*** True Line Result
@@ -171791,10 +180806,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
size_enum: -2
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
- Inside source: true
*** True Line Result
- }.label,
+ }.label!,
** Processing line: ~ {~
- Inside source: true
*** True Line Result
@@ -171827,10 +180842,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
size_enum: -2
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
- Inside source: true
*** True Line Result
- }.label,
+ }.label!,
** Processing line: ~ {~
- Inside source: true
*** True Line Result
@@ -171863,10 +180878,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
size_enum: -2
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
- Inside source: true
*** True Line Result
- }.label,
+ }.label!,
** Processing line: ~ {~
- Inside source: true
*** True Line Result
@@ -171899,10 +180914,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
size_enum: -2
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
- Inside source: true
*** True Line Result
- }.label,
+ }.label!,
** Processing line: ~ {~
- Inside source: true
*** True Line Result
@@ -171935,10 +180950,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
size_enum: -2
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
- Inside source: true
*** True Line Result
- }.label,
+ }.label!,
** Processing line: ~ ]~
- Inside source: true
*** True Line Result
@@ -172039,10 +181054,38 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
@mailbox_if_needed = 0
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ # schema for file_mtimes~
+- Inside source: true
+*** True Line Result
+ # schema for file_mtimes
+** Processing line: ~ # { FILE_PATH: { current: (Time as Fixnum),~
+- Inside source: true
+*** True Line Result
+ # { FILE_PATH: { current: (Time as Fixnum),
+** Processing line: ~ # last: (Time as Fixnum) },~
+- Inside source: true
+*** True Line Result
+ # last: (Time as Fixnum) },
+** Processing line: ~ # FILE_PATH: { current: (Time as Fixnum),~
+- Inside source: true
+*** True Line Result
+ # FILE_PATH: { current: (Time as Fixnum),
+** Processing line: ~ # last: (Time as Fixnum) } }~
+- Inside source: true
+*** True Line Result
+ # last: (Time as Fixnum) } }
** Processing line: ~ @file_mtimes = { }~
- Inside source: true
*** True Line Result
@file_mtimes = { }
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ @suppress_mailbox = true~
- Inside source: true
*** True Line Result
@@ -172191,6 +181234,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
'dragon/numeric.rb',
+** Processing line: ~ 'dragon/hash_deprecated.rb',~
+- Inside source: true
+*** True Line Result
+ 'dragon/hash_deprecated.rb',
** Processing line: ~ 'dragon/hash.rb',~
- Inside source: true
*** True Line Result
@@ -172319,6 +181366,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
'dragon/hotload_client.rb',
+** Processing line: ~ 'dragon/wizards.rb',~
+- Inside source: true
+*** True Line Result
+ 'dragon/wizards.rb',
** Processing line: ~ 'dragon/ios_wizard.rb',~
- Inside source: true
*** True Line Result
@@ -172391,22 +181442,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def init_mtimes file
-** Processing line: ~ current_key = "current_#{file}".to_sym~
+** Processing line: ~ @file_mtimes[file] ||= { current: @ffi_file.mtime(file),~
- Inside source: true
*** True Line Result
- current_key = "current_#{file}".to_sym
-** Processing line: ~ last_key = "last_#{file}".to_sym~
+ @file_mtimes[file] ||= { current: @ffi_file.mtime(file),
+** Processing line: ~ last: @ffi_file.mtime(file) }~
- Inside source: true
*** True Line Result
- last_key = "last_#{file}".to_sym
-** Processing line: ~ @file_mtimes[current_key] ||= @ffi_file.mtime(file)~
-- Inside source: true
-*** True Line Result
- @file_mtimes[current_key] ||= @ffi_file.mtime(file)
-** Processing line: ~ @file_mtimes[last_key] ||= @ffi_file.mtime(file)~
-- Inside source: true
-*** True Line Result
- @file_mtimes[last_key] ||= @ffi_file.mtime(file)
+ last: @ffi_file.mtime(file) }
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -172531,6 +181574,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def hotload_if_needed
+** Processing line: ~ return if Kernel.tick_count < 0~
+- Inside source: true
+*** True Line Result
+ return if Kernel.tick_count < 0
** Processing line: ~ hotload_source_files~
- Inside source: true
*** True Line Result
@@ -172551,14 +181598,14 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
def on_load_succeeded file
-** Processing line: ~ @rcb_sender.files_reloaded << file~
+** Processing line: ~ self.files_reloaded << file~
- Inside source: true
*** True Line Result
- @rcb_sender.files_reloaded << file
-** Processing line: ~ @rcb_sender.reloaded_files << file~
+ self.files_reloaded << file
+** Processing line: ~ self.reloaded_files << file~
- Inside source: true
*** True Line Result
- @rcb_sender.reloaded_files << file
+ self.reloaded_files << file
** Processing line: ~ Trace.untrace_classes!~
- Inside source: true
*** True Line Result
@@ -172571,42 +181618,82 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
-** Processing line: ~ def reload_if_needed file, force = false~
+** Processing line: ~ def reset_all_mtimes~
- Inside source: true
*** True Line Result
- def reload_if_needed file, force = false
-** Processing line: ~ current_key = "current_#{file}".to_sym~
+ def reset_all_mtimes
+** Processing line: ~ @file_mtimes.each do |file, _|~
- Inside source: true
*** True Line Result
- current_key = "current_#{file}".to_sym
-** Processing line: ~ last_key = "last_#{file}".to_sym~
+ @file_mtimes.each do |file, _|
+** Processing line: ~ @file_mtimes[file].current = @ffi_file.mtime(file)~
- Inside source: true
*** True Line Result
- last_key = "last_#{file}".to_sym
-** Processing line: ~ @file_mtimes[current_key] ||= nil~
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+** Processing line: ~ @file_mtimes[file].last = @file_mtimes[file].current~
- Inside source: true
*** True Line Result
- @file_mtimes[current_key] ||= nil
-** Processing line: ~ @file_mtimes[last_key] ||= nil~
+ @file_mtimes[file].last = @file_mtimes[file].current
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- @file_mtimes[last_key] ||= nil
-** Processing line: ~ @file_mtimes[current_key] = @ffi_file.mtime(file)~
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ files_to_reload.each do |file, _|~
+- Inside source: true
+*** True Line Result
+ files_to_reload.each do |file, _|
+** Processing line: ~ @file_mtimes[file] ||= {}~
+- Inside source: true
+*** True Line Result
+ @file_mtimes[file] ||= {}
+** Processing line: ~ @file_mtimes[file].current = @ffi_file.mtime(file)~
+- Inside source: true
+*** True Line Result
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+** Processing line: ~ @file_mtimes[file].last = @file_mtimes[file].current~
+- Inside source: true
+*** True Line Result
+ @file_mtimes[file].last = @file_mtimes[file].current
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- @file_mtimes[current_key] = @ffi_file.mtime(file)
-** Processing line: ~ return if !force && @file_mtimes[last_key] == @file_mtimes[current_key]~
+ end
+** Processing line: ~ end~
- Inside source: true
*** True Line Result
- return if !force && @file_mtimes[last_key] == @file_mtimes[current_key]
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def reload_if_needed file, force = false~
+- Inside source: true
+*** True Line Result
+ def reload_if_needed file, force = false
+** Processing line: ~ @file_mtimes[file] ||= { current: @ffi_file.mtime(file), last: @ffi_file.mtime(file) }~
+- Inside source: true
+*** True Line Result
+ @file_mtimes[file] ||= { current: @ffi_file.mtime(file), last: @ffi_file.mtime(file) }
+** Processing line: ~ @file_mtimes[file].current = @ffi_file.mtime(file)~
+- Inside source: true
+*** True Line Result
+ @file_mtimes[file].current = @ffi_file.mtime(file)
+** Processing line: ~ return if !force && @file_mtimes[file].current == @file_mtimes[file].last~
+- Inside source: true
+*** True Line Result
+ return if !force && @file_mtimes[file].current == @file_mtimes[file].last
** Processing line: ~ on_load_succeeded file if reload_ruby_file file~
- Inside source: true
*** True Line Result
on_load_succeeded file if reload_ruby_file file
-** Processing line: ~ @file_mtimes[last_key] = @file_mtimes[current_key]~
+** Processing line: ~ @file_mtimes[file].last = @file_mtimes[file].current~
- Inside source: true
*** True Line Result
- @file_mtimes[last_key] = @file_mtimes[current_key]
+ @file_mtimes[file].last = @file_mtimes[file].current
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -172775,6 +181862,102 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ def char_byte~
+- Inside source: true
+*** True Line Result
+ def char_byte
+** Processing line: ~ return nil if self.length == 0~
+- Inside source: true
+*** True Line Result
+ return nil if self.length == 0
+** Processing line: ~ c = self.each_char.first.bytes~
+- Inside source: true
+*** True Line Result
+ c = self.each_char.first.bytes
+** Processing line: ~ c = c.first if c.is_a? Enumerable~
+- Inside source: true
+*** True Line Result
+ c = c.first if c.is_a? Enumerable
+** Processing line: ~ c~
+- Inside source: true
+*** True Line Result
+ c
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def insert_character_at index, char~
+- Inside source: true
+*** True Line Result
+ def insert_character_at index, char
+** Processing line: ~ t = each_char.to_a~
+- Inside source: true
+*** True Line Result
+ t = each_char.to_a
+** Processing line: ~ t = (t.insert index, char)~
+- Inside source: true
+*** True Line Result
+ t = (t.insert index, char)
+** Processing line: ~ t.join~
+- Inside source: true
+*** True Line Result
+ t.join
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def excluding_character_at index~
+- Inside source: true
+*** True Line Result
+ def excluding_character_at index
+** Processing line: ~ t = each_char.to_a~
+- Inside source: true
+*** True Line Result
+ t = each_char.to_a
+** Processing line: ~ t.delete_at index~
+- Inside source: true
+*** True Line Result
+ t.delete_at index
+** Processing line: ~ t.join~
+- Inside source: true
+*** True Line Result
+ t.join
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def excluding_last_character~
+- Inside source: true
+*** True Line Result
+ def excluding_last_character
+** Processing line: ~ return "" if self.length <= 1~
+- Inside source: true
+*** True Line Result
+ return "" if self.length <= 1
+** Processing line: ~ return excluding_character_at(self.length - 1)~
+- Inside source: true
+*** True Line Result
+ return excluding_character_at(self.length - 1)
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
** Processing line: ~ def end_with_bang?~
- Inside source: true
*** True Line Result
@@ -173647,10 +182830,10 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
log "**** Test name: :#{h[:m]}"
-** Processing line: ~ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"~
+** Processing line: ~ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}\n#{h[:e].__backtrace_to_org__}"~
- Inside source: true
*** True Line Result
- log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"
+ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}\n#{h[:e].__backtrace_to_org__}"
** Processing line: ~ end~
- Inside source: true
*** True Line Result
@@ -174475,6 +183658,142 @@ Follows is a source code listing for all files that have been open sourced. This
- Inside source: true
*** True Line Result
+** Processing line: ~ class Wizard~
+- Inside source: true
+*** True Line Result
+ class Wizard
+** Processing line: ~ def metadata_file_path~
+- Inside source: true
+*** True Line Result
+ def metadata_file_path
+** Processing line: ~ "metadata/game_metadata.txt"~
+- Inside source: true
+*** True Line Result
+ "metadata/game_metadata.txt"
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def get_metadata~
+- Inside source: true
+*** True Line Result
+ def get_metadata
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+- Inside source: true
+*** True Line Result
+ metadata = $gtk.read_file metadata_file_path
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ if !metadata~
+- Inside source: true
+*** True Line Result
+ if !metadata
+** Processing line: ~ write_blank_metadata~
+- Inside source: true
+*** True Line Result
+ write_blank_metadata
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+- Inside source: true
+*** True Line Result
+ metadata = $gtk.read_file metadata_file_path
+** Processing line: ~ end~
+- Inside source: true
+*** True Line Result
+ end
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~
+- Inside source: true
+*** True Line Result
+ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ {~
+- Inside source: true
+*** True Line Result
+ {
+** Processing line: ~ dev_id: dev_id.strip.gsub("#", "").gsub("devid=", ""),~
+- Inside source: true
+*** True Line Result
+ dev_id: dev_id.strip.gsub("#", "").gsub("devid=", ""),
+** Processing line: ~ dev_title: dev_title.strip.gsub("#", "").gsub("devtitle=", ""),~
+- Inside source: true
+*** True Line Result
+ dev_title: dev_title.strip.gsub("#", "").gsub("devtitle=", ""),
+** Processing line: ~ game_id: game_id.strip.gsub("#", "").gsub("gameid=", ""),~
+- Inside source: true
+*** True Line Result
+ game_id: game_id.strip.gsub("#", "").gsub("gameid=", ""),
+** Processing line: ~ game_title: game_title.strip.gsub("#", "").gsub("gametitle=", ""),~
+- Inside source: true
+*** True Line Result
+ game_title: game_title.strip.gsub("#", "").gsub("gametitle=", ""),
+** Processing line: ~ version: version.strip.gsub("#", "").gsub("version=", ""),~
+- Inside source: true
+*** True Line Result
+ version: version.strip.gsub("#", "").gsub("version=", ""),
+** Processing line: ~ icon: icon.strip.gsub("#", "").gsub("icon=", "")~
+- Inside source: true
+*** True Line Result
+ icon: icon.strip.gsub("#", "").gsub("icon=", "")
+** 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: ~ class WizardException < Exception~
+- Inside source: true
+*** True Line Result
+ class WizardException < Exception
+** Processing line: ~ attr_accessor :console_primitives~
+- Inside source: true
+*** True Line Result
+ attr_accessor :console_primitives
+** Processing line: ~~
+- Inside source: true
+*** True Line Result
+
+** Processing line: ~ def initialize *console_primitives~
+- Inside source: true
+*** True Line Result
+ def initialize *console_primitives
+** Processing line: ~ @console_primitives = console_primitives~
+- Inside source: true
+*** True Line Result
+ @console_primitives = console_primitives
+** 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: ~ module GTK~
- Inside source: true
*** True Line Result
@@ -174554,14 +183873,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~#+end_src~
- PRE end detected.
** Processing line: ~~
-** Processing line: ~[[docs_search.gif]]~
-- P detected.
-- Determining if line is a header.
-- Line does not appear to be a header.
-- Formatting line: ~[[docs_search.gif]]~
-- Line's tilde count is: 0
-- Line contains link marker: true
-- LINK detected.
** Processing line: ~~
** Processing line: ~* Hello World~
- H1 detected.
@@ -174644,22 +183955,36 @@ Follows is a source code listing for all files that have been open sourced. This
- BLOCKQUOTE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~* Watch Some Intro Videos~
+** Processing line: ~* Intro Videos~
- H1 detected.
- Determining if line is a header.
- Line contains ~* ~... gsub-ing empty string
-- Formatting line: ~Watch Some Intro Videos~
+- Formatting line: ~Intro Videos~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
-** Processing line: ~Each video is only 20 minutes and all of them will fit into a lunch break. So please watch them:~
+** Processing line: ~Here are some videos to help you get the lay of the land.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~Each video is only 20 minutes and all of them will fit into a lunch break. So please watch them:~
+- Formatting line: ~Here are some videos to help you get the lay of the land.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~** Quick Api Tour~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~Quick Api Tour~
+- 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: ~Quick Api Tour~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
+** Processing line: ~~
** Processing line: ~1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~
- OL start detected.
- LI detected.
@@ -174669,7 +183994,23 @@ 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: ~2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~
+** Processing line: ~~
+** Processing line: ~** If You Are Completely New to Ruby and Programming~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~If You Are Completely New to Ruby and Programming~
+- 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: ~If You Are Completely New to Ruby and Programming~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~1. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~
+- OL start detected.
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
@@ -174677,7 +184018,7 @@ 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: ~3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~
+** Processing line: ~2. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
@@ -174685,19 +184026,51 @@ 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: ~The second and third videos are not required if you are proficient with Ruby, but *definitely* watch the first one.~
-- OL end detected.
-- P detected.
+** Processing line: ~3. You may also want to try this free course provided at [[http://dragonruby.school]].~
+- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~The second and third videos are not required if you are proficient with Ruby, but *definitely* watch the first one.~
+- Formatting line: ~ You may also want to try this free course provided at [[http://dragonruby.school]].~
+- Line's tilde count is: 0
+- Line contains link marker: true
+- LINK detected.
+** Processing line: ~~
+** Processing line: ~** If You Have Game Dev Experience~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~If You Have Game Dev Experience~
- Line's tilde count is: 0
- Line contains link marker: false
-** Processing line: ~You may also want to try this free course provided at [[http://dragonruby.school]].~
-- P detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~If You Have Game Dev Experience~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~1. Building Tetris - Part 1: [[https://youtu.be/xZMwRSbC4rY]]~
+- OL start detected.
+- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~You may also want to try this free course provided at [[http://dragonruby.school]].~
+- Formatting line: ~ Building Tetris - Part 1: [[https://youtu.be/xZMwRSbC4rY]]~
+- Line's tilde count is: 0
+- Line contains link marker: true
+- LINK detected.
+** Processing line: ~2. Building Tetris - Part 2: [[https://youtu.be/C3LLzDUDgz4]]~
+- LI detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~ Building Tetris - Part 2: [[https://youtu.be/C3LLzDUDgz4]]~
+- Line's tilde count is: 0
+- Line contains link marker: true
+- LINK detected.
+** Processing line: ~3. Low Res Game Jam Tutorial: [[https://youtu.be/pCI90ukKCME]]~
+- LI detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~ Low Res Game Jam Tutorial: [[https://youtu.be/pCI90ukKCME]]~
- Line's tilde count is: 0
- Line contains link marker: true
- LINK detected.
@@ -175483,11 +184856,11 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
-** Processing line: ~To deploy to Android, you need to have an Android emulator/device, and a environment that is able to run Android SDK. ~dragonruby-publish~ will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:~
+** Processing line: ~To deploy to Android, you need to have an Android emulator/device, and an environment that is able to run Android SDK. ~dragonruby-publish~ will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~To deploy to Android, you need to have an Android emulator/device, and a environment that is able to run Android SDK. ~dragonruby-publish~ will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:~
+- Formatting line: ~To deploy to Android, you need to have an Android emulator/device, and an environment that is able to run Android SDK. ~dragonruby-publish~ will create an APK for you. From there, you can sign the APK and install it to your device. The signing and installation procedure varies from OS to OS. Here's an example of what the command might look like:~
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
@@ -175510,11 +184883,11 @@ 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: false
** Processing line: ~~
-** Processing line: ~The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principals.~
+** Processing line: ~The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principles.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principals.~
+- Formatting line: ~The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principles.~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
@@ -175579,11 +184952,11 @@ Follows is a source code listing for all files that have been open sourced. This
- Formatting line: ~There is a programming idiom in software called "The Pit of Success". The term normalizes upfront pain as a necessity/requirement in the hopes that the investment will yield dividends "when you become successful" or "when the code becomes more complicated". This approach to development is strongly discouraged by us. It leads to over-architected and unnecessary code; creates barriers to rapid prototyping and shipping a game; and overwhelms beginners who are new to the engine or programming in general.~
- Line's tilde count is: 0
- Line contains link marker: false
-** Processing line: ~DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and string entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).~
+** Processing line: ~DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs that take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and strict entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and string entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).~
+- Formatting line: ~DragonRuby's philosophy is to provide multiple options across the "make it fast" vs "make it right" spectrum, with incremental/intuitive transitions between the options provided. A concrete example of this philosophy would be render primitives: the spectrum of options allows renderable constructs that take the form of tuples/arrays (easy to pickup, simple, and fast to code/prototype with), hashes (a little more work, but gives you the ability to add additional properties), open and strict entities (more work than hashes, but yields cleaner apis), and finally - if you really need full power/flexibility in rendering - classes (which take the most amount of code and programming knowledge to create).~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
@@ -175953,11 +185326,11 @@ Follows is a source code listing for all files that have been open sourced. This
- Formatting line: ~The elevator pitch is:~
- Line's tilde count is: 0
- Line contains link marker: false
-** Processing line: ~DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Scadia.~
+** Processing line: ~DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Stadia.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Scadia.~
+- Formatting line: ~DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Stadia.~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~~
@@ -176171,11 +185544,11 @@ 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: false
** Processing line: ~~
-** Processing line: ~- All ~puts~ statements will also be saved to ~logs/log.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.~
+** Processing line: ~- All ~puts~ statements will also be saved to ~logs/puts.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~All ~puts~ statements will also be saved to ~logs/log.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.~
+- Formatting line: ~All ~puts~ statements will also be saved to ~logs/puts.txt~. So if you want to stay in your editor and not look at the terminal, or the DragonRuby Console, you can ~tail~ this file.~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
@@ -176252,11 +185625,11 @@ Follows is a source code listing for all files that have been open sourced. This
- Formatting line: ~ DragonRuby is hot loaded which gives you a very fast feedback loop (if the game throws an exception, it's because of the code you just added).~
- Line's tilde count is: 0
- Line contains link marker: false
-** Processing line: ~2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recoding by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.~
+** Processing line: ~2. Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recording by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~ Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recoding by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.~
+- Formatting line: ~ Use ~./dragonruby mygame --record~ to create a game play recording that you can use to find the exception (you can replay a recording by executing ~./dragonruby mygame --replay last_replay.txt~ or through the DragonRuby Console using ~$gtk.recording.start_replay "last_replay.txt"~.~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
@@ -176319,11 +185692,11 @@ 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: ~On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Every one chases the new and shiny.~
+** Processing line: ~On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Everyone chases the new and shiny.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Every one chases the new and shiny.~
+- Formatting line: ~On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Everyone chases the new and shiny.~
- Line's tilde count is: 0
- Line contains link marker: false
** Processing line: ~What really matters is _quality/maturity_. Here is the latest (StackOverflow Survey sorted by highest paid developers)[https://insights.stackoverflow.com/survey/2019#top-paying-technologies].~
@@ -176558,13 +185931,14 @@ 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: false
** Processing line: ~~
-** Processing line: ~You can try our [web-based sandbox environment](). But it won't do the runtime justice. Or just come to our [Slack]() or [Discord]() channel and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.~
+** Processing line: ~You can try our web-based sandbox environment at [[http://fiddle.dragonruby.org]]. But it won't do the runtime justice. Or just come to our Discord Channel at [[http://discord.dragonruby.org]] and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~You can try our [web-based sandbox environment](). But it won't do the runtime justice. Or just come to our [Slack]() or [Discord]() channel and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.~
+- Formatting line: ~You can try our web-based sandbox environment at [[http://fiddle.dragonruby.org]]. But it won't do the runtime justice. Or just come to our Discord Channel at [[http://discord.dragonruby.org]] and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing.~
- Line's tilde count is: 0
-- Line contains link marker: false
+- Line contains link marker: true
+- LINK detected.
** Processing line: ~Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so.~
- P detected.
- Determining if line is a header.
@@ -176843,12 +186217,21 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ flip_vertically: false,~
** Processing line: ~ flip_horizontally: false,~
** Processing line: ~ angle_anchor_x: 0.5,~
-** Processing line: ~ angle_anchor_y: 1.0~
+** Processing line: ~ angle_anchor_y: 1.0,~
+** Processing line: ~ blendmode_enum: 1~
** Processing line: ~ }~
** Processing line: ~ end~
** Processing line: ~#+end_src~
- PRE end detected.
** Processing line: ~~
+** Processing line: ~The ~blendmode_enum~ value can be set to ~0~ (no blending), ~1~ (alpha blending), ~2~ (additive blending), ~3~ (modulo blending), ~4~ (multiply blending).~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~The ~blendmode_enum~ value can be set to ~0~ (no blending), ~1~ (alpha blending), ~2~ (additive blending), ~3~ (modulo blending), ~4~ (multiply blending).~
+- Line's tilde count is: 12
+- Line contains link marker: false
+- CODE detected.
** Processing line: ~You can represent a sprite as an ~object~:~
- P detected.
- Determining if line is a header.
@@ -176866,7 +186249,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ :source_x, :source_y, :source_w, :source_h,~
** Processing line: ~ :tile_x, :tile_y, :tile_w, :tile_h,~
** Processing line: ~ :flip_horizontally, :flip_vertically,~
-** Processing line: ~ :angle_anchor_x, :angle_anchor_y~
+** Processing line: ~ :angle_anchor_x, :angle_anchor_y, :blendmode_enum~
** Processing line: ~~
** Processing line: ~ def primitive_marker~
** Processing line: ~ :sprite~
@@ -177044,16 +186427,17 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE start detected.
** Processing line: ~ def tick args~
** Processing line: ~ args.outputs.labels << {~
-** Processing line: ~ x: 200,~
-** Processing line: ~ y: 550,~
-** Processing line: ~ text: "dragonruby",~
-** Processing line: ~ size_enum: 2,~
-** Processing line: ~ alignment_enum: 1,~
-** Processing line: ~ r: 155,~
-** Processing line: ~ g: 50,~
-** Processing line: ~ b: 50,~
-** Processing line: ~ a: 255,~
-** Processing line: ~ font: "fonts/manaspc.ttf",~
+** Processing line: ~ x: 200,~
+** Processing line: ~ y: 550,~
+** Processing line: ~ text: "dragonruby",~
+** Processing line: ~ size_enum: 2,~
+** Processing line: ~ alignment_enum: 1,~
+** Processing line: ~ r: 155,~
+** Processing line: ~ g: 50,~
+** Processing line: ~ b: 50,~
+** Processing line: ~ a: 255,~
+** Processing line: ~ font: "fonts/manaspc.ttf",~
+** Processing line: ~ vertical_alignment_enum: 0, # 0 is bottom, 1 is middle, 2 is top~
** Processing line: ~ # You can add any properties you like (this will be ignored/won't cause errors)~
** Processing line: ~ game_data_one: "Something",~
** Processing line: ~ game_data_two: {~
@@ -177109,6 +186493,41 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~** Rendering Labels With New Line Characters And Wrapping~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~Rendering Labels With New Line Characters And Wrapping~
+- 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: ~Rendering Labels With New Line Characters And Wrapping~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~You can use a strategy like the following to create multiple labels from a String.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~You can use a strategy like the following to create multiple labels from a String.~
+- 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: ~ long_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elitteger dolor velit, ultricies vitae libero vel, aliquam imperdiet enim."~
+** Processing line: ~ max_character_length = 30~
+** Processing line: ~ long_strings_split = args.string.wrapped_lines long_string, max_character_length~
+** Processing line: ~ args.outputs.labels << long_strings_split.map_with_index do |s, i|~
+** Processing line: ~ { x: 10, y: 600 - (i * 20), text: s }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~** How To Play A Sound~
- H2 detected.
- Determining if line is a header.
@@ -177792,11 +187211,11 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
-** Processing line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.up~ and ~args.inputs.down~.~
+** Processing line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.down~ and ~args.inputs.up~.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.up~ and ~args.inputs.down~.~
+- Formatting line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.down~ and ~args.inputs.up~.~
- Line's tilde count is: 10
- Line contains link marker: false
- CODE detected.
@@ -178053,12 +187472,44 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
-** Processing line: ~Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred. ***** ~.x~ Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis. ***** ~.y~ Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.~
+** Processing line: ~Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred. ***** ~.x~ Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis. ***** ~.y~ Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.~
-- Line's tilde count is: 10
+- Formatting line: ~Represents the mouse wheel. Returns ~nil~ if no mouse wheel actions occurred.~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~***** ~.x~~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~***** ~.x~~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Returns the negative or positive number if the mouse wheel has changed in the ~x~ axis.~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~***** ~.y~~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~***** ~.y~~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Returns the negative or positive number if the mouse wheel has changed in the ~y~ axis.~
+- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
** Processing line: ~**** ~.click~ OR ~.down~, ~.previous_click~, ~.up~~
@@ -178104,18 +187555,20 @@ Follows is a source code listing for all files that have been open sourced. This
- Formatting line: ~Represents controllers connected to the usb ports.~
- Line's tilde count is: 0
- Line contains link marker: false
-** Processing line: ~**** ~.up~
+** Processing line: ~**** ~.up~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.up~
-- Line's tilde count is: 1
+- Formatting line: ~~.up~~
+- 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: ~~.up~
-- Line's tilde count is: 1
+- Formatting line: ~~.up~~
+- Line's tilde count is: 2
- Line contains link marker: false
+- CODE detected.
** Processing line: ~Returns ~true~ if ~up~ is pressed or held on the directional or left analog.~
- P detected.
- Determining if line is a header.
@@ -178124,18 +187577,20 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.down~
+** Processing line: ~**** ~.down~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.down~
-- Line's tilde count is: 1
+- Formatting line: ~~.down~~
+- 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: ~~.down~
-- Line's tilde count is: 1
+- Formatting line: ~~.down~~
+- Line's tilde count is: 2
- Line contains link marker: false
+- CODE detected.
** Processing line: ~Returns ~true~ if ~down~ is pressed or held on the directional or left analog.~
- P detected.
- Determining if line is a header.
@@ -178144,18 +187599,20 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.left~
+** Processing line: ~**** ~.left~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.left~
-- Line's tilde count is: 1
+- Formatting line: ~~.left~~
+- 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: ~~.left~
-- Line's tilde count is: 1
+- Formatting line: ~~.left~~
+- Line's tilde count is: 2
- Line contains link marker: false
+- CODE detected.
** Processing line: ~Returns ~true~ if ~left~ is pressed or held on the directional or left analog.~
- P detected.
- Determining if line is a header.
@@ -178164,18 +187621,20 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.right~
+** Processing line: ~**** ~.right~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.right~
-- Line's tilde count is: 1
+- Formatting line: ~~.right~~
+- 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: ~~.right~
-- Line's tilde count is: 1
+- Formatting line: ~~.right~~
+- Line's tilde count is: 2
- Line contains link marker: false
+- CODE detected.
** Processing line: ~Returns ~true~ if ~right~ is pressed or held on the directional or left analog.~
- P detected.
- Determining if line is a header.
@@ -178184,18 +187643,20 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.left_right~
+** Processing line: ~**** ~.left_right~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.left_right~
-- Line's tilde count is: 1
+- Formatting line: ~~.left_right~~
+- 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: ~~.left_right~
-- Line's tilde count is: 1
+- Formatting line: ~~.left_right~~
+- Line's tilde count is: 2
- Line contains link marker: false
+- CODE detected.
** Processing line: ~Returns ~-1~ (left), ~0~ (neutral), or ~+1~ (right) depending on results of ~args.inputs.controller_(one|two).left~ and ~args.inputs.controller_(one|two).right~.~
- P detected.
- Determining if line is a header.
@@ -178204,18 +187665,20 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 10
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.up_down~
+** Processing line: ~**** ~.up_down~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.up_down~
-- Line's tilde count is: 1
+- Formatting line: ~~.up_down~~
+- 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: ~~.up_down~
-- Line's tilde count is: 1
+- Formatting line: ~~.up_down~~
+- Line's tilde count is: 2
- Line contains link marker: false
+- CODE detected.
** Processing line: ~Returns ~-1~ (down), ~0~ (neutral), or ~+1~ (up) depending on results of ~args.inputs.controller_(one|two).up~ and ~args.inputs.controller_(one|two).down~.~
- P detected.
- Determining if line is a header.
@@ -178312,17 +187775,17 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.directional_up)~~
+** Processing line: ~**** ~.directional_up~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.directional_up)~~
+- Formatting line: ~~.directional_up~~
- 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: ~~.directional_up)~~
+- Formatting line: ~~.directional_up~~
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
@@ -178334,17 +187797,17 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.directional_down)~~
+** Processing line: ~**** ~.directional_down~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.directional_down)~~
+- Formatting line: ~~.directional_down~~
- 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: ~~.directional_down)~~
+- Formatting line: ~~.directional_down~~
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
@@ -178356,17 +187819,17 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.directional_left)~~
+** Processing line: ~**** ~.directional_left~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.directional_left)~~
+- Formatting line: ~~.directional_left~~
- 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: ~~.directional_left)~~
+- Formatting line: ~~.directional_left~~
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
@@ -178378,17 +187841,17 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 4
- Line contains link marker: false
- CODE detected.
-** Processing line: ~**** ~.directional_right)~~
+** Processing line: ~**** ~.directional_right~~
- H4 detected.
- Determining if line is a header.
- Line contains ~**** ~... gsub-ing empty string
-- Formatting line: ~~.directional_right)~~
+- Formatting line: ~~.directional_right~~
- 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: ~~.directional_right)~~
+- Formatting line: ~~.directional_right~~
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
@@ -179780,6 +189243,48 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
+** Processing line: ~Here are some general notes with regards to the arguments these geometric functions accept.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Here are some general notes with regards to the arguments these geometric functions accept.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~1. ~Rectangles~ can be represented as an ~Array~ with four (or more) values ~[x, y, w, h]~, as a ~Hash~ ~{ x:, y:, w:, h: }~ or an object that responds to ~x~, ~y~, ~w~, and ~h~.~
+- OL start detected.
+- LI detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~ ~Rectangles~ can be represented as an ~Array~ with four (or more) values ~[x, y, w, h]~, as a ~Hash~ ~{ x:, y:, w:, h: }~ or an object that responds to ~x~, ~y~, ~w~, and ~h~.~
+- Line's tilde count is: 18
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~2. ~Points~ can be represent as an ~Array~ with two (or more) values ~[x, y]~, as a ~Hash~ ~{ x:, y:}~ or an object that responds to ~x~, and ~y~.~
+- LI detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~ ~Points~ can be represent as an ~Array~ with two (or more) values ~[x, y]~, as a ~Hash~ ~{ x:, y:}~ or an object that responds to ~x~, and ~y~.~
+- Line's tilde count is: 14
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~3. ~Lines~ can be represented as an ~Array~ with four (or more) values ~[x, y, x2, y2]~, as a ~Hash~ ~{ x:, y:, x2:, y2: }~ or an object that responds to ~x~, ~y~, ~x2~, and ~y2~.~
+- LI detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~ ~Lines~ can be represented as an ~Array~ with four (or more) values ~[x, y, x2, y2]~, as a ~Hash~ ~{ x:, y:, x2:, y2: }~ or an object that responds to ~x~, ~y~, ~x2~, and ~y2~.~
+- Line's tilde count is: 18
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~4. ~Angles~ are represented as degrees (not radians).~
+- LI detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~ ~Angles~ are represented as degrees (not radians).~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~~
** Processing line: ~*** ~.inside_rect? rect_1, rect_2~~
- H3 detected.
- Determining if line is a header.
@@ -182066,11 +191571,11 @@ 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: false
** Processing line: ~~
-** Processing line: ~The value for the color and alpha is an number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.~
+** Processing line: ~The value for the color and alpha is a number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~The value for the color and alpha is an number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.~
+- Formatting line: ~The value for the color and alpha is a number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
@@ -182144,11 +191649,11 @@ 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: false
** Processing line: ~~
-** Processing line: ~You can also create a class with solid/border 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.~
+** Processing line: ~You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class.~
- P detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~You can also create a class with solid/border 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.~
+- Formatting line: ~You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class.~
- Line's tilde count is: 2
- Line contains link marker: false
- CODE detected.
@@ -182252,6 +191757,205 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~* DOCS: ~GTK::Outputs#sprites~~
+- H1 detected.
+- Determining if line is a header.
+- Line contains ~* ~... gsub-ing empty string
+- Formatting line: ~DOCS: ~GTK::Outputs#sprites~~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~~
+** Processing line: ~Add primitives to this collection to render a sprite to the screen.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Add primitives to this collection to render a sprite to the screen.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~** Rendering a sprite using an Array~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~Rendering a sprite using an Array~
+- 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: ~Rendering a sprite using an Array~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~Creates a sprite of a white circle located at 100, 100. 160 pixels wide and 90 pixels tall.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Creates a sprite of a white circle located at 100, 100. 160 pixels wide and 90 pixels tall.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src~
+- PRE start detected.
+** Processing line: ~ def tick args~
+** Processing line: ~ # X Y WIDTH HEIGHT PATH~
+** Processing line: ~ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png]~
+** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~** Rendering a sprite using an Array with colors and alpha~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~Rendering a sprite using an Array with colors and alpha~
+- 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: ~Rendering a sprite using an Array with colors and alpha~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~The value for the color and alpha is a number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~The value for the color and alpha is a number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified.~
+- Line's tilde count is: 6
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~Creates a green circle sprite with an opacity of 50%.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Creates a green circle sprite with an opacity of 50%.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src~
+- PRE start detected.
+** Processing line: ~ def tick args~
+** Processing line: ~ # X Y WIDTH HEIGHT PATH ANGLE ALPHA RED GREEN BLUE~
+** Processing line: ~ args.outputs.sprites << [100, 100, 160, 90, "sprites/circle/white.png", 0, 128, 0, 255, 0]~
+** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~** Rendering a sprite using a Hash~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~Rendering a sprite using a Hash~
+- 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: ~Rendering a sprite using a Hash~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~If you want a more readable invocation. You can use the following hash to create a sprite. Any parameters that are not specified will be given a default value. The keys of the hash can be provided in any order.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~If you want a more readable invocation. You can use the following hash to create a sprite. Any parameters that are not specified will be given a default value. The keys of the hash can be provided in any order.~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src~
+- PRE start detected.
+** Processing line: ~ def tick args~
+** Processing line: ~ args.outputs.sprites << {~
+** Processing line: ~ x: 0,~
+** Processing line: ~ y: 0,~
+** Processing line: ~ w: 100,~
+** Processing line: ~ h: 100,~
+** Processing line: ~ path: "sprites/circle/white.png",~
+** Processing line: ~ angle: 0,~
+** Processing line: ~ a: 255,~
+** Processing line: ~ r: 0,~
+** Processing line: ~ g: 255,~
+** Processing line: ~ b: 0~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~** Rendering a solid using a Class~
+- H2 detected.
+- Determining if line is a header.
+- Line contains ~** ~... gsub-ing empty string
+- Formatting line: ~Rendering a solid using a Class~
+- 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: ~Rendering a solid using a Class~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class.~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~You can also create a class with solid/border properties and render it as a primitive. ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class.~
+- Line's tilde count is: 2
+- Line contains link marker: false
+- CODE detected.
+** Processing line: ~Here is an example:~
+- P detected.
+- Determining if line is a header.
+- Line does not appear to be a header.
+- Formatting line: ~Here is an example:~
+- Line's tilde count is: 0
+- Line contains link marker: false
+** Processing line: ~~
+** Processing line: ~#+begin_src~
+- PRE start detected.
+** Processing line: ~ # Create type with ALL sprite properties AND primitive_marker~
+** Processing line: ~ class Sprite~
+** Processing line: ~ attr_accessor :x, :y, :w, :h, :path, :angle, :angle_anchor_x, :angle_anchor_y, :tile_x, :tile_y, :tile_w, :tile_h, :source_x, :source_y, :source_w, :source_h, :flip_horizontally, :flip_vertically, :a, :r, :g, :b~
+** Processing line: ~~
+** Processing line: ~ def primitive_marker~
+** Processing line: ~ :sprite~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Inherit from type~
+** Processing line: ~ class Circle < Sprite~
+** Processing line: ~ # constructor~
+** Processing line: ~ def initialize x, y, size, path~
+** Processing line: ~ self.x = x~
+** Processing line: ~ self.y = y~
+** Processing line: ~ self.w = size~
+** Processing line: ~ self.h = size~
+** Processing line: ~ self.path = path~
+** Processing line: ~ end~
+** Processing line: ~ def serlialize~
+** Processing line: ~ {x:self.x, y:self.y, w:self.w, h:self.h, path:self.path}~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def inspect~
+** Processing line: ~ serlialize.to_s~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_s~
+** Processing line: ~ serlialize.to_s~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ def tick args~
+** Processing line: ~ # render circle sprite~
+** Processing line: ~ args.outputs.sprites << Circle.new(10, 10, 32,"sprites/circle/white.png")~
+** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~* DOCS: ~GTK::Outputs#screenshots~~
- H1 detected.
- Determining if line is a header.
@@ -182515,51 +192219,51 @@ Follows is a source code listing for all files that have been open sourced. This
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
-** Processing line: ~- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~w~: Width of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- Formatting line: ~~w~: Width of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
-** Processing line: ~- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~h~: Height of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- Formatting line: ~~h~: Height of the point that always returns ~0~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
-** Processing line: ~- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~left~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- Formatting line: ~~left~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
-** Processing line: ~- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~right~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- Formatting line: ~~right~: This value is the same as ~x~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
-** Processing line: ~- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~top~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- Formatting line: ~~top~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
-** Processing line: ~- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+** Processing line: ~- ~bottom~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- LI detected.
- Determining if line is a header.
- Line does not appear to be a header.
-- Formatting line: ~~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~
+- Formatting line: ~~bottom~: This value is the same as ~y~ (included so that it can seamlessly work with ~GTK::Geometry~ functions).~
- Line's tilde count is: 6
- Line contains link marker: false
- CODE detected.
@@ -184489,7 +194193,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 0,~
** Processing line: ~ b: 200,~
** Processing line: ~ a: 255,~
-** Processing line: ~ font: "manaspc.ttf" }.label~
+** Processing line: ~ font: "manaspc.ttf" }.label!~
** Processing line: ~~
** Processing line: ~ # Primitives can hold anything, and can be given a label in the following forms~
** Processing line: ~ args.outputs.primitives << [690 + 150, 330 - 80, "Custom font (.primitives Array)", 0, 1, 125, 0, 200, 255, "manaspc.ttf" ].label~
@@ -184503,7 +194207,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 0,~
** Processing line: ~ b: 200,~
** Processing line: ~ a: 255,~
-** Processing line: ~ font: "manaspc.ttf" }.label~
+** Processing line: ~ font: "manaspc.ttf" }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def tick_instructions args, text, y = 715~
@@ -184802,801 +194506,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: ~*** Rendering Basics - Audio Mixer - main.rb~
-- H3 detected.
-- Determining if line is a header.
-- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Rendering Basics - Audio Mixer - 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: ~Rendering Basics - Audio Mixer - 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/01_rendering_basics/06_audio_mixer/app/main.rb~
-** Processing line: ~ $gtk.reset~
-** Processing line: ~~
-** Processing line: ~ $boxsize = 30~
-** Processing line: ~~
-** Processing line: ~ def render_sources args~
-** Processing line: ~ mouse_in_panel = (args.state.selected != 0) && args.inputs.mouse.position.inside_rect?([900, 450, 340, 250])~
-** Processing line: ~ mouse_new_down = (args.state.mouse_held == 1)~
-** Processing line: ~~
-** Processing line: ~ if (mouse_new_down && !mouse_in_panel)~
-** Processing line: ~ args.state.selected = 0 # will reset below if we hit something.~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ args.audio.keys.each { |k|~
-** Processing line: ~ s = args.audio[k]~
-** Processing line: ~~
-** Processing line: ~ if (mouse_new_down) && !mouse_in_panel && args.inputs.mouse.position.inside_rect?([s[:screenx], s[:screeny], $boxsize, $boxsize])~
-** Processing line: ~ args.state.selected = k~
-** Processing line: ~ args.state.dragging_source = true~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ isselected = (k == args.state.selected)~
-** Processing line: ~~
-** Processing line: ~ if isselected && args.state.dragging_source~
-** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
-** Processing line: ~ # actual screen position so it doesn't scale weirdly vs your mouse.~
-** Processing line: ~ s[:screenx] = args.inputs.mouse.x - ($boxsize / 2)~
-** Processing line: ~ s[:screeny] = args.inputs.mouse.y - ($boxsize / 2)~
-** Processing line: ~~
-** Processing line: ~ s[:screeny] = 50 if s[:screeny] < 50~
-** Processing line: ~ s[:screeny] = (719 - $boxsize) if s[:screeny] > (719 - $boxsize)~
-** Processing line: ~ s[:screenx] = 0 if s[:screenx] < 0~
-** Processing line: ~ s[:screenx] = (1279 - $boxsize) if s[:screenx] > (1279 - $boxsize)~
-** Processing line: ~~
-** Processing line: ~ s[:x] = ((s[:screenx] / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
-** Processing line: ~ s[:y] = ((s[:screeny] / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]~
-** Processing line: ~ args.outputs.primitives << [s[:screenx], s[:screeny], $boxsize, $boxsize, *color].solid~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def render_panel args~
-** Processing line: ~ s = args.audio[args.state.selected]~
-** Processing line: ~ return if s.nil?~
-** Processing line: ~ mouse_down = (args.state.mouse_held > 0)~
-** Processing line: ~~
-** Processing line: ~ args.outputs.primitives << [900, 450, 340, 250, 127, 127, 200, 255].solid~
-** Processing line: ~ args.outputs.primitives << [1075, 690, "Source ##{args.state.selected}", 3, 1, 255, 255, 255].label~
-** Processing line: ~ args.outputs.primitives << [910, 660, 1230, 660, 255, 255, 255].line~
-** Processing line: ~ args.outputs.primitives << [910, 650, "screen: (#{s[:screenx].to_i}, #{s[:screeny].to_i})", 0, 0, 255, 255, 255].label~
-** Processing line: ~ args.outputs.primitives << [910, 625, "position: (#{s[:x].round(5).to_s[0..6]}, #{s[:y].round(5).to_s[0..6]})", 0, 0, 255, 255, 255].label~
-** Processing line: ~~
-** Processing line: ~ slider = [1022, 586, 200, 7]~
-** Processing line: ~ if mouse_down && args.inputs.mouse.position.inside_rect?(slider)~
-** Processing line: ~ s[:pitch] = ((args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)) * 2.0~
-** Processing line: ~ end~
-** Processing line: ~ slidercolor = (s[:pitch] / 2.0) * 255~
-** Processing line: ~ args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid~
-** Processing line: ~ args.outputs.primitives << [910, 600, "pitch: #{s[:pitch].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label~
-** Processing line: ~~
-** Processing line: ~ slider = [1022, 561, 200, 7]~
-** Processing line: ~ if mouse_down && args.inputs.mouse.position.inside_rect?(slider)~
-** Processing line: ~ s[:gain] = (args.inputs.mouse.x - slider[0]).to_f / (slider[2]-1.0)~
-** Processing line: ~ end~
-** Processing line: ~ slidercolor = s[:gain] * 255~
-** Processing line: ~ args.outputs.primitives << [*slider, slidercolor, slidercolor, slidercolor, 255].solid~
-** Processing line: ~ args.outputs.primitives << [910, 575, "gain: #{s[:gain].round(3).to_s[0..2]}", 0, 0, 255, 255, 255].label~
-** Processing line: ~~
-** Processing line: ~ checkbox = [1022, 533, 10, 12]~
-** Processing line: ~ if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)~
-** Processing line: ~ s[:looping] = !s[:looping]~
-** Processing line: ~ end~
-** Processing line: ~ checkboxcolor = s[:looping] ? 255 : 0~
-** Processing line: ~ args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid~
-** Processing line: ~ args.outputs.primitives << [910, 550, "looping:", 0, 0, 255, 255, 255].label~
-** Processing line: ~~
-** Processing line: ~ checkbox = [1022, 508, 10, 12]~
-** Processing line: ~ if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(checkbox)~
-** Processing line: ~ s[:paused] = !s[:paused]~
-** Processing line: ~ end~
-** Processing line: ~ checkboxcolor = s[:paused] ? 255 : 0~
-** Processing line: ~ args.outputs.primitives << [*checkbox, checkboxcolor, checkboxcolor, checkboxcolor, 255].solid~
-** Processing line: ~ args.outputs.primitives << [910, 525, "paused:", 0, 0, 255, 255, 255].label~
-** Processing line: ~~
-** Processing line: ~ button = [910, 460, 320, 20]~
-** Processing line: ~ if (args.state.mouse_held == 1) && args.inputs.mouse.position.inside_rect?(button)~
-** Processing line: ~ args.audio.delete(args.state.selected)~
-** Processing line: ~ args.state.selected = 0~
-** Processing line: ~ end~
-** Processing line: ~ args.outputs.primitives << [*button, 255, 0, 0, 255].solid~
-** Processing line: ~ args.outputs.primitives << [button[0] + (button[2] / 2), button[1]+20, "DELETE SOURCE", 0, 1, 255, 255, 0].label~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def spawn_new_sound args, num~
-** Processing line: ~ input = nil~
-** Processing line: ~ input = "sounds/#{num}.#{(num == 6) ? 'ogg' : 'wav'}"~
-** Processing line: ~~
-** Processing line: ~ # Spawn randomly in an area that won't be covered by UI.~
-** Processing line: ~ screenx = (rand * 600.0) + 200.0~
-** Processing line: ~ screeny = (rand * 400.0) + 100.0~
-** Processing line: ~~
-** Processing line: ~ args.state.next_sound_index += 1~
-** Processing line: ~~
-** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
-** Processing line: ~ # actual screen position in here for convenience.~
-** Processing line: ~ args.audio[args.state.next_sound_index] = {~
-** Processing line: ~ input: input,~
-** Processing line: ~ screenx: screenx,~
-** Processing line: ~ screeny: screeny,~
-** Processing line: ~ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
-** Processing line: ~ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
-** Processing line: ~ z: 0.0,~
-** Processing line: ~ gain: 1.0,~
-** Processing line: ~ pitch: 1.0,~
-** Processing line: ~ looping: true,~
-** Processing line: ~ paused: false~
-** Processing line: ~ }~
-** Processing line: ~~
-** Processing line: ~ args.state.selected = args.state.next_sound_index~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def render_launcher args~
-** Processing line: ~ total = 6~
-** Processing line: ~ x = (1280 - (total * $boxsize * 3)) / 2~
-** Processing line: ~ y = 10~
-** Processing line: ~ args.outputs.primitives << [0, 0, 1280, ((y*2) + $boxsize), 127, 127, 127, 255].solid~
-** Processing line: ~ for i in 1..total~
-** Processing line: ~ args.outputs.primitives << [x, y, $boxsize, $boxsize, 255, 255, 255, 255].solid~
-** Processing line: ~ args.outputs.primitives << [x+8, y+28, i.to_s, 3, 0, 0, 0, 255, 255].label~
-** Processing line: ~ if args.inputs.mouse.click && args.inputs.mouse.click.point.inside_rect?([x, y, $boxsize, $boxsize])~
-** Processing line: ~ spawn_new_sound args, i~
-** Processing line: ~ end~
-** Processing line: ~ x = x + ($boxsize * 3)~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def render_ui args~
-** Processing line: ~ render_launcher args~
-** Processing line: ~ render_panel args~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def tick args~
-** Processing line: ~ args.state.mouse_held ||= 0~
-** Processing line: ~ args.state.dragging_source ||= false~
-** Processing line: ~ args.state.selected ||= 0~
-** Processing line: ~ args.state.next_sound_index ||= 0~
-** Processing line: ~~
-** Processing line: ~ if args.inputs.mouse.up~
-** Processing line: ~ args.state.mouse_held = 0~
-** Processing line: ~ args.state.dragging_source = false~
-** Processing line: ~ elsif args.inputs.mouse.down || (args.state.mouse_held > 0)~
-** Processing line: ~ args.state.mouse_held += 1~
-** Processing line: ~ else~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ args.outputs.background_color = [ 0, 0, 0, 255 ]~
-** Processing line: ~ render_sources args~
-** Processing line: ~ render_ui args~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~#+end_src~
-- PRE end detected.
-** Processing line: ~~
-** Processing line: ~~
-** Processing line: ~*** Rendering Basics - Sound Synthesis - main.rb~
-- H3 detected.
-- Determining if line is a header.
-- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~Rendering Basics - Sound Synthesis - 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: ~Rendering Basics - Sound Synthesis - 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/01_rendering_basics/07_sound_synthesis/app/main.rb~
-** Processing line: ~ begin # region: top level tick methods~
-** Processing line: ~ def tick args~
-** Processing line: ~ defaults args~
-** Processing line: ~ render args~
-** Processing line: ~ input args~
-** Processing line: ~ process_audio_queue args~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults args~
-** Processing line: ~ args.state.sine_waves ||= {}~
-** Processing line: ~ args.state.square_waves ||= {}~
-** Processing line: ~ args.state.saw_tooth_waves ||= {}~
-** Processing line: ~ args.state.triangle_waves ||= {}~
-** Processing line: ~ args.state.audio_queue ||= []~
-** Processing line: ~ args.state.buttons ||= [~
-** Processing line: ~ (frequency_buttons args),~
-** Processing line: ~ (sine_wave_note_buttons args),~
-** Processing line: ~ (bell_buttons args),~
-** Processing line: ~ (square_wave_note_buttons args),~
-** Processing line: ~ (saw_tooth_wave_note_buttons args),~
-** Processing line: ~ (triangle_wave_note_buttons args),~
-** Processing line: ~ ].flatten~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def render args~
-** Processing line: ~ args.outputs.borders << args.state.buttons.map { |b| b[:border] }~
-** Processing line: ~ args.outputs.labels << args.state.buttons.map { |b| b[:label] }~
-** Processing line: ~ args.outputs.labels << args.layout~
-** Processing line: ~ .rect(row: 0, col: 11.5)~
-** Processing line: ~ .yield_self { |r| r.merge y: r.y + r.h }~
-** Processing line: ~ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",~
-** Processing line: ~ alignment_enum: 1)~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~~
-** Processing line: ~ def input args~
-** Processing line: ~ args.state.buttons.each do |b|~
-** Processing line: ~ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])~
-** Processing line: ~ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "~
-** Processing line: ~ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"~
-** Processing line: ~ send b[:method_to_call], args, b~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))~
-** Processing line: ~ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def process_audio_queue args~
-** Processing line: ~ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }~
-** Processing line: ~ args.state.audio_queue -= to_queue~
-** Processing line: ~ to_queue.each { |a| args.audio[a[:id]] = a }~
-** Processing line: ~~
-** Processing line: ~ args.audio.find_all { |k, v| v[:decay_rate] }~
-** Processing line: ~ .each { |k, v| v[:gain] -= v[:decay_rate] }~
-** Processing line: ~~
-** Processing line: ~ sounds_to_stop = args.audio~
-** Processing line: ~ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }~
-** Processing line: ~ .map { |k, v| k }~
-** Processing line: ~~
-** Processing line: ~ sounds_to_stop.each { |k| args.audio.delete k }~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: button definitions, ui layout, callback functions~
-** Processing line: ~ def button args, opts~
-** Processing line: ~ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))~
-** Processing line: ~~
-** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~
-** Processing line: ~~
-** Processing line: ~ label_offset_x = 5~
-** Processing line: ~ label_offset_y = 30~
-** Processing line: ~~
-** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~
-** Processing line: ~ size_enum: -2.5,~
-** Processing line: ~ x: button_def[:rect].x + label_offset_x,~
-** Processing line: ~ y: button_def[:rect].y + label_offset_y~
-** Processing line: ~~
-** Processing line: ~ button_def~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def play_sine_wave args, sender~
-** Processing line: ~ queue_sine_wave args,~
-** Processing line: ~ frequency: sender[:frequency],~
-** Processing line: ~ duration: 1.seconds,~
-** Processing line: ~ fade_out: true~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def play_note args, sender~
-** Processing line: ~ method_to_call = :queue_sine_wave~
-** Processing line: ~ method_to_call = :queue_square_wave if sender[:type] == :square~
-** Processing line: ~ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth~
-** Processing line: ~ method_to_call = :queue_triangle_wave if sender[:type] == :triangle~
-** Processing line: ~ method_to_call = :queue_bell if sender[:type] == :bell~
-** Processing line: ~~
-** Processing line: ~ send method_to_call, args,~
-** Processing line: ~ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),~
-** Processing line: ~ duration: 1.seconds,~
-** Processing line: ~ fade_out: true~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def frequency_buttons args~
-** Processing line: ~ [~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 4.0, col: 0, text: "300hz",~
-** Processing line: ~ frequency: 300,~
-** Processing line: ~ method_to_call: :play_sine_wave),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 5.0, col: 0, text: "400hz",~
-** Processing line: ~ frequency: 400,~
-** Processing line: ~ method_to_call: :play_sine_wave),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 6.0, col: 0, text: "500hz",~
-** Processing line: ~ frequency: 500,~
-** Processing line: ~ method_to_call: :play_sine_wave),~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def sine_wave_note_buttons args~
-** Processing line: ~ [~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 1.5, col: 2, text: "Sine C4",~
-** Processing line: ~ note: :c, octave: 4, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 2.5, col: 2, text: "Sine D4",~
-** Processing line: ~ note: :d, octave: 4, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 3.5, col: 2, text: "Sine E4",~
-** Processing line: ~ note: :e, octave: 4, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 4.5, col: 2, text: "Sine F4",~
-** Processing line: ~ note: :f, octave: 4, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 5.5, col: 2, text: "Sine G4",~
-** Processing line: ~ note: :g, octave: 4, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 6.5, col: 2, text: "Sine A5",~
-** Processing line: ~ note: :a, octave: 5, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 7.5, col: 2, text: "Sine B5",~
-** Processing line: ~ note: :b, octave: 5, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 8.5, col: 2, text: "Sine C5",~
-** Processing line: ~ note: :c, octave: 5, type: :sine, method_to_call: :play_note),~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def square_wave_note_buttons args~
-** Processing line: ~ [~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 1.5, col: 6, text: "Square C4",~
-** Processing line: ~ note: :c, octave: 4, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 2.5, col: 6, text: "Square D4",~
-** Processing line: ~ note: :d, octave: 4, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 3.5, col: 6, text: "Square E4",~
-** Processing line: ~ note: :e, octave: 4, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 4.5, col: 6, text: "Square F4",~
-** Processing line: ~ note: :f, octave: 4, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 5.5, col: 6, text: "Square G4",~
-** Processing line: ~ note: :g, octave: 4, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 6.5, col: 6, text: "Square A5",~
-** Processing line: ~ note: :a, octave: 5, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 7.5, col: 6, text: "Square B5",~
-** Processing line: ~ note: :b, octave: 5, type: :square, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 8.5, col: 6, text: "Square C5",~
-** Processing line: ~ note: :c, octave: 5, type: :square, method_to_call: :play_note),~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~ def saw_tooth_wave_note_buttons args~
-** Processing line: ~ [~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 1.5, col: 8, text: "Saw C4",~
-** Processing line: ~ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 2.5, col: 8, text: "Saw D4",~
-** Processing line: ~ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 3.5, col: 8, text: "Saw E4",~
-** Processing line: ~ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 4.5, col: 8, text: "Saw F4",~
-** Processing line: ~ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 5.5, col: 8, text: "Saw G4",~
-** Processing line: ~ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 6.5, col: 8, text: "Saw A5",~
-** Processing line: ~ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 7.5, col: 8, text: "Saw B5",~
-** Processing line: ~ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 8.5, col: 8, text: "Saw C5",~
-** Processing line: ~ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def triangle_wave_note_buttons args~
-** Processing line: ~ [~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 1.5, col: 10, text: "Triangle C4",~
-** Processing line: ~ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 2.5, col: 10, text: "Triangle D4",~
-** Processing line: ~ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 3.5, col: 10, text: "Triangle E4",~
-** Processing line: ~ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 4.5, col: 10, text: "Triangle F4",~
-** Processing line: ~ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 5.5, col: 10, text: "Triangle G4",~
-** Processing line: ~ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 6.5, col: 10, text: "Triangle A5",~
-** Processing line: ~ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 7.5, col: 10, text: "Triangle B5",~
-** Processing line: ~ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 8.5, col: 10, text: "Triangle C5",~
-** Processing line: ~ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def bell_buttons args~
-** Processing line: ~ [~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 1.5, col: 4, text: "Bell C4",~
-** Processing line: ~ note: :c, octave: 4, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 2.5, col: 4, text: "Bell D4",~
-** Processing line: ~ note: :d, octave: 4, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 3.5, col: 4, text: "Bell E4",~
-** Processing line: ~ note: :e, octave: 4, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 4.5, col: 4, text: "Bell F4",~
-** Processing line: ~ note: :f, octave: 4, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 5.5, col: 4, text: "Bell G4",~
-** Processing line: ~ note: :g, octave: 4, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 6.5, col: 4, text: "Bell A5",~
-** Processing line: ~ note: :a, octave: 5, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 7.5, col: 4, text: "Bell B5",~
-** Processing line: ~ note: :b, octave: 5, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ (button args,~
-** Processing line: ~ row: 8.5, col: 4, text: "Bell C5",~
-** Processing line: ~ note: :c, octave: 5, type: :bell, method_to_call: :play_note),~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: wave generation~
-** Processing line: ~ begin # sine wave~
-** Processing line: ~ def defaults_sine_wave_for~
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def sine_wave_for opts = {}~
-** Processing line: ~ opts = defaults_sine_wave_for.merge opts~
-** Processing line: ~ frequency = opts[:frequency]~
-** Processing line: ~ sample_rate = opts[:sample_rate]~
-** Processing line: ~ period_size = (sample_rate.fdiv frequency).ceil~
-** Processing line: ~ period_size.map_with_index do |i|~
-** Processing line: ~ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)~
-** Processing line: ~ end.to_a~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults_queue_sine_wave~
-** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def queue_sine_wave args, opts = {}~
-** Processing line: ~ opts = defaults_queue_sine_wave.merge opts~
-** Processing line: ~ frequency = opts[:frequency]~
-** Processing line: ~ sample_rate = 48000~
-** Processing line: ~~
-** Processing line: ~ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~~
-** Processing line: ~ proc = lambda do~
-** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ audio_state = new_audio_state args, opts~
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: sine_wave~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: square wave~
-** Processing line: ~ def defaults_square_wave_for~
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def square_wave_for opts = {}~
-** Processing line: ~ opts = defaults_square_wave_for.merge opts~
-** Processing line: ~ sine_wave = sine_wave_for opts~
-** Processing line: ~ sine_wave.map do |v|~
-** Processing line: ~ if v >= 0~
-** Processing line: ~ 1.0~
-** Processing line: ~ else~
-** Processing line: ~ -1.0~
-** Processing line: ~ end~
-** Processing line: ~ end.to_a~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults_queue_square_wave~
-** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def queue_square_wave args, opts = {}~
-** Processing line: ~ opts = defaults_queue_square_wave.merge opts~
-** Processing line: ~ frequency = opts[:frequency]~
-** Processing line: ~ sample_rate = 48000~
-** Processing line: ~~
-** Processing line: ~ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~~
-** Processing line: ~ proc = lambda do~
-** Processing line: ~ generate_audio_data args.state.square_waves[frequency], sample_rate~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ audio_state = new_audio_state args, opts~
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: square_wave~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: saw tooth wave~
-** Processing line: ~ def defaults_saw_tooth_wave_for~
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def saw_tooth_wave_for opts = {}~
-** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
-** Processing line: ~ sine_wave = sine_wave_for opts~
-** Processing line: ~ period_size = sine_wave.length~
-** Processing line: ~ sine_wave.map_with_index do |v, i|~
-** Processing line: ~ (((i % period_size).fdiv period_size) * 2) - 1~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults_queue_saw_tooth_wave~
-** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def queue_saw_tooth_wave args, opts = {}~
-** Processing line: ~ opts = defaults_queue_saw_tooth_wave.merge opts~
-** Processing line: ~ frequency = opts[:frequency]~
-** Processing line: ~ sample_rate = 48000~
-** Processing line: ~~
-** Processing line: ~ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~~
-** Processing line: ~ proc = lambda do~
-** Processing line: ~ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ audio_state = new_audio_state args, opts~
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: triangle wave~
-** Processing line: ~ def defaults_triangle_wave_for~
-** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def triangle_wave_for opts = {}~
-** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
-** Processing line: ~ sine_wave = sine_wave_for opts~
-** Processing line: ~ period_size = sine_wave.length~
-** Processing line: ~ sine_wave.map_with_index do |v, i|~
-** Processing line: ~ ratio = (i.fdiv period_size)~
-** Processing line: ~ if ratio <= 0.5~
-** Processing line: ~ (ratio * 4) - 1~
-** Processing line: ~ else~
-** Processing line: ~ ratio -= 0.5~
-** Processing line: ~ 1 - (ratio * 4)~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults_queue_triangle_wave~
-** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def queue_triangle_wave args, opts = {}~
-** Processing line: ~ opts = defaults_queue_triangle_wave.merge opts~
-** Processing line: ~ frequency = opts[:frequency]~
-** Processing line: ~ sample_rate = 48000~
-** Processing line: ~~
-** Processing line: ~ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate~
-** Processing line: ~~
-** Processing line: ~ proc = lambda do~
-** Processing line: ~ generate_audio_data args.state.triangle_waves[frequency], sample_rate~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ audio_state = new_audio_state args, opts~
-** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
-** Processing line: ~ queue_audio args, audio_state: audio_state, wave: triangle_wave~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: bell~
-** Processing line: ~ def defaults_queue_bell~
-** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def queue_bell args, opts = {}~
-** Processing line: ~ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def bell_harmonics~
-** Processing line: ~ [~
-** Processing line: ~ { frequency_ratio: 0.5, duration_ratio: 1.00 },~
-** Processing line: ~ { frequency_ratio: 1.0, duration_ratio: 0.80 },~
-** Processing line: ~ { frequency_ratio: 2.0, duration_ratio: 0.60 },~
-** Processing line: ~ { frequency_ratio: 3.0, duration_ratio: 0.40 },~
-** Processing line: ~ { frequency_ratio: 4.2, duration_ratio: 0.25 },~
-** Processing line: ~ { frequency_ratio: 5.4, duration_ratio: 0.20 },~
-** Processing line: ~ { frequency_ratio: 6.8, duration_ratio: 0.15 }~
-** Processing line: ~ ]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults_bell_to_sine_waves~
-** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def bell_to_sine_waves opts = {}~
-** Processing line: ~ opts = defaults_bell_to_sine_waves.merge opts~
-** Processing line: ~ bell_harmonics.map do |b|~
-** Processing line: ~ {~
-** Processing line: ~ frequency: opts[:frequency] * b[:frequency_ratio],~
-** Processing line: ~ duration: opts[:duration] * b[:duration_ratio],~
-** Processing line: ~ queue_in: opts[:queue_in],~
-** Processing line: ~ gain: (1.fdiv bell_harmonics.length),~
-** Processing line: ~ fade_out: true~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # audio entity construction~
-** Processing line: ~ def generate_audio_data sine_wave, sample_rate~
-** Processing line: ~ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil~
-** Processing line: ~ copy_count = (sample_size.fdiv sine_wave.length).ceil~
-** Processing line: ~ sine_wave * copy_count~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def defaults_new_audio_state~
-** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def new_audio_state args, opts = {}~
-** Processing line: ~ opts = defaults_new_audio_state.merge opts~
-** Processing line: ~ decay_rate = 0~
-** Processing line: ~ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]~
-** Processing line: ~ frequency = opts[:frequency]~
-** Processing line: ~ sample_rate = 48000~
-** Processing line: ~~
-** Processing line: ~ {~
-** Processing line: ~ id: (new_id! args),~
-** Processing line: ~ frequency: frequency,~
-** Processing line: ~ sample_rate: 48000,~
-** Processing line: ~ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],~
-** Processing line: ~ gain: opts[:gain].to_f,~
-** Processing line: ~ queue_at: args.state.tick_count + opts[:queue_in],~
-** Processing line: ~ decay_rate: decay_rate,~
-** Processing line: ~ pitch: 1.0,~
-** Processing line: ~ looping: true,~
-** Processing line: ~ paused: false~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def queue_audio args, opts = {}~
-** Processing line: ~ graph_wave args, opts[:wave], opts[:audio_state][:frequency]~
-** Processing line: ~ args.state.audio_queue << opts[:audio_state]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def new_id! args~
-** Processing line: ~ args.state.audio_id ||= 0~
-** Processing line: ~ args.state.audio_id += 1~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def graph_wave args, wave, frequency~
-** Processing line: ~ if args.state.tick_count != args.state.graphed_at~
-** Processing line: ~ args.outputs.static_lines.clear~
-** Processing line: ~ args.outputs.static_sprites.clear~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ wave = wave~
-** Processing line: ~~
-** Processing line: ~ r, g, b = frequency.to_i % 85,~
-** Processing line: ~ frequency.to_i % 170,~
-** Processing line: ~ frequency.to_i % 255~
-** Processing line: ~~
-** Processing line: ~ starting_rect = args.layout.rect(row: 5, col: 13)~
-** Processing line: ~ x_scale = 10~
-** Processing line: ~ y_scale = 100~
-** Processing line: ~ max_points = 25~
-** Processing line: ~~
-** Processing line: ~ points = wave~
-** Processing line: ~ if wave.length > max_points~
-** Processing line: ~ resolution = wave.length.idiv max_points~
-** Processing line: ~ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ args.outputs.static_lines << points.map_with_index do |y, x|~
-** Processing line: ~ next_y = points[x + 1]~
-** Processing line: ~~
-** Processing line: ~ if next_y~
-** Processing line: ~ {~
-** Processing line: ~ x: starting_rect.x + (x * x_scale),~
-** Processing line: ~ y: starting_rect.y + starting_rect.h.half + y_scale * y,~
-** Processing line: ~ x2: starting_rect.x + ((x + 1) * x_scale),~
-** Processing line: ~ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,~
-** Processing line: ~ r: r,~
-** Processing line: ~ g: g,~
-** Processing line: ~ b: b~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ args.outputs.static_sprites << points.map_with_index do |y, x|~
-** Processing line: ~ {~
-** Processing line: ~ x: (starting_rect.x + (x * x_scale)) - 2,~
-** Processing line: ~ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,~
-** Processing line: ~ w: 4,~
-** Processing line: ~ h: 4,~
-** Processing line: ~ path: 'sprites/square-white.png',~
-** Processing line: ~ r: r,~
-** Processing line: ~ g: g,~
-** Processing line: ~ b: b~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ args.state.graphed_at = args.state.tick_count~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ begin # region: musical note mapping~
-** Processing line: ~ def defaults_frequency_for~
-** Processing line: ~ { note: :a, octave: 5, sharp: false, flat: false }~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def frequency_for opts = {}~
-** Processing line: ~ opts = defaults_frequency_for.merge opts~
-** Processing line: ~ octave_offset_multiplier = opts[:octave] - 5~
-** Processing line: ~ note = note_frequencies_octave_5[opts[:note]]~
-** Processing line: ~ if octave_offset_multiplier < 0~
-** Processing line: ~ note = note * 1 / (octave_offset_multiplier.abs + 1)~
-** Processing line: ~ elsif octave_offset_multiplier > 0~
-** Processing line: ~ note = note * (octave_offset_multiplier.abs + 1) / 1~
-** Processing line: ~ end~
-** Processing line: ~ note~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def note_frequencies_octave_5~
-** Processing line: ~ {~
-** Processing line: ~ a: 440.0,~
-** Processing line: ~ a_sharp: 466.16, b_flat: 466.16,~
-** Processing line: ~ b: 493.88,~
-** Processing line: ~ c: 523.25,~
-** Processing line: ~ c_sharp: 554.37, d_flat: 587.33,~
-** Processing line: ~ d: 587.33,~
-** Processing line: ~ d_sharp: 622.25, e_flat: 659.25,~
-** Processing line: ~ e: 659.25,~
-** Processing line: ~ f: 698.25,~
-** Processing line: ~ f_sharp: 739.99, g_flat: 739.99,~
-** Processing line: ~ g: 783.99,~
-** Processing line: ~ g_sharp: 830.61, a_flat: 830.61~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ $gtk.reset~
-** Processing line: ~~
-** Processing line: ~#+end_src~
-- PRE end detected.
-** Processing line: ~~
-** Processing line: ~~
** Processing line: ~*** Input Basics - Keyboard - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -185640,9 +194549,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def tick args~
** Processing line: ~ tick_instructions args, "Sample app shows how keyboard events are registered and accessed.", 360~
** Processing line: ~ # Notice how small_font accounts for all the remaining parameters~
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 0), "Current game time: #{args.state.tick_count}", small_font]~
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 2), "Keyboard input: args.inputs.keyboard.key_up.h", small_font]~
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 3), "Press \"h\" on the keyboard.", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 0), text: "Current game time: #{args.state.tick_count}", size_enum: -1 }~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 2), text: "Keyboard input: args.inputs.keyboard.key_up.h", size_enum: -1 }~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 3), text: "Press \"h\" on the keyboard.", size_enum: -1 }~
** Processing line: ~~
** Processing line: ~ # Input on a specifc key can be found through args.inputs.keyboard.key_up followed by the key~
** Processing line: ~ if args.inputs.keyboard.key_up.h~
@@ -185653,27 +194562,19 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.state.h_pressed_at ||= false~
** Processing line: ~~
** Processing line: ~ if args.state.h_pressed_at~
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" was pressed at time: #{args.state.h_pressed_at}", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" was pressed at time: #{args.state.h_pressed_at}", size_enum: -1 }~
** Processing line: ~ else~
-** Processing line: ~ args.outputs.labels << [460, row_to_px(args, 4), "\"h\" has never been pressed.", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 460, y: row_to_px(args, 4), text: "\"h\" has never been pressed.", size_enum: -1 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ tick_help_text args~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def small_font~
-** Processing line: ~ # This method provides some values for the construction of labels~
-** Processing line: ~ # Specifically, Size, Alignment, & RGBA~
-** Processing line: ~ # This makes it so that custom parameters don't have to be repeatedly typed.~
-** Processing line: ~ # Additionally "small_font" provides programmers with more information than some numbers~
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def row_to_px args, row_number~
+** Processing line: ~ def row_to_px args, row_number, y_offset = 20~
** Processing line: ~ # This takes a row_number and converts it to pixels DragonRuby understands.~
** Processing line: ~ # Row 0 starts 5 units below the top of the grid~
** Processing line: ~ # Each row afterward is 20 units lower~
-** Processing line: ~ args.grid.top.shift_down(5).shift_down(20 * row_number)~
+** Processing line: ~ args.grid.top - 5 - (y_offset * row_number)~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Don't worry about understanding the code within this method just yet.~
@@ -185703,17 +194604,17 @@ 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: ~ args.outputs.labels << [10, row_to_px(args, 6), "Advanced Help:", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 10, y: row_to_px(args, 6), text: "This is the api for the keys you've pressed:", size_enum: -1, r: 180 }~
** Processing line: ~~
** Processing line: ~ if !args.state.help_available~
** Processing line: ~ args.outputs.labels << [10, row_to_px(args, 7), "Press a key and I'll show code to access the key and what value will be returned if you used the code.", small_font]~
** Processing line: ~ return~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ args.outputs.labels << [10 , row_to_px(args, 7), "args.inputs.keyboard", small_font]~
-** Processing line: ~ args.outputs.labels << [330, row_to_px(args, 7), "args.inputs.keyboard.key_down", small_font]~
-** Processing line: ~ args.outputs.labels << [650, row_to_px(args, 7), "args.inputs.keyboard.key_held", small_font]~
-** Processing line: ~ args.outputs.labels << [990, row_to_px(args, 7), "args.inputs.keyboard.key_up", small_font]~
+** Processing line: ~ args.outputs.labels << { x: 10 , y: row_to_px(args, 7), text: "args.inputs.keyboard", size_enum: -2 }~
+** Processing line: ~ args.outputs.labels << { x: 330, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_down", size_enum: -2 }~
+** Processing line: ~ args.outputs.labels << { x: 650, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_held", size_enum: -2 }~
+** Processing line: ~ args.outputs.labels << { x: 990, y: row_to_px(args, 7), text: "args.inputs.keyboard.key_up", size_enum: -2 }~
** Processing line: ~~
** Processing line: ~ fill_history args, :key_value_history, :down_or_held, nil~
** Processing line: ~ fill_history args, :key_down_value_history, :down, :key_down~
@@ -185759,12 +194660,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~ idx += 2~
** Processing line: ~ [~
-** Processing line: ~ [x, row_to_px(args, idx - 2),~
-** Processing line: ~ " .#{k} is #{current_value || "nil"}",~
-** Processing line: ~ small_font],~
-** Processing line: ~ [x, row_to_px(args, idx - 1),~
-** Processing line: ~ " was #{v}",~
-** Processing line: ~ small_font]~
+** Processing line: ~ { x: x, y: row_to_px(args, idx + 0, 16), text: " .#{k} is #{current_value || "nil"}", size_enum: -2 },~
+** Processing line: ~ { x: x, y: row_to_px(args, idx + 1, 16), text: " was #{v}", size_enum: -2 }~
** Processing line: ~ ]~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -185779,15 +194676,68 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.state.key_event_occurred = true~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
-** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
-** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!~
+** Processing line: ~ args.outputs.debug << { x: 640, y: y, text: text,~
+** Processing line: ~ size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
+** Processing line: ~ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)",~
+** Processing line: ~ size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Input Basics - Moving A Sprite - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Input Basics - Moving A Sprite - 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: ~Input Basics - Moving A Sprite - 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/02_input_basics/01_moving_a_sprite/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ # create a player and set default values~
+** Processing line: ~ # for the player's x, y, w (width), and h (height)~
+** Processing line: ~ args.state.player.x ||= 100~
+** Processing line: ~ args.state.player.y ||= 100~
+** Processing line: ~ args.state.player.w ||= 50~
+** Processing line: ~ args.state.player.h ||= 50~
+** Processing line: ~~
+** Processing line: ~ # render the player to the screen~
+** Processing line: ~ args.outputs.sprites << { x: args.state.player.x,~
+** Processing line: ~ y: args.state.player.y,~
+** Processing line: ~ w: args.state.player.w,~
+** Processing line: ~ h: args.state.player.h,~
+** Processing line: ~ path: 'sprites/square/green.png' }~
+** Processing line: ~~
+** Processing line: ~ # move the player around using the keyboard~
+** Processing line: ~ if args.inputs.up~
+** Processing line: ~ args.state.player.y += 10~
+** Processing line: ~ elsif args.inputs.down~
+** Processing line: ~ args.state.player.y -= 10~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.left~
+** Processing line: ~ args.state.player.x -= 10~
+** Processing line: ~ elsif args.inputs.right~
+** Processing line: ~ args.state.player.x += 10~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $gtk.reset~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Input Basics - Mouse - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -185867,11 +194817,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # This method effectively combines the row_to_px and small_font methods~
** Processing line: ~ # It changes the given row value to a DragonRuby pixel value~
** Processing line: ~ # and adds the customization parameters~
-** Processing line: ~ [x, row_to_px(args, row), message, small_font]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def small_font~
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
+** Processing line: ~ { x: x, y: row_to_px(args, row), text: message, alignment_enum: -2 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def row_to_px args, row_number~
@@ -185887,9 +194833,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.state.key_event_occurred = true~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
-** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
-** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!~
+** Processing line: ~ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
+** Processing line: ~ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
@@ -185956,7 +194902,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ args.outputs.labels << small_label(args, x, 15, "Click inside the blue box maybe ---->")~
** Processing line: ~~
-** Processing line: ~ box = [785, 370, 50, 50, 0, 0, 170]~
+** Processing line: ~ box = { x: 785, y: 370, w: 50, h: 50, r: 0, g: 0, b: 170 }~
** Processing line: ~ args.outputs.borders << box~
** Processing line: ~~
** Processing line: ~ # Saves the most recent click into args.state~
@@ -185978,11 +194924,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def small_label args, x, row, message~
-** Processing line: ~ [x, row_to_px(args, row), message, small_font]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def small_font~
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
+** Processing line: ~ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def row_to_px args, row_number~
@@ -185998,9 +194940,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.state.key_event_occurred = true~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
-** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
-** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.debug << { x: 0, y: y - 50, w: 1280, h: 60 }.solid!~
+** Processing line: ~ args.outputs.debug << { x: 640, y: y, text: text, size_enum: 1, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
+** Processing line: ~ args.outputs.debug << { x: 640, y: y - 25, text: "(click to dismiss instructions)", size_enum: -2, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
@@ -186067,9 +195009,15 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # They are stored in game so that they do not get reset every tick~
** Processing line: ~ if args.inputs.mouse.click~
** Processing line: ~ if !args.state.box_collision_one~
-** Processing line: ~ args.state.box_collision_one = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 180, 0, 0, 180]~
+** Processing line: ~ args.state.box_collision_one = { x: args.inputs.mouse.click.point.x - 25,~
+** Processing line: ~ y: args.inputs.mouse.click.point.y - 25,~
+** Processing line: ~ w: 125, h: 125,~
+** Processing line: ~ r: 180, g: 0, b: 0, a: 180 }~
** Processing line: ~ elsif !args.state.box_collision_two~
-** Processing line: ~ args.state.box_collision_two = [args.inputs.mouse.click.point.x - 25, args.inputs.mouse.click.point.y - 25, 125, 125, 0, 0, 180, 180]~
+** Processing line: ~ args.state.box_collision_two = { x: args.inputs.mouse.click.point.x - 25,~
+** Processing line: ~ y: args.inputs.mouse.click.point.y - 25,~
+** Processing line: ~ w: 125, h: 125,~
+** Processing line: ~ r: 0, g: 0, b: 180, a: 180 }~
** Processing line: ~ else~
** Processing line: ~ args.state.box_collision_one = nil~
** Processing line: ~ args.state.box_collision_two = nil~
@@ -186096,15 +195044,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def small_label args, x, row, message~
-** Processing line: ~ [x, row_to_px(args, row), message, small_font]~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def small_font~
-** Processing line: ~ [-2, 0, 0, 0, 0, 255]~
+** Processing line: ~ { x: x, y: row_to_px(args, row), text: message, size_enum: -2 }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def row_to_px args, row_number~
-** Processing line: ~ args.grid.top.shift_down(5).shift_down(20 * row_number)~
+** Processing line: ~ args.grid.top - 5 - (20 * row_number)~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def tick_instructions args, text, y = 715~
@@ -186185,57 +195129,51 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def process_inputs~
** Processing line: ~ state.buttons = []~
** Processing line: ~~
-** Processing line: ~ state.buttons << [100, 500, inputs.controller_one.key_held.l1, "L1"]~
-** Processing line: ~ state.buttons << [100, 600, inputs.controller_one.key_held.l2, "L2"]~
-** Processing line: ~~
-** Processing line: ~ state.buttons << [1100, 500, inputs.controller_one.key_held.r1, "R1"]~
-** Processing line: ~ state.buttons << [1100, 600, inputs.controller_one.key_held.r2, "R2"]~
-** Processing line: ~~
-** Processing line: ~ state.buttons << [540, 450, inputs.controller_one.key_held.select, "Select"]~
-** Processing line: ~ state.buttons << [660, 450, inputs.controller_one.key_held.start, "Start"]~
-** Processing line: ~~
-** Processing line: ~ state.buttons << [200, 300, inputs.controller_one.key_held.left, "Left"]~
-** Processing line: ~ state.buttons << [300, 400, inputs.controller_one.key_held.up, "Up"]~
-** Processing line: ~ state.buttons << [400, 300, inputs.controller_one.key_held.right, "Right"]~
-** Processing line: ~ state.buttons << [300, 200, inputs.controller_one.key_held.down, "Down"]~
-** Processing line: ~~
-** Processing line: ~ state.buttons << [800, 300, inputs.controller_one.key_held.x, "X"]~
-** Processing line: ~ state.buttons << [900, 400, inputs.controller_one.key_held.y, "Y"]~
-** Processing line: ~ state.buttons << [1000, 300, inputs.controller_one.key_held.a, "A"]~
-** Processing line: ~ state.buttons << [900, 200, inputs.controller_one.key_held.b, "B"]~
-** Processing line: ~~
-** Processing line: ~ state.buttons << [450 + inputs.controller_one.left_analog_x_perc * 100,~
-** Processing line: ~ 100 + inputs.controller_one.left_analog_y_perc * 100,~
-** Processing line: ~ inputs.controller_one.key_held.l3,~
-** Processing line: ~ "L3"]~
-** Processing line: ~~
-** Processing line: ~ state.buttons << [750 + inputs.controller_one.right_analog_x_perc * 100,~
-** Processing line: ~ 100 + inputs.controller_one.right_analog_y_perc * 100,~
-** Processing line: ~ inputs.controller_one.key_held.r3,~
-** Processing line: ~ "R3"]~
+** Processing line: ~ state.buttons << { x: 100, y: 500, active: inputs.controller_one.key_held.l1, text: "L1"}~
+** Processing line: ~ state.buttons << { x: 100, y: 600, active: inputs.controller_one.key_held.l2, text: "L2"}~
+** Processing line: ~ state.buttons << { x: 1100, y: 500, active: inputs.controller_one.key_held.r1, text: "R1"}~
+** Processing line: ~ state.buttons << { x: 1100, y: 600, active: inputs.controller_one.key_held.r2, text: "R2"}~
+** Processing line: ~ state.buttons << { x: 540, y: 450, active: inputs.controller_one.key_held.select, text: "Select"}~
+** Processing line: ~ state.buttons << { x: 660, y: 450, active: inputs.controller_one.key_held.start, text: "Start"}~
+** Processing line: ~ state.buttons << { x: 200, y: 300, active: inputs.controller_one.key_held.left, text: "Left"}~
+** Processing line: ~ state.buttons << { x: 300, y: 400, active: inputs.controller_one.key_held.up, text: "Up"}~
+** Processing line: ~ state.buttons << { x: 400, y: 300, active: inputs.controller_one.key_held.right, text: "Right"}~
+** Processing line: ~ state.buttons << { x: 300, y: 200, active: inputs.controller_one.key_held.down, text: "Down"}~
+** Processing line: ~ state.buttons << { x: 800, y: 300, active: inputs.controller_one.key_held.x, text: "X"}~
+** Processing line: ~ state.buttons << { x: 900, y: 400, active: inputs.controller_one.key_held.y, text: "Y"}~
+** Processing line: ~ state.buttons << { x: 1000, y: 300, active: inputs.controller_one.key_held.a, text: "A"}~
+** Processing line: ~ state.buttons << { x: 900, y: 200, active: inputs.controller_one.key_held.b, text: "B"}~
+** Processing line: ~ state.buttons << { x: 450 + inputs.controller_one.left_analog_x_perc * 100,~
+** Processing line: ~ y: 100 + inputs.controller_one.left_analog_y_perc * 100,~
+** Processing line: ~ active: inputs.controller_one.key_held.l3,~
+** Processing line: ~ text: "L3" }~
+** Processing line: ~ state.buttons << { x: 750 + inputs.controller_one.right_analog_x_perc * 100,~
+** Processing line: ~ y: 100 + inputs.controller_one.right_analog_y_perc * 100,~
+** Processing line: ~ active: inputs.controller_one.key_held.r3,~
+** Processing line: ~ text: "R3" }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Gives each button a square shape.~
** Processing line: ~ # If the button is being pressed or held (which means it is considered active),~
** Processing line: ~ # the square is filled in. Otherwise, the button simply has a border.~
** Processing line: ~ def render~
-** Processing line: ~ state.buttons.each do |x, y, active, text|~
-** Processing line: ~ rect = [x, y, 75, 75]~
+** Processing line: ~ state.buttons.each do |b|~
+** Processing line: ~ rect = { x: b.x, y: b.y, w: 75, h: 75 }~
** Processing line: ~~
-** Processing line: ~ if active # if button is pressed~
+** Processing line: ~ if b.active # if button is pressed~
** Processing line: ~ outputs.solids << rect # rect is output as solid (filled in)~
** Processing line: ~ else~
** Processing line: ~ outputs.borders << rect # otherwise, output as border~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Outputs the text of each button using labels.~
-** Processing line: ~ outputs.labels << [x, y + 95, text] # add 95 to place label above button~
+** Processing line: ~ outputs.labels << { x: b.x, y: b.y + 95, text: b.text } # add 95 to place label above button~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ outputs.labels << [10, 60, "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)"]~
-** Processing line: ~ outputs.labels << [10, 30, "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)"]~
-** Processing line: ~ outputs.labels << [900, 60, "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)"]~
-** Processing line: ~ outputs.labels << [900, 30, "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)"]~
+** Processing line: ~ outputs.labels << { x: 10, y: 60, text: "Left Analog x: #{inputs.controller_one.left_analog_x_raw} (#{inputs.controller_one.left_analog_x_perc * 100}%)" }~
+** Processing line: ~ outputs.labels << { x: 10, y: 30, text: "Left Analog y: #{inputs.controller_one.left_analog_y_raw} (#{inputs.controller_one.left_analog_y_perc * 100}%)" }~
+** Processing line: ~ outputs.labels << { x: 900, y: 60, text: "Right Analog x: #{inputs.controller_one.right_analog_x_raw} (#{inputs.controller_one.right_analog_x_perc * 100}%)" }~
+** Processing line: ~ outputs.labels << { x: 900, y: 30, text: "Right Analog y: #{inputs.controller_one.right_analog_y_raw} (#{inputs.controller_one.right_analog_y_perc * 100}%)" }~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -186301,10 +195239,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # the next new touch will be finger_one again, but until then, new touches~
** Processing line: ~ # don't fill in earlier slots.~
** Processing line: ~ if !args.inputs.finger_one.nil?~
-** Processing line: ~ args.outputs.primitives << [640, 650, "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).", 5, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.primitives << { x: 640, y: 650, text: "Finger #1 is touching at (#{args.inputs.finger_one.x}, #{args.inputs.finger_one.y}).",~
+** Processing line: ~ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
** Processing line: ~ end~
** Processing line: ~ if !args.inputs.finger_two.nil?~
-** Processing line: ~ args.outputs.primitives << [640, 600, "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).", 5, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.primitives << { x: 640, y: 600, text: "Finger #2 is touching at (#{args.inputs.finger_two.x}, #{args.inputs.finger_two.y}).",~
+** Processing line: ~ size_enum: 5, alignment_enum: 1, r: 255, g: 255, b: 255 }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Here's the more flexible interface: this will report as many simultaneous~
@@ -186325,12 +195265,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ r = (color & 0xFF0000) >> 16~
** Processing line: ~ g = (color & 0x00FF00) >> 8~
** Processing line: ~ b = (color & 0x0000FF)~
-** Processing line: ~ args.outputs.primitives << [v.x - (size / 2), v.y + (size / 2), size, size, r, g, b, 255].solid~
-** Processing line: ~ args.outputs.primitives << [v.x, v.y + size, k.to_s, 0, 1, 0, 0, 0].label~
+** Processing line: ~ args.outputs.primitives << { x: v.x - (size / 2), y: v.y + (size / 2), w: size, h: size, r: r, g: g, b: b, a: 255 }.solid!~
+** Processing line: ~ args.outputs.primitives << { x: v.x, y: v.y + size, text: k.to_s, alignment_enum: 1 }.label!~
** Processing line: ~ }~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~~
** Processing line: ~#+end_src~
- PRE end detected.
** Processing line: ~~
@@ -186384,6 +195323,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # in this tick "entry point": `looping_animation`, and the~
** Processing line: ~ # second method is `one_time_animation`.~
** Processing line: ~ def tick args~
+** Processing line: ~ # uncomment the line below to see animation play out in slow motion~
+** Processing line: ~ # args.gtk.slowmo! 6~
** Processing line: ~ looping_animation args~
** Processing line: ~ one_time_animation args~
** Processing line: ~ end~
@@ -186416,22 +195357,22 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ does_sprite_loop~
** Processing line: ~~
** Processing line: ~ # Now that we have `sprite_index, we can present the correct file.~
-** Processing line: ~ args.outputs.sprites << [100, 100, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]~
+** Processing line: ~ args.outputs.sprites << { x: 100, y: 100, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }~
** Processing line: ~~
** Processing line: ~ # Try changing the numbers below to see how the animation changes:~
-** Processing line: ~ args.outputs.sprites << [100, 200, 100, 100, "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png"]~
+** Processing line: ~ args.outputs.sprites << { x: 100, y: 200, w: 100, h: 100, path: "sprites/dragon_fly_#{0.frame_index 6, 4, true}.png" }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # This function shows how to animate a sprite that executes~
** Processing line: ~ # only once when the "f" key is pressed.~
** Processing line: ~ def one_time_animation args~
** Processing line: ~ # This is just a label the shows instructions within the game.~
-** Processing line: ~ args.outputs.labels << [220, 350, "(press f to animate)"]~
+** Processing line: ~ args.outputs.labels << { x: 220, y: 350, text: "(press f to animate)" }~
** Processing line: ~~
** Processing line: ~ # If "f" is pressed on the keyboard...~
** Processing line: ~ if args.inputs.keyboard.key_down.f~
** Processing line: ~ # Print the frame that "f" was pressed on.~
-** Processing line: ~ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.inputs.keyboard.key_down.f}"~
+** Processing line: ~ puts "Hello from main.rb! The \"f\" key was in the down state on frame: #{args.state.tick_count}"~
** Processing line: ~~
** Processing line: ~ # And MOST IMPORTANTLY set the point it time to start the animation,~
** Processing line: ~ # equal to "now" which is represented as args.state.tick_count.~
@@ -186464,7 +195405,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ sprite_index ||= 0~
** Processing line: ~~
** Processing line: ~ # Present the sprite.~
-** Processing line: ~ args.outputs.sprites << [100, 300, 100, 100, "sprites/dragon_fly_#{sprite_index}.png"]~
+** Processing line: ~ args.outputs.sprites << { x: 100, y: 300, w: 100, h: 100, path: "sprites/dragon_fly_#{sprite_index}.png" }~
** Processing line: ~~
** Processing line: ~ tick_instructions args, "Sample app shows how to use Numeric#frame_index and string interpolation to animate a sprite over time."~
** Processing line: ~ end~
@@ -188592,9 +197533,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ mouse_overlay = mouse_overlay.merge r: 255 if state.delete_mode~
** Processing line: ~~
** Processing line: ~ if state.mouse_held~
-** Processing line: ~ outputs.primitives << mouse_overlay.border~
+** Processing line: ~ outputs.primitives << mouse_overlay.border!~
** Processing line: ~ else~
-** Processing line: ~ outputs.primitives << mouse_overlay.solid~
+** Processing line: ~ outputs.primitives << mouse_overlay.solid!~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -193281,6 +202222,1068 @@ 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 - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Audio - Audio Mixer - 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 Audio - Audio Mixer - 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_audio/01_audio_mixer/app/main.rb~
+** Processing line: ~ # these are the properties that you can sent on args.audio~
+** Processing line: ~ def spawn_new_sound args, name, path~
+** Processing line: ~ # Spawn randomly in an area that won't be covered by UI.~
+** Processing line: ~ screenx = (rand * 600.0) + 200.0~
+** Processing line: ~ screeny = (rand * 400.0) + 100.0~
+** Processing line: ~~
+** Processing line: ~ id = new_sound_id! args~
+** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
+** Processing line: ~ # actual screen position in here for convenience.~
+** Processing line: ~ args.audio[id] = {~
+** Processing line: ~ name: name,~
+** Processing line: ~ input: path,~
+** Processing line: ~ screenx: screenx,~
+** Processing line: ~ screeny: screeny,~
+** Processing line: ~ x: ((screenx / 1279.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
+** Processing line: ~ y: ((screeny / 719.0) * 2.0) - 1.0, # scale to -1.0 - 1.0 range~
+** Processing line: ~ z: 0.0,~
+** Processing line: ~ gain: 1.0,~
+** Processing line: ~ pitch: 1.0,~
+** Processing line: ~ looping: true,~
+** Processing line: ~ paused: false~
+** Processing line: ~ }~
+** Processing line: ~~
+** Processing line: ~ args.state.selected = id~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # these are values you can change on the ~args.audio~ data structure~
+** Processing line: ~ def input_panel args~
+** Processing line: ~ return unless args.state.panel~
+** Processing line: ~ return if args.state.dragging~
+** Processing line: ~~
+** Processing line: ~ audio_entry = args.audio[args.state.selected]~
+** Processing line: ~ results = args.state.panel~
+** Processing line: ~~
+** Processing line: ~ if args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.pitch_slider_rect.rect)~
+** Processing line: ~ audio_entry.pitch = 2.0 * ((args.inputs.mouse.x - results.pitch_slider_rect.x).to_f / (results.pitch_slider_rect.w - 1.0))~
+** Processing line: ~ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.playtime_slider_rect.rect)~
+** Processing line: ~ audio_entry.playtime = audio_entry.length_ * ((args.inputs.mouse.x - results.playtime_slider_rect.x).to_f / (results.playtime_slider_rect.w - 1.0))~
+** Processing line: ~ elsif args.state.mouse_state == :held && args.inputs.mouse.position.inside_rect?(results.gain_slider_rect.rect)~
+** Processing line: ~ audio_entry.gain = (args.inputs.mouse.x - results.gain_slider_rect.x).to_f / (results.gain_slider_rect.w - 1.0)~
+** Processing line: ~ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.looping_checkbox_rect.rect)~
+** Processing line: ~ audio_entry.looping = !audio_entry.looping~
+** Processing line: ~ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.paused_checkbox_rect.rect)~
+** Processing line: ~ audio_entry.paused = !audio_entry.paused~
+** Processing line: ~ elsif args.inputs.mouse.click && args.inputs.mouse.position.inside_rect?(results.delete_button_rect.rect)~
+** Processing line: ~ args.audio.delete args.state.selected~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_sources args~
+** Processing line: ~ args.outputs.primitives << args.audio.keys.map do |k|~
+** Processing line: ~ s = args.audio[k]~
+** Processing line: ~~
+** Processing line: ~ isselected = (k == args.state.selected)~
+** Processing line: ~~
+** Processing line: ~ color = isselected ? [ 0, 255, 0, 255 ] : [ 0, 0, 255, 255 ]~
+** Processing line: ~ [~
+** Processing line: ~ [s.screenx, s.screeny, args.state.boxsize, args.state.boxsize, *color].solid,~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ x: s.screenx + args.state.boxsize.half,~
+** Processing line: ~ y: s.screeny,~
+** Processing line: ~ text: s.name,~
+** Processing line: ~ r: 255,~
+** Processing line: ~ g: 255,~
+** Processing line: ~ b: 255,~
+** Processing line: ~ alignment_enum: 1~
+** Processing line: ~ }.label!~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def playtime_str 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]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def label_with_drop_shadow x, y, text~
+** Processing line: ~ [~
+** Processing line: ~ { x: x + 1, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,~
+** Processing line: ~ { x: x + 2, y: y + 0, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 0, g: 0, b: 0 }.label!,~
+** Processing line: ~ { x: x + 0, y: y + 1, text: text, vertical_alignment_enum: 1, alignment_enum: 1, r: 200, g: 200, b: 200 }.label!~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def check_box opts = {}~
+** Processing line: ~ checkbox_template = opts.args.layout.rect(w: 0.5, h: 0.5, col: 2)~
+** Processing line: ~ final_rect = checkbox_template.center_inside_rect_y(opts.args.layout.rect(row: opts.row, col: opts.col))~
+** Processing line: ~ color = { r: 0, g: 0, b: 0 }~
+** Processing line: ~ color = { r: 255, g: 255, b: 255 } if opts.checked~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ rect: final_rect,~
+** Processing line: ~ primitives: [~
+** Processing line: ~ (final_rect.to_solid color)~
+** Processing line: ~ ]~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def progress_bar opts = {}~
+** Processing line: ~ outer_rect = opts.args.layout.rect(row: opts.row, col: opts.col, w: 5, h: 1)~
+** Processing line: ~ color = opts.percentage * 255~
+** Processing line: ~ baseline_progress_bar = opts.args~
+** Processing line: ~ .layout~
+** Processing line: ~ .rect(w: 5, h: 0.5)~
+** Processing line: ~~
+** Processing line: ~ final_rect = baseline_progress_bar.center_inside_rect(outer_rect)~
+** Processing line: ~ center = final_rect.rect_center_point~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ rect: final_rect,~
+** Processing line: ~ primitives: [~
+** Processing line: ~ final_rect.merge(r: color, g: color, b: color, a: 128).solid!,~
+** Processing line: ~ label_with_drop_shadow(center.x, center.y, opts.text)~
+** Processing line: ~ ]~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def panel_primitives args, audio_entry~
+** Processing line: ~ results = { primitives: [] }~
+** Processing line: ~~
+** Processing line: ~ return results unless audio_entry~
+** Processing line: ~~
+** Processing line: ~ # this uses DRGTK's layout apis to layout the controls~
+** Processing line: ~ # imagine the screen is split into equal cells (24 cells across, 12 cells up and down)~
+** Processing line: ~ # args.layout.rect returns a hash which we merge values with to create primitives~
+** Processing line: ~ # using args.layout.rect removes the need for pixel pushing~
+** Processing line: ~~
+** Processing line: ~ # args.outputs.debug << args.layout.debug_primitives(r: 255, g: 255, b: 255)~
+** Processing line: ~~
+** Processing line: ~ white_color = { r: 255, g: 255, b: 255 }~
+** Processing line: ~ label_style = white_color.merge(vertical_alignment_enum: 1)~
+** Processing line: ~~
+** Processing line: ~ # panel background~
+** Processing line: ~ results.primitives << args.layout.rect(row: 0, col: 0, w: 7, h: 6, include_col_gutter: true, include_row_gutter: true)~
+** Processing line: ~ .border!(r: 255, g: 255, b: 255)~
+** Processing line: ~~
+** Processing line: ~ # title~
+** Processing line: ~ results.primitives << args.layout.point(row: 0, col: 3.5, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "Source #{args.state.selected} (#{args.audio[args.state.selected].name})",~
+** Processing line: ~ size_enum: 3,~
+** Processing line: ~ alignment_enum: 1)~
+** Processing line: ~~
+** Processing line: ~ # seperator line~
+** Processing line: ~ results.primitives << args.layout.rect(row: 1, col: 0, w: 7, h: 0)~
+** Processing line: ~ .line!(white_color)~
+** Processing line: ~~
+** Processing line: ~ # screen location~
+** Processing line: ~ results.primitives << args.layout.point(row: 1.0, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "screen:")~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 1.0, col: 2, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "(#{audio_entry.screenx.to_i}, #{audio_entry.screeny.to_i})")~
+** Processing line: ~~
+** Processing line: ~ # position~
+** Processing line: ~ results.primitives << args.layout.point(row: 1.5, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "position:")~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 1.5, col: 2, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "(#{audio_entry[:x].round(5).to_s[0..6]}, #{audio_entry[:y].round(5).to_s[0..6]})")~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 2.0, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "pitch:")~
+** Processing line: ~~
+** Processing line: ~ results.pitch_slider_rect = progress_bar(row: 2.0, col: 2,~
+** Processing line: ~ percentage: audio_entry.pitch / 2.0,~
+** Processing line: ~ text: "#{audio_entry.pitch.to_sf}",~
+** Processing line: ~ args: args)~
+** Processing line: ~~
+** Processing line: ~ results.primitives << results.pitch_slider_rect.primitives~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 2.5, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "playtime:")~
+** Processing line: ~~
+** 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: ~ text: "#{playtime_str(audio_entry.playtime)} / #{playtime_str(audio_entry.length_)}")~
+** Processing line: ~~
+** Processing line: ~ results.primitives << results.playtime_slider_rect.primitives~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 3.0, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "gain:")~
+** Processing line: ~~
+** Processing line: ~ results.gain_slider_rect = progress_bar(args: args,~
+** Processing line: ~ row: 3.0,~
+** Processing line: ~ col: 2,~
+** Processing line: ~ percentage: audio_entry.gain,~
+** Processing line: ~ text: "#{audio_entry.gain.to_sf}")~
+** Processing line: ~~
+** Processing line: ~ results.primitives << results.gain_slider_rect.primitives~
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 3.5, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "looping:")~
+** Processing line: ~~
+** Processing line: ~ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)~
+** Processing line: ~~
+** Processing line: ~ results.looping_checkbox_rect = check_box(args: args, row: 3.5, col: 2, checked: audio_entry.looping)~
+** Processing line: ~ results.primitives << results.looping_checkbox_rect.primitives~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 4.0, col: 0, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "paused:")~
+** Processing line: ~~
+** Processing line: ~ checkbox_template = args.layout.rect(w: 0.5, h: 0.5, col: 2)~
+** Processing line: ~~
+** Processing line: ~ results.paused_checkbox_rect = check_box(args: args, row: 4.0, col: 2, checked: !audio_entry.paused)~
+** Processing line: ~ results.primitives << results.paused_checkbox_rect.primitives~
+** Processing line: ~~
+** Processing line: ~ results.delete_button_rect = { rect: args.layout.rect(row: 5, col: 0, w: 7, h: 1) }~
+** Processing line: ~~
+** Processing line: ~ results.primitives << results.delete_button_rect.to_solid(r: 180)~
+** Processing line: ~~
+** Processing line: ~ results.primitives << args.layout.point(row: 5, col: 3.5, row_anchor: 0.5)~
+** Processing line: ~ .merge(label_style)~
+** Processing line: ~ .merge(text: "DELETE", alignment_enum: 1)~
+** Processing line: ~~
+** Processing line: ~ return results~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_panel args~
+** Processing line: ~ args.state.panel = nil~
+** Processing line: ~ audio_entry = args.audio[args.state.selected]~
+** Processing line: ~ return unless audio_entry~
+** Processing line: ~~
+** Processing line: ~ mouse_down = (args.state.mouse_held >= 0)~
+** Processing line: ~ args.state.panel = panel_primitives args, audio_entry~
+** Processing line: ~ args.outputs.primitives << args.state.panel.primitives~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def new_sound_id! args~
+** Processing line: ~ args.state.sound_id ||= 0~
+** Processing line: ~ args.state.sound_id += 1~
+** Processing line: ~ args.state.sound_id~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_launcher args~
+** Processing line: ~ args.outputs.primitives << args.state.spawn_sound_buttons.map(&:primitives)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render_ui args~
+** Processing line: ~ render_launcher args~
+** Processing line: ~ render_panel args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~ defaults args~
+** Processing line: ~ render args~
+** Processing line: ~ input args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input args~
+** Processing line: ~ if !args.audio[args.state.selected]~
+** Processing line: ~ args.state.selected = nil~
+** Processing line: ~ args.state.dragging = nil~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # spawn button and node interaction~
+** Processing line: ~ if args.inputs.mouse.click~
+** Processing line: ~ spawn_sound_button = args.state.spawn_sound_buttons.find { |b| args.inputs.mouse.inside_rect? b.rect }~
+** Processing line: ~~
+** Processing line: ~ audio_click_key, audio_click_value = args.audio.find do |k, v|~
+** Processing line: ~ args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if spawn_sound_button~
+** Processing line: ~ args.state.selected = nil~
+** Processing line: ~ spawn_new_sound args, spawn_sound_button.name, spawn_sound_button.path~
+** Processing line: ~ elsif audio_click_key~
+** Processing line: ~ args.state.selected = audio_click_key~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.state.mouse_state == :held && args.state.selected~
+** Processing line: ~ v = args.audio[args.state.selected]~
+** Processing line: ~ if args.inputs.mouse.inside_rect? [v.screenx, v.screeny, args.state.boxsize, args.state.boxsize]~
+** Processing line: ~ args.state.dragging = args.state.selected~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.state.dragging~
+** Processing line: ~ s = args.audio[args.state.selected]~
+** Processing line: ~ # you can hang anything on the audio hashes you want, so we store the~
+** Processing line: ~ # actual screen position so it doesn't scale weirdly vs your mouse.~
+** Processing line: ~ s.screenx = args.inputs.mouse.x - (args.state.boxsize / 2)~
+** Processing line: ~ s.screeny = args.inputs.mouse.y - (args.state.boxsize / 2)~
+** Processing line: ~~
+** Processing line: ~ s.screeny = 50 if s.screeny < 50~
+** Processing line: ~ s.screeny = (719 - args.state.boxsize) if s.screeny > (719 - args.state.boxsize)~
+** Processing line: ~ s.screenx = 0 if s.screenx < 0~
+** Processing line: ~ s.screenx = (1279 - args.state.boxsize) if s.screenx > (1279 - args.state.boxsize)~
+** Processing line: ~~
+** Processing line: ~ s.x = ((s.screenx / 1279.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
+** Processing line: ~ s.y = ((s.screeny / 719.0) * 2.0) - 1.0 # scale to -1.0 - 1.0 range~
+** Processing line: ~ end~
+** Processing line: ~ elsif args.state.mouse_state == :released~
+** Processing line: ~ args.state.dragging = nil~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ input_panel args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults args~
+** Processing line: ~ args.state.mouse_state ||= :released~
+** Processing line: ~ args.state.dragging_source ||= false~
+** Processing line: ~ args.state.selected ||= 0~
+** Processing line: ~ args.state.next_sound_index ||= 0~
+** Processing line: ~ args.state.boxsize ||= 30~
+** 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: :spring, path: "sounds/spring.wav" },~
+** Processing line: ~ { name: :music, path: "sounds/music.ogg" }~
+** Processing line: ~ ]~
+** Processing line: ~~
+** Processing line: ~ # generate buttons based off the sound collection above~
+** Processing line: ~ args.state.spawn_sound_buttons ||= begin~
+** Processing line: ~ # create a group of buttons~
+** Processing line: ~ # column centered (using col_offset to calculate the column offset)~
+** Processing line: ~ # where each item is 2 columns apart~
+** Processing line: ~ rects = args.layout.rect_group row: 11,~
+** Processing line: ~ col_offset: {~
+** Processing line: ~ count: args.state.sound_files.length,~
+** Processing line: ~ w: 2~
+** Processing line: ~ },~
+** Processing line: ~ dcol: 2,~
+** Processing line: ~ w: 2,~
+** Processing line: ~ h: 1,~
+** Processing line: ~ group: args.state.sound_files~
+** Processing line: ~~
+** Processing line: ~ # now that you have the rects~
+** Processing line: ~ # construct the metadata for the buttons~
+** Processing line: ~ rects.map do |rect|~
+** Processing line: ~ {~
+** Processing line: ~ rect: rect,~
+** Processing line: ~ name: rect.name,~
+** Processing line: ~ path: rect.path,~
+** Processing line: ~ primitives: [~
+** Processing line: ~ rect.to_border(r: 255, g: 255, b: 255),~
+** Processing line: ~ rect.to_label(x: rect.center_x,~
+** Processing line: ~ y: rect.center_y,~
+** Processing line: ~ text: "#{rect.name}",~
+** Processing line: ~ alignment_enum: 1,~
+** Processing line: ~ vertical_alignment_enum: 1,~
+** Processing line: ~ r: 255, g: 255, b: 255)~
+** Processing line: ~ ]~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.mouse.up~
+** Processing line: ~ args.state.mouse_state = :released~
+** Processing line: ~ args.state.dragging_source = false~
+** Processing line: ~ elsif args.inputs.mouse.down~
+** Processing line: ~ args.state.mouse_state = :held~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.background_color = [ 0, 0, 0, 255 ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render args~
+** Processing line: ~ render_ui args~
+** Processing line: ~ render_sources args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~*** Advanced Audio - Audio Mixer - server_ip_address.txt~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Audio - Audio Mixer - server_ip_address.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 - server_ip_address.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/app/server_ip_address.txt~
+** Processing line: ~ 192.168.1.65~
+** Processing line: ~#+end_src~
+- 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.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Audio - Sound Synthesis - 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 Audio - Sound Synthesis - 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_audio/02_sound_synthesis/app/main.rb~
+** Processing line: ~ begin # region: top level tick methods~
+** Processing line: ~ def tick args~
+** Processing line: ~ defaults args~
+** Processing line: ~ render args~
+** Processing line: ~ input args~
+** Processing line: ~ process_audio_queue args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults args~
+** Processing line: ~ args.state.sine_waves ||= {}~
+** Processing line: ~ args.state.square_waves ||= {}~
+** Processing line: ~ args.state.saw_tooth_waves ||= {}~
+** Processing line: ~ args.state.triangle_waves ||= {}~
+** Processing line: ~ args.state.audio_queue ||= []~
+** Processing line: ~ args.state.buttons ||= [~
+** Processing line: ~ (frequency_buttons args),~
+** Processing line: ~ (sine_wave_note_buttons args),~
+** Processing line: ~ (bell_buttons args),~
+** Processing line: ~ (square_wave_note_buttons args),~
+** Processing line: ~ (saw_tooth_wave_note_buttons args),~
+** Processing line: ~ (triangle_wave_note_buttons args),~
+** Processing line: ~ ].flatten~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render args~
+** Processing line: ~ args.outputs.borders << args.state.buttons.map { |b| b[:border] }~
+** Processing line: ~ args.outputs.labels << args.state.buttons.map { |b| b[:label] }~
+** Processing line: ~ args.outputs.labels << args.layout~
+** Processing line: ~ .rect(row: 0, col: 11.5)~
+** Processing line: ~ .yield_self { |r| r.merge y: r.y + r.h }~
+** Processing line: ~ .merge(text: "This is a Pro only feature. Click here to watch the YouTube video if you are on the Standard License.",~
+** Processing line: ~ alignment_enum: 1)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~ def input args~
+** Processing line: ~ args.state.buttons.each do |b|~
+** Processing line: ~ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? b[:rect])~
+** Processing line: ~ parameter_string = (b.slice :frequency, :note, :octave).map { |k, v| "#{k}: #{v}" }.join ", "~
+** Processing line: ~ args.gtk.notify! "#{b[:method_to_call]} #{parameter_string}"~
+** Processing line: ~ send b[:method_to_call], args, b~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.mouse.click && (args.inputs.mouse.click.inside_rect? (args.layout.rect(row: 0).yield_self { |r| r.merge y: r.y + r.h.half, h: r.h.half }))~
+** Processing line: ~ args.gtk.openurl 'https://www.youtube.com/watch?v=zEzovM5jT-k&ab_channel=AmirRajan'~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def process_audio_queue args~
+** Processing line: ~ to_queue = args.state.audio_queue.find_all { |v| v[:queue_at] <= args.tick_count }~
+** Processing line: ~ args.state.audio_queue -= to_queue~
+** Processing line: ~ to_queue.each { |a| args.audio[a[:id]] = a }~
+** Processing line: ~~
+** Processing line: ~ args.audio.find_all { |k, v| v[:decay_rate] }~
+** Processing line: ~ .each { |k, v| v[:gain] -= v[:decay_rate] }~
+** Processing line: ~~
+** Processing line: ~ sounds_to_stop = args.audio~
+** Processing line: ~ .find_all { |k, v| v[:stop_at] && args.state.tick_count >= v[:stop_at] }~
+** Processing line: ~ .map { |k, v| k }~
+** Processing line: ~~
+** Processing line: ~ sounds_to_stop.each { |k| args.audio.delete k }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: button definitions, ui layout, callback functions~
+** Processing line: ~ def button args, opts~
+** Processing line: ~ button_def = opts.merge rect: (args.layout.rect (opts.merge w: 2, h: 1))~
+** Processing line: ~~
+** Processing line: ~ button_def[:border] = button_def[:rect].merge r: 0, g: 0, b: 0~
+** Processing line: ~~
+** Processing line: ~ label_offset_x = 5~
+** Processing line: ~ label_offset_y = 30~
+** Processing line: ~~
+** Processing line: ~ button_def[:label] = button_def[:rect].merge text: opts[:text],~
+** Processing line: ~ size_enum: -2.5,~
+** Processing line: ~ x: button_def[:rect].x + label_offset_x,~
+** Processing line: ~ y: button_def[:rect].y + label_offset_y~
+** Processing line: ~~
+** Processing line: ~ button_def~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def play_sine_wave args, sender~
+** Processing line: ~ queue_sine_wave args,~
+** Processing line: ~ frequency: sender[:frequency],~
+** Processing line: ~ duration: 1.seconds,~
+** Processing line: ~ fade_out: true~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def play_note args, sender~
+** Processing line: ~ method_to_call = :queue_sine_wave~
+** Processing line: ~ method_to_call = :queue_square_wave if sender[:type] == :square~
+** Processing line: ~ method_to_call = :queue_saw_tooth_wave if sender[:type] == :saw_tooth~
+** Processing line: ~ method_to_call = :queue_triangle_wave if sender[:type] == :triangle~
+** Processing line: ~ method_to_call = :queue_bell if sender[:type] == :bell~
+** Processing line: ~~
+** Processing line: ~ send method_to_call, args,~
+** Processing line: ~ frequency: (frequency_for note: sender[:note], octave: sender[:octave]),~
+** Processing line: ~ duration: 1.seconds,~
+** Processing line: ~ fade_out: true~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def frequency_buttons args~
+** Processing line: ~ [~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 4.0, col: 0, text: "300hz",~
+** Processing line: ~ frequency: 300,~
+** Processing line: ~ method_to_call: :play_sine_wave),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 5.0, col: 0, text: "400hz",~
+** Processing line: ~ frequency: 400,~
+** Processing line: ~ method_to_call: :play_sine_wave),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 6.0, col: 0, text: "500hz",~
+** Processing line: ~ frequency: 500,~
+** Processing line: ~ method_to_call: :play_sine_wave),~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def sine_wave_note_buttons args~
+** Processing line: ~ [~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 1.5, col: 2, text: "Sine C4",~
+** Processing line: ~ note: :c, octave: 4, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 2.5, col: 2, text: "Sine D4",~
+** Processing line: ~ note: :d, octave: 4, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 3.5, col: 2, text: "Sine E4",~
+** Processing line: ~ note: :e, octave: 4, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 4.5, col: 2, text: "Sine F4",~
+** Processing line: ~ note: :f, octave: 4, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 5.5, col: 2, text: "Sine G4",~
+** Processing line: ~ note: :g, octave: 4, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 6.5, col: 2, text: "Sine A5",~
+** Processing line: ~ note: :a, octave: 5, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 7.5, col: 2, text: "Sine B5",~
+** Processing line: ~ note: :b, octave: 5, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 8.5, col: 2, text: "Sine C5",~
+** Processing line: ~ note: :c, octave: 5, type: :sine, method_to_call: :play_note),~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def square_wave_note_buttons args~
+** Processing line: ~ [~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 1.5, col: 6, text: "Square C4",~
+** Processing line: ~ note: :c, octave: 4, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 2.5, col: 6, text: "Square D4",~
+** Processing line: ~ note: :d, octave: 4, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 3.5, col: 6, text: "Square E4",~
+** Processing line: ~ note: :e, octave: 4, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 4.5, col: 6, text: "Square F4",~
+** Processing line: ~ note: :f, octave: 4, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 5.5, col: 6, text: "Square G4",~
+** Processing line: ~ note: :g, octave: 4, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 6.5, col: 6, text: "Square A5",~
+** Processing line: ~ note: :a, octave: 5, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 7.5, col: 6, text: "Square B5",~
+** Processing line: ~ note: :b, octave: 5, type: :square, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 8.5, col: 6, text: "Square C5",~
+** Processing line: ~ note: :c, octave: 5, type: :square, method_to_call: :play_note),~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~ def saw_tooth_wave_note_buttons args~
+** Processing line: ~ [~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 1.5, col: 8, text: "Saw C4",~
+** Processing line: ~ note: :c, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 2.5, col: 8, text: "Saw D4",~
+** Processing line: ~ note: :d, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 3.5, col: 8, text: "Saw E4",~
+** Processing line: ~ note: :e, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 4.5, col: 8, text: "Saw F4",~
+** Processing line: ~ note: :f, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 5.5, col: 8, text: "Saw G4",~
+** Processing line: ~ note: :g, octave: 4, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 6.5, col: 8, text: "Saw A5",~
+** Processing line: ~ note: :a, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 7.5, col: 8, text: "Saw B5",~
+** Processing line: ~ note: :b, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 8.5, col: 8, text: "Saw C5",~
+** Processing line: ~ note: :c, octave: 5, type: :saw_tooth, method_to_call: :play_note),~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def triangle_wave_note_buttons args~
+** Processing line: ~ [~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 1.5, col: 10, text: "Triangle C4",~
+** Processing line: ~ note: :c, octave: 4, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 2.5, col: 10, text: "Triangle D4",~
+** Processing line: ~ note: :d, octave: 4, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 3.5, col: 10, text: "Triangle E4",~
+** Processing line: ~ note: :e, octave: 4, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 4.5, col: 10, text: "Triangle F4",~
+** Processing line: ~ note: :f, octave: 4, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 5.5, col: 10, text: "Triangle G4",~
+** Processing line: ~ note: :g, octave: 4, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 6.5, col: 10, text: "Triangle A5",~
+** Processing line: ~ note: :a, octave: 5, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 7.5, col: 10, text: "Triangle B5",~
+** Processing line: ~ note: :b, octave: 5, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 8.5, col: 10, text: "Triangle C5",~
+** Processing line: ~ note: :c, octave: 5, type: :triangle, method_to_call: :play_note),~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def bell_buttons args~
+** Processing line: ~ [~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 1.5, col: 4, text: "Bell C4",~
+** Processing line: ~ note: :c, octave: 4, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 2.5, col: 4, text: "Bell D4",~
+** Processing line: ~ note: :d, octave: 4, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 3.5, col: 4, text: "Bell E4",~
+** Processing line: ~ note: :e, octave: 4, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 4.5, col: 4, text: "Bell F4",~
+** Processing line: ~ note: :f, octave: 4, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 5.5, col: 4, text: "Bell G4",~
+** Processing line: ~ note: :g, octave: 4, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 6.5, col: 4, text: "Bell A5",~
+** Processing line: ~ note: :a, octave: 5, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 7.5, col: 4, text: "Bell B5",~
+** Processing line: ~ note: :b, octave: 5, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ (button args,~
+** Processing line: ~ row: 8.5, col: 4, text: "Bell C5",~
+** Processing line: ~ note: :c, octave: 5, type: :bell, method_to_call: :play_note),~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: wave generation~
+** Processing line: ~ begin # sine wave~
+** Processing line: ~ def defaults_sine_wave_for~
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def sine_wave_for opts = {}~
+** Processing line: ~ opts = defaults_sine_wave_for.merge opts~
+** Processing line: ~ frequency = opts[:frequency]~
+** Processing line: ~ sample_rate = opts[:sample_rate]~
+** Processing line: ~ period_size = (sample_rate.fdiv frequency).ceil~
+** Processing line: ~ period_size.map_with_index do |i|~
+** Processing line: ~ Math::sin((2.0 * Math::PI) / (sample_rate.to_f / frequency.to_f) * i)~
+** Processing line: ~ end.to_a~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults_queue_sine_wave~
+** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_sine_wave args, opts = {}~
+** Processing line: ~ opts = defaults_queue_sine_wave.merge opts~
+** Processing line: ~ frequency = opts[:frequency]~
+** Processing line: ~ sample_rate = 48000~
+** Processing line: ~~
+** Processing line: ~ sine_wave = sine_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~ args.state.sine_waves[frequency] ||= sine_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~~
+** Processing line: ~ proc = lambda do~
+** Processing line: ~ generate_audio_data args.state.sine_waves[frequency], sample_rate~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ audio_state = new_audio_state args, opts~
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: sine_wave~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: square wave~
+** Processing line: ~ def defaults_square_wave_for~
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def square_wave_for opts = {}~
+** Processing line: ~ opts = defaults_square_wave_for.merge opts~
+** Processing line: ~ sine_wave = sine_wave_for opts~
+** Processing line: ~ sine_wave.map do |v|~
+** Processing line: ~ if v >= 0~
+** Processing line: ~ 1.0~
+** Processing line: ~ else~
+** Processing line: ~ -1.0~
+** Processing line: ~ end~
+** Processing line: ~ end.to_a~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults_queue_square_wave~
+** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_square_wave args, opts = {}~
+** Processing line: ~ opts = defaults_queue_square_wave.merge opts~
+** Processing line: ~ frequency = opts[:frequency]~
+** Processing line: ~ sample_rate = 48000~
+** Processing line: ~~
+** Processing line: ~ square_wave = square_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~ args.state.square_waves[frequency] ||= square_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~~
+** Processing line: ~ proc = lambda do~
+** Processing line: ~ generate_audio_data args.state.square_waves[frequency], sample_rate~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ audio_state = new_audio_state args, opts~
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: square_wave~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: saw tooth wave~
+** Processing line: ~ def defaults_saw_tooth_wave_for~
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def saw_tooth_wave_for opts = {}~
+** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
+** Processing line: ~ sine_wave = sine_wave_for opts~
+** Processing line: ~ period_size = sine_wave.length~
+** Processing line: ~ sine_wave.map_with_index do |v, i|~
+** Processing line: ~ (((i % period_size).fdiv period_size) * 2) - 1~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults_queue_saw_tooth_wave~
+** Processing line: ~ { frequency: 440, duration: 60, gain: 0.3, fade_out: false, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_saw_tooth_wave args, opts = {}~
+** Processing line: ~ opts = defaults_queue_saw_tooth_wave.merge opts~
+** Processing line: ~ frequency = opts[:frequency]~
+** Processing line: ~ sample_rate = 48000~
+** Processing line: ~~
+** Processing line: ~ saw_tooth_wave = saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~ args.state.saw_tooth_waves[frequency] ||= saw_tooth_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~~
+** Processing line: ~ proc = lambda do~
+** Processing line: ~ generate_audio_data args.state.saw_tooth_waves[frequency], sample_rate~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ audio_state = new_audio_state args, opts~
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: saw_tooth_wave~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: triangle wave~
+** Processing line: ~ def defaults_triangle_wave_for~
+** Processing line: ~ { frequency: 440, sample_rate: 48000 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def triangle_wave_for opts = {}~
+** Processing line: ~ opts = defaults_saw_tooth_wave_for.merge opts~
+** Processing line: ~ sine_wave = sine_wave_for opts~
+** Processing line: ~ period_size = sine_wave.length~
+** Processing line: ~ sine_wave.map_with_index do |v, i|~
+** Processing line: ~ ratio = (i.fdiv period_size)~
+** Processing line: ~ if ratio <= 0.5~
+** Processing line: ~ (ratio * 4) - 1~
+** Processing line: ~ else~
+** Processing line: ~ ratio -= 0.5~
+** Processing line: ~ 1 - (ratio * 4)~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults_queue_triangle_wave~
+** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_triangle_wave args, opts = {}~
+** Processing line: ~ opts = defaults_queue_triangle_wave.merge opts~
+** Processing line: ~ frequency = opts[:frequency]~
+** Processing line: ~ sample_rate = 48000~
+** Processing line: ~~
+** Processing line: ~ triangle_wave = triangle_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~ args.state.triangle_waves[frequency] ||= triangle_wave_for frequency: frequency, sample_rate: sample_rate~
+** Processing line: ~~
+** Processing line: ~ proc = lambda do~
+** Processing line: ~ generate_audio_data args.state.triangle_waves[frequency], sample_rate~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ audio_state = new_audio_state args, opts~
+** Processing line: ~ audio_state[:input] = [1, sample_rate, proc]~
+** Processing line: ~ queue_audio args, audio_state: audio_state, wave: triangle_wave~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: bell~
+** Processing line: ~ def defaults_queue_bell~
+** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_bell args, opts = {}~
+** Processing line: ~ (bell_to_sine_waves (defaults_queue_bell.merge opts)).each { |b| queue_sine_wave args, b }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def bell_harmonics~
+** Processing line: ~ [~
+** Processing line: ~ { frequency_ratio: 0.5, duration_ratio: 1.00 },~
+** Processing line: ~ { frequency_ratio: 1.0, duration_ratio: 0.80 },~
+** Processing line: ~ { frequency_ratio: 2.0, duration_ratio: 0.60 },~
+** Processing line: ~ { frequency_ratio: 3.0, duration_ratio: 0.40 },~
+** Processing line: ~ { frequency_ratio: 4.2, duration_ratio: 0.25 },~
+** Processing line: ~ { frequency_ratio: 5.4, duration_ratio: 0.20 },~
+** Processing line: ~ { frequency_ratio: 6.8, duration_ratio: 0.15 }~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults_bell_to_sine_waves~
+** Processing line: ~ { frequency: 440, duration: 1.seconds, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def bell_to_sine_waves opts = {}~
+** Processing line: ~ opts = defaults_bell_to_sine_waves.merge opts~
+** Processing line: ~ bell_harmonics.map do |b|~
+** Processing line: ~ {~
+** Processing line: ~ frequency: opts[:frequency] * b[:frequency_ratio],~
+** Processing line: ~ duration: opts[:duration] * b[:duration_ratio],~
+** Processing line: ~ queue_in: opts[:queue_in],~
+** Processing line: ~ gain: (1.fdiv bell_harmonics.length),~
+** Processing line: ~ fade_out: true~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # audio entity construction~
+** Processing line: ~ def generate_audio_data sine_wave, sample_rate~
+** Processing line: ~ sample_size = (sample_rate.fdiv (1000.fdiv 60)).ceil~
+** Processing line: ~ copy_count = (sample_size.fdiv sine_wave.length).ceil~
+** Processing line: ~ sine_wave * copy_count~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def defaults_new_audio_state~
+** Processing line: ~ { frequency: 440, duration: 60, gain: 1.0, fade_out: false, queue_in: 0 }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def new_audio_state args, opts = {}~
+** Processing line: ~ opts = defaults_new_audio_state.merge opts~
+** Processing line: ~ decay_rate = 0~
+** Processing line: ~ decay_rate = 1.fdiv(opts[:duration]) * opts[:gain] if opts[:fade_out]~
+** Processing line: ~ frequency = opts[:frequency]~
+** Processing line: ~ sample_rate = 48000~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ id: (new_id! args),~
+** Processing line: ~ frequency: frequency,~
+** Processing line: ~ sample_rate: 48000,~
+** Processing line: ~ stop_at: args.tick_count + opts[:queue_in] + opts[:duration],~
+** Processing line: ~ gain: opts[:gain].to_f,~
+** Processing line: ~ queue_at: args.state.tick_count + opts[:queue_in],~
+** Processing line: ~ decay_rate: decay_rate,~
+** Processing line: ~ pitch: 1.0,~
+** Processing line: ~ looping: true,~
+** Processing line: ~ paused: false~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def queue_audio args, opts = {}~
+** Processing line: ~ graph_wave args, opts[:wave], opts[:audio_state][:frequency]~
+** Processing line: ~ args.state.audio_queue << opts[:audio_state]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def new_id! args~
+** Processing line: ~ args.state.audio_id ||= 0~
+** Processing line: ~ args.state.audio_id += 1~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def graph_wave args, wave, frequency~
+** Processing line: ~ if args.state.tick_count != args.state.graphed_at~
+** Processing line: ~ args.outputs.static_lines.clear~
+** Processing line: ~ args.outputs.static_sprites.clear~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ wave = wave~
+** Processing line: ~~
+** Processing line: ~ r, g, b = frequency.to_i % 85,~
+** Processing line: ~ frequency.to_i % 170,~
+** Processing line: ~ frequency.to_i % 255~
+** Processing line: ~~
+** Processing line: ~ starting_rect = args.layout.rect(row: 5, col: 13)~
+** Processing line: ~ x_scale = 10~
+** Processing line: ~ y_scale = 100~
+** Processing line: ~ max_points = 25~
+** Processing line: ~~
+** Processing line: ~ points = wave~
+** Processing line: ~ if wave.length > max_points~
+** Processing line: ~ resolution = wave.length.idiv max_points~
+** Processing line: ~ points = wave.find_all.with_index { |y, i| (i % resolution == 0) }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.static_lines << points.map_with_index do |y, x|~
+** Processing line: ~ next_y = points[x + 1]~
+** Processing line: ~~
+** Processing line: ~ if next_y~
+** Processing line: ~ {~
+** Processing line: ~ x: starting_rect.x + (x * x_scale),~
+** Processing line: ~ y: starting_rect.y + starting_rect.h.half + y_scale * y,~
+** Processing line: ~ x2: starting_rect.x + ((x + 1) * x_scale),~
+** Processing line: ~ y2: starting_rect.y + starting_rect.h.half + y_scale * next_y,~
+** Processing line: ~ r: r,~
+** Processing line: ~ g: g,~
+** Processing line: ~ b: b~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.static_sprites << points.map_with_index do |y, x|~
+** Processing line: ~ {~
+** Processing line: ~ x: (starting_rect.x + (x * x_scale)) - 2,~
+** Processing line: ~ y: (starting_rect.y + starting_rect.h.half + y_scale * y) - 2,~
+** Processing line: ~ w: 4,~
+** Processing line: ~ h: 4,~
+** Processing line: ~ path: 'sprites/square-white.png',~
+** Processing line: ~ r: r,~
+** Processing line: ~ g: g,~
+** Processing line: ~ b: b~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.state.graphed_at = args.state.tick_count~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ begin # region: musical note mapping~
+** Processing line: ~ def defaults_frequency_for~
+** Processing line: ~ { note: :a, octave: 5, sharp: false, flat: false }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def frequency_for opts = {}~
+** Processing line: ~ opts = defaults_frequency_for.merge opts~
+** Processing line: ~ octave_offset_multiplier = opts[:octave] - 5~
+** Processing line: ~ note = note_frequencies_octave_5[opts[:note]]~
+** Processing line: ~ if octave_offset_multiplier < 0~
+** Processing line: ~ note = note * 1 / (octave_offset_multiplier.abs + 1)~
+** Processing line: ~ elsif octave_offset_multiplier > 0~
+** Processing line: ~ note = note * (octave_offset_multiplier.abs + 1) / 1~
+** Processing line: ~ end~
+** Processing line: ~ note~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def note_frequencies_octave_5~
+** Processing line: ~ {~
+** Processing line: ~ a: 440.0,~
+** Processing line: ~ a_sharp: 466.16, b_flat: 466.16,~
+** Processing line: ~ b: 493.88,~
+** Processing line: ~ c: 523.25,~
+** Processing line: ~ c_sharp: 554.37, d_flat: 587.33,~
+** Processing line: ~ d: 587.33,~
+** Processing line: ~ d_sharp: 622.25, e_flat: 659.25,~
+** Processing line: ~ e: 659.25,~
+** Processing line: ~ f: 698.25,~
+** Processing line: ~ f_sharp: 739.99, g_flat: 739.99,~
+** Processing line: ~ g: 783.99,~
+** Processing line: ~ g_sharp: 830.61, a_flat: 830.61~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $gtk.reset~
+** 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.
@@ -194306,7 +204309,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ flip_horizontally: false,~
** Processing line: ~ angle_anchor_x: 0.5, # rotation center set to middle~
** Processing line: ~ angle_anchor_y: 0.5~
-** Processing line: ~ }.sprite~
+** Processing line: ~ }.sprite!~
** Processing line: ~~
** Processing line: ~ # Outputs label as primitive using a hash~
** Processing line: ~ args.outputs.primitives << {~
@@ -194320,7 +204323,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ b: 50,~
** Processing line: ~ a: 255, # transparency~
** Processing line: ~ font: "fonts/manaspc.ttf" # font style~
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
** Processing line: ~~
** Processing line: ~ # Outputs solid as primitive using a hash~
** Processing line: ~ args.outputs.primitives << {~
@@ -194332,7 +204335,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 50,~
** Processing line: ~ b: 50,~
** Processing line: ~ a: 255 # transparency~
-** Processing line: ~ }.solid~
+** Processing line: ~ }.solid!~
** Processing line: ~~
** Processing line: ~ # Outputs border as primitive using a hash~
** Processing line: ~ # Same parameters as solid~
@@ -194345,7 +204348,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 50,~
** Processing line: ~ b: 50,~
** Processing line: ~ a: 255 # transparency~
-** Processing line: ~ }.border~
+** Processing line: ~ }.border!~
** Processing line: ~~
** Processing line: ~ # Outputs line as primitive using a hash~
** Processing line: ~ args.outputs.primitives << {~
@@ -194357,7 +204360,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 50,~
** Processing line: ~ b: 50,~
** Processing line: ~ a: 255 # transparency~
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
@@ -194426,6 +204429,120 @@ 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 - Simple Camera - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Rendering - Simple Camera - 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 - Simple Camera - 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/07_simple_camera/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ # variables you can play around with~
+** Processing line: ~ args.state.world.w ||= 1280~
+** Processing line: ~ args.state.world.h ||= 720~
+** Processing line: ~~
+** Processing line: ~ args.state.player.x ||= 0~
+** Processing line: ~ args.state.player.y ||= 0~
+** Processing line: ~ args.state.player.size ||= 32~
+** Processing line: ~~
+** Processing line: ~ args.state.enemy.x ||= 700~
+** Processing line: ~ args.state.enemy.y ||= 700~
+** Processing line: ~ args.state.enemy.size ||= 16~
+** Processing line: ~~
+** Processing line: ~ args.state.camera.x ||= 640~
+** Processing line: ~ args.state.camera.y ||= 300~
+** Processing line: ~ args.state.camera.scale ||= 1.0~
+** Processing line: ~ args.state.camera.show_empty_space ||= :yes~
+** Processing line: ~~
+** Processing line: ~ # instructions~
+** Processing line: ~ args.outputs.primitives << { x: 0, y: 80.from_top, w: 360, h: 80, r: 0, g: 0, b: 0, a: 128 }.solid!~
+** Processing line: ~ args.outputs.primitives << { x: 10, y: 10.from_top, text: "arrow keys to move around", r: 255, g: 255, b: 255}.label!~
+** Processing line: ~ args.outputs.primitives << { x: 10, y: 30.from_top, text: "+/- to change zoom of camera", r: 255, g: 255, b: 255}.label!~
+** Processing line: ~ args.outputs.primitives << { x: 10, y: 50.from_top, text: "tab to change camera edge behavior", r: 255, g: 255, b: 255}.label!~
+** Processing line: ~~
+** Processing line: ~ # render scene~
+** Processing line: ~ args.outputs[:scene].w = args.state.world.w~
+** Processing line: ~ args.outputs[:scene].h = args.state.world.h~
+** Processing line: ~~
+** Processing line: ~ args.outputs[:scene].solids << { x: 0, y: 0, w: args.state.world.w, h: args.state.world.h, r: 20, g: 60, b: 80 }~
+** Processing line: ~ args.outputs[:scene].solids << { x: args.state.player.x, y: args.state.player.y,~
+** Processing line: ~ w: args.state.player.size, h: args.state.player.size, r: 80, g: 155, b: 80 }~
+** Processing line: ~ args.outputs[:scene].solids << { x: args.state.enemy.x, y: args.state.enemy.y,~
+** Processing line: ~ w: args.state.enemy.size, h: args.state.enemy.size, r: 155, g: 80, b: 80 }~
+** Processing line: ~~
+** Processing line: ~ # render camera~
+** Processing line: ~ scene_position = calc_scene_position args~
+** Processing line: ~ args.outputs.sprites << { x: scene_position.x,~
+** Processing line: ~ y: scene_position.y,~
+** Processing line: ~ w: scene_position.w,~
+** Processing line: ~ h: scene_position.h,~
+** Processing line: ~ path: :scene }~
+** Processing line: ~~
+** Processing line: ~ # move player~
+** Processing line: ~ if args.inputs.directional_angle~
+** Processing line: ~ args.state.player.x += args.inputs.directional_angle.vector_x * 5~
+** Processing line: ~ args.state.player.y += args.inputs.directional_angle.vector_y * 5~
+** Processing line: ~ args.state.player.x = args.state.player.x.clamp(0, args.state.world.w - args.state.player.size)~
+** Processing line: ~ args.state.player.y = args.state.player.y.clamp(0, args.state.world.h - args.state.player.size)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # +/- to zoom in and out~
+** Processing line: ~ if args.inputs.keyboard.plus && args.state.tick_count.zmod?(3)~
+** Processing line: ~ args.state.camera.scale += 0.05~
+** Processing line: ~ elsif args.inputs.keyboard.hyphen && args.state.tick_count.zmod?(3)~
+** Processing line: ~ args.state.camera.scale -= 0.05~
+** Processing line: ~ elsif args.inputs.keyboard.key_down.tab~
+** Processing line: ~ if args.state.camera.show_empty_space == :yes~
+** Processing line: ~ args.state.camera.show_empty_space = :no~
+** Processing line: ~ else~
+** Processing line: ~ args.state.camera.show_empty_space = :yes~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.state.camera.scale = args.state.camera.scale.greater(0.1)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_scene_position args~
+** Processing line: ~ result = { x: args.state.camera.x - (args.state.player.x * args.state.camera.scale),~
+** Processing line: ~ y: args.state.camera.y - (args.state.player.y * args.state.camera.scale),~
+** Processing line: ~ w: args.state.world.w * args.state.camera.scale,~
+** Processing line: ~ h: args.state.world.h * args.state.camera.scale,~
+** Processing line: ~ scale: args.state.camera.scale }~
+** Processing line: ~~
+** Processing line: ~ return result if args.state.camera.show_empty_space == :yes~
+** Processing line: ~~
+** Processing line: ~ if result.w < args.grid.w~
+** Processing line: ~ result.merge!(x: (args.grid.w - result.w).half)~
+** Processing line: ~ elsif (args.state.player.x * result.scale) < args.grid.w.half~
+** Processing line: ~ result.merge!(x: 10)~
+** Processing line: ~ elsif (result.x + result.w) < args.grid.w~
+** Processing line: ~ result.merge!(x: - result.w + (args.grid.w - 10))~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if result.h < args.grid.h~
+** Processing line: ~ result.merge!(y: (args.grid.h - result.h).half)~
+** Processing line: ~ elsif (result.y) > 10~
+** Processing line: ~ result.merge!(y: 10)~
+** Processing line: ~ elsif (result.y + result.h) < args.grid.h~
+** Processing line: ~ result.merge!(y: - result.h + (args.grid.h - 10))~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ result~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Advanced Rendering - Splitscreen Camera - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -194441,7 +204558,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/07_advanced_rendering/07_splitscreen_camera/app/main.rb~
+** Processing line: ~ # ./samples/07_advanced_rendering/08_splitscreen_camera/app/main.rb~
** Processing line: ~ class CameraMovement~
** Processing line: ~ attr_accessor :state, :inputs, :outputs, :grid~
** Processing line: ~~
@@ -194857,7 +204974,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/07_advanced_rendering/08_z_targeting_camera/app/main.rb~
+** Processing line: ~ # ./samples/07_advanced_rendering/09_z_targeting_camera/app/main.rb~
** Processing line: ~ class Game~
** Processing line: ~ attr_gtk~
** Processing line: ~~
@@ -194969,6 +205086,76 @@ 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 - Blend Modes - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Rendering - Blend Modes - 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 - Blend Modes - 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/10_blend_modes/app/main.rb~
+** Processing line: ~ $gtk.reset~
+** Processing line: ~~
+** Processing line: ~ def draw_blendmode args, mode~
+** Processing line: ~ w = 160~
+** Processing line: ~ h = w~
+** Processing line: ~ args.state.x += (1280-w) / (args.state.blendmodes.length + 1)~
+** Processing line: ~ x = args.state.x~
+** Processing line: ~ y = (720 - h) / 2~
+** Processing line: ~ s = 'sprites/blue-feathered.png'~
+** Processing line: ~ args.outputs.sprites << { blendmode_enum: mode.value, x: x, y: y, w: w, h: h, path: s }~
+** Processing line: ~ args.outputs.labels << [x + (w/2), y, mode.name.to_s, 1, 1, 255, 255, 255]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick args~
+** Processing line: ~~
+** Processing line: ~ # Different blend modes do different things, depending on what they~
+** Processing line: ~ # blend against (in this case, the pixels of the background color).~
+** Processing line: ~ args.state.bg_element ||= 1~
+** Processing line: ~ args.state.bg_color ||= 255~
+** Processing line: ~ args.state.bg_color_direction ||= 1~
+** Processing line: ~ bg_r = (args.state.bg_element == 1) ? args.state.bg_color : 0~
+** Processing line: ~ bg_g = (args.state.bg_element == 2) ? args.state.bg_color : 0~
+** Processing line: ~ bg_b = (args.state.bg_element == 3) ? args.state.bg_color : 0~
+** Processing line: ~ args.state.bg_color += args.state.bg_color_direction~
+** Processing line: ~ if (args.state.bg_color_direction > 0) && (args.state.bg_color >= 255)~
+** Processing line: ~ args.state.bg_color_direction = -1~
+** Processing line: ~ args.state.bg_color = 255~
+** Processing line: ~ elsif (args.state.bg_color_direction < 0) && (args.state.bg_color <= 0)~
+** Processing line: ~ args.state.bg_color_direction = 1~
+** Processing line: ~ args.state.bg_color = 0~
+** Processing line: ~ args.state.bg_element += 1~
+** Processing line: ~ if args.state.bg_element >= 4~
+** Processing line: ~ args.state.bg_element = 1~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.background_color = [ bg_r, bg_g, bg_b, 255 ]~
+** Processing line: ~~
+** Processing line: ~ args.state.blendmodes ||= [~
+** Processing line: ~ { name: :none, value: 0 },~
+** Processing line: ~ { name: :blend, value: 1 },~
+** Processing line: ~ { name: :add, value: 2 },~
+** Processing line: ~ { name: :mod, value: 3 },~
+** Processing line: ~ { name: :mul, value: 4 }~
+** Processing line: ~ ]~
+** Processing line: ~~
+** Processing line: ~ args.state.x = 0 # reset this, draw_blendmode will increment it.~
+** Processing line: ~ args.state.blendmodes.each { |blendmode| draw_blendmode args, blendmode }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Tweening Lerping Easing Functions - Easing Functions - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -195534,7 +205721,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ # sets console command when sample app initially opens~
** Processing line: ~ if Kernel.global_tick_count == 0~
-** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts "========================================================="~
+** Processing line: ~ puts "* INFO: Sprites, Hashes"~
+** 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: ~~
@@ -195619,7 +205810,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ # sets console command when sample app initially opens~
** Processing line: ~ if Kernel.global_tick_count == 0~
-** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts "========================================================="~
+** Processing line: ~ puts "* INFO: Sprites, Open Entities"~
+** 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: ~~
@@ -195708,7 +205903,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ # sets console command when sample app initially opens~
** Processing line: ~ if Kernel.global_tick_count == 0~
-** Processing line: ~ puts "* INFO - Please specify the number of sprites to render."~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts ""~
+** Processing line: ~ puts "========================================================="~
+** Processing line: ~ puts "* INFO: Sprites, Strict Entities"~
+** 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: ~~
@@ -195780,6 +205979,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def tick args~
** 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, Classes"~
+** 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: ~~
@@ -195852,19 +206056,24 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def tick args~
** 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: Static Sprites, Classes"~
+** 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| Star.new args.grid }~
+** Processing line: ~ args.outputs.static_sprites << args.state.stars~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # update~
** Processing line: ~ args.state.stars.each(&:move)~
** 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~
@@ -195937,10 +206146,21 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # path,~
** Processing line: ~ # angle,~
** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~
+** Processing line: ~ # tile_x, tile_y, tile_w, tile_h,~
** Processing line: ~ # flip_horizontally, flip_vertically,~
-** Processing line: ~ # tile_x, tile_y, tile_w, tile_h~
** Processing line: ~ # angle_anchor_x, angle_anchor_y,~
** Processing line: ~ # source_x, source_y, source_w, source_h~
+** Processing line: ~~
+** Processing line: ~ # The argument order for ffi_draw.draw_sprite_4 is:~
+** Processing line: ~ # x, y, w, h,~
+** Processing line: ~ # path,~
+** Processing line: ~ # angle,~
+** Processing line: ~ # alpha, red_saturation, green_saturation, blue_saturation~
+** Processing line: ~ # tile_x, tile_y, tile_w, tile_h,~
+** Processing line: ~ # flip_horizontally, flip_vertically,~
+** Processing line: ~ # angle_anchor_x, angle_anchor_y,~
+** Processing line: ~ # source_x, source_y, source_w, source_h,~
+** Processing line: ~ # blendmode_enum~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -195948,6 +206168,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def tick args~
** 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: Static Sprites, Classes, Draw Override"~
+** 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: ~~
@@ -196165,6 +206390,70 @@ 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 - Unit Tests - benchmark_api_tests.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Debugging - Unit Tests - benchmark_api_tests.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 - Unit Tests - benchmark_api_tests.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/03_unit_tests/benchmark_api_tests.rb~
+** Processing line: ~ def test_benchmark_api args, assert~
+** Processing line: ~ result = args.gtk.benchmark iterations: 100,~
+** Processing line: ~ only_one: -> () {~
+** Processing line: ~ r = 0~
+** Processing line: ~ (1..100).each do |i|~
+** Processing line: ~ r += 1~
+** Processing line: ~ end~
+** Processing line: ~ }~
+** Processing line: ~~
+** Processing line: ~ assert.equal! result.first_place.name, :only_one~
+** Processing line: ~~
+** Processing line: ~ result = args.gtk.benchmark iterations: 100,~
+** Processing line: ~ iterations_100: -> () {~
+** Processing line: ~ r = 0~
+** Processing line: ~ (1..100).each do |i|~
+** Processing line: ~ r += 1~
+** Processing line: ~ end~
+** Processing line: ~ },~
+** Processing line: ~ iterations_50: -> () {~
+** Processing line: ~ r = 0~
+** Processing line: ~ (1..50).each do |i|~
+** Processing line: ~ r += 1~
+** Processing line: ~ end~
+** Processing line: ~ }~
+** Processing line: ~~
+** Processing line: ~ assert.equal! result.first_place.name, :iterations_50~
+** Processing line: ~~
+** Processing line: ~ result = args.gtk.benchmark iterations: 1,~
+** Processing line: ~ iterations_100: -> () {~
+** Processing line: ~ r = 0~
+** Processing line: ~ (1..100).each do |i|~
+** Processing line: ~ r += 1~
+** Processing line: ~ end~
+** Processing line: ~ },~
+** Processing line: ~ iterations_50: -> () {~
+** Processing line: ~ r = 0~
+** Processing line: ~ (1..50).each do |i|~
+** Processing line: ~ r += 1~
+** Processing line: ~ end~
+** Processing line: ~ }~
+** Processing line: ~~
+** Processing line: ~ assert.equal! result.too_small_to_measure, true~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Advanced Debugging - Unit Tests - exception_raising_tests.rb~
- H3 detected.
- Determining if line is a header.
@@ -196805,6 +207094,157 @@ 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 - Unit Tests - pretty_format_tests.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Advanced Debugging - Unit Tests - pretty_format_tests.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 - Unit Tests - pretty_format_tests.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/03_unit_tests/pretty_format_tests.rb~
+** Processing line: ~ def H opts~
+** Processing line: ~ opts~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def A *opts~
+** Processing line: ~ opts~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def assert_format args, assert, hash, expected~
+** Processing line: ~ actual = args.fn.pretty_format hash~
+** Processing line: ~ assert.are_equal! actual, expected~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def test_pretty_print args, assert~
+** Processing line: ~ # =============================~
+** Processing line: ~ # hash with single value~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (H first_name: "John")~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ {:first_name "John"}~
+** Processing line: ~ S~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~~
+** Processing line: ~ # =============================~
+** Processing line: ~ # hash with two values~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (H first_name: "John", last_name: "Smith")~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ {:first_name "John"~
+** Processing line: ~ :last_name "Smith"}~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~~
+** Processing line: ~ # =============================~
+** Processing line: ~ # hash with inner hash~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (H first_name: "John",~
+** Processing line: ~ last_name: "Smith",~
+** Processing line: ~ middle_initial: "I",~
+** Processing line: ~ so: (H first_name: "Pocahontas",~
+** Processing line: ~ last_name: "Tsenacommacah"),~
+** Processing line: ~ friends: (A (H first_name: "Side", last_name: "Kick"),~
+** Processing line: ~ (H first_name: "Tim", last_name: "Wizard")))~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ {:first_name "John"~
+** Processing line: ~ :last_name "Smith"~
+** Processing line: ~ :middle_initial "I"~
+** Processing line: ~ :so {:first_name "Pocahontas"~
+** Processing line: ~ :last_name "Tsenacommacah"}~
+** Processing line: ~ :friends [{:first_name "Side"~
+** Processing line: ~ :last_name "Kick"}~
+** Processing line: ~ {:first_name "Tim"~
+** Processing line: ~ :last_name "Wizard"}]}~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~~
+** Processing line: ~ # =============================~
+** Processing line: ~ # array with one value~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (A 1)~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ [1]~
+** Processing line: ~ S~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~~
+** Processing line: ~ # =============================~
+** Processing line: ~ # array with multiple values~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (A 1, 2, 3)~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ [1~
+** Processing line: ~ 2~
+** Processing line: ~ 3]~
+** Processing line: ~ S~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~~
+** Processing line: ~ # =============================~
+** Processing line: ~ # array with multiple values hashes~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (A (H first_name: "Side", last_name: "Kick"),~
+** Processing line: ~ (H first_name: "Tim", last_name: "Wizard"))~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ [{:first_name "Side"~
+** Processing line: ~ :last_name "Kick"}~
+** Processing line: ~ {:first_name "Tim"~
+** Processing line: ~ :last_name "Wizard"}]~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def test_nested_nested args, assert~
+** Processing line: ~ # =============================~
+** Processing line: ~ # nested array in nested hash~
+** Processing line: ~ # =============================~
+** Processing line: ~ input = (H type: :root,~
+** Processing line: ~ text: "Root",~
+** Processing line: ~ children: (A (H level: 1,~
+** Processing line: ~ text: "Level 1",~
+** Processing line: ~ children: (A (H level: 2,~
+** Processing line: ~ text: "Level 2",~
+** Processing line: ~ children: [])))))~
+** Processing line: ~~
+** Processing line: ~ expected = <<-S~
+** Processing line: ~ {:type :root~
+** Processing line: ~ :text "Root"~
+** Processing line: ~ :children [{:level 1~
+** Processing line: ~ :text "Level 1"~
+** Processing line: ~ :children [{:level 2~
+** Processing line: ~ :text "Level 2"~
+** Processing line: ~ :children []}]}]}~
+** Processing line: ~~
+** Processing line: ~ S~
+** Processing line: ~~
+** Processing line: ~ (assert_format args, assert, input, expected)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def test_scene args, assert~
+** Processing line: ~ script = <<-S~
+** Processing line: ~ * Scene 1~
+** Processing line: ~ ** Narrator~
+** Processing line: ~ They say happy endings don't exist.~
+** Processing line: ~ ** Narrator~
+** Processing line: ~ They say true love is a lie.~
+** Processing line: ~ S~
+** Processing line: ~ input = parse_org args, script~
+** Processing line: ~ puts (args.fn.pretty_format input)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Advanced Debugging - Unit Tests - require_tests.rb~
- H3 detected.
- Determining if line is a header.
@@ -206876,6 +217316,489 @@ 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 - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Crafting - Farming Game 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: ~Crafting - Farming Game 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_crafting/farming_game_starting_point/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ args.state.tile_size = 80~
+** Processing line: ~ args.state.player_speed = 4~
+** Processing line: ~ args.state.player ||= tile(args, 7, 3, 0, 128, 180)~
+** Processing line: ~ generate_map args~
+** Processing line: ~ #press j to plant a green onion~
+** Processing line: ~ if args.inputs.keyboard.j~
+** Processing line: ~ #change this part you can change what you want to plant~
+** Processing line: ~ args.state.walls << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y)/args.state.tile_size), 255, 255, 255)~
+** Processing line: ~ args.state.plants << tile(args, ((args.state.player.x+80)/args.state.tile_size), ((args.state.player.y+80)/args.state.tile_size), 0, 160, 0)~
+** Processing line: ~ end~
+** Processing line: ~ # Adds walls, background, and player to args.outputs.solids so they appear on screen~
+** Processing line: ~ args.outputs.solids << [0,0,1280,720, 237,189,101]~
+** Processing line: ~ args.outputs.sprites << [0, 0, 1280, 720, 'sprites/background.png']~
+** Processing line: ~ args.outputs.solids << args.state.walls~
+** Processing line: ~ args.outputs.solids << args.state.player~
+** Processing line: ~ args.outputs.solids << args.state.plants~
+** Processing line: ~ args.outputs.labels << [320, 640, "press J to plant", 3, 1, 255, 0, 0, 200]~
+** Processing line: ~~
+** Processing line: ~ move_player args, -1, 0 if args.inputs.keyboard.left # x position decreases by 1 if left key is pressed~
+** Processing line: ~ move_player args, 1, 0 if args.inputs.keyboard.right # x position increases by 1 if right key is pressed~
+** Processing line: ~ move_player args, 0, 1 if args.inputs.keyboard.up # y position increases by 1 if up is pressed~
+** Processing line: ~ move_player args, 0, -1 if args.inputs.keyboard.down # y position decreases by 1 if down is pressed~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Sets position, size, and color of the tile~
+** Processing line: ~ def tile args, x, y, *color~
+** Processing line: ~ [x * args.state.tile_size, # sets definition for array using method parameters~
+** Processing line: ~ y * args.state.tile_size, # multiplying by tile_size sets x and y to correct position using pixel values~
+** Processing line: ~ args.state.tile_size,~
+** Processing line: ~ args.state.tile_size,~
+** Processing line: ~ *color]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Creates map by adding tiles to the wall, as well as a goal (that the player needs to reach)~
+** Processing line: ~ def generate_map args~
+** Processing line: ~ return if args.state.area~
+** Processing line: ~~
+** Processing line: ~ # Creates the area of the map. There are 9 rows running horizontally across the screen~
+** Processing line: ~ # and 16 columns running vertically on the screen. Any spot with a "1" is not~
+** Processing line: ~ # open for the player to move into (and is green), and any spot with a "0" is available~
+** Processing line: ~ # for the player to move in.~
+** Processing line: ~ args.state.area = [~
+** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],~
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+** Processing line: ~ [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,],~
+** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,],~
+** Processing line: ~ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ],~
+** Processing line: ~ ].reverse # reverses the order of the area collection~
+** Processing line: ~~
+** Processing line: ~ # By reversing the order, the way that the area appears above is how it appears~
+** Processing line: ~ # on the screen in the game. If we did not reverse, the map would appear inverted.~
+** Processing line: ~~
+** Processing line: ~ #The wall starts off with no tiles.~
+** Processing line: ~ args.state.walls = []~
+** Processing line: ~ args.state.plants = []~
+** Processing line: ~~
+** Processing line: ~ # If v is 1, a green tile is added to args.state.walls.~
+** Processing line: ~ # If v is 2, a black tile is created as the goal.~
+** Processing line: ~ args.state.area.map_2d do |y, x, v|~
+** Processing line: ~ if v == 1~
+** Processing line: ~ args.state.walls << tile(args, x, y, 255, 160, 156) # green tile~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Allows the player to move their box around the screen~
+** Processing line: ~ def move_player args, *vector~
+** Processing line: ~ box = args.state.player.shift_rect(vector) # box is able to move at an angle~
+** Processing line: ~~
+** Processing line: ~ # If the player's box hits a wall, it is not able to move further in that direction~
+** Processing line: ~ return if args.state.walls~
+** Processing line: ~ .any_intersect_rect?(box)~
+** Processing line: ~~
+** Processing line: ~ # Player's box is able to move at angles (not just the four general directions) fast~
+** Processing line: ~ args.state.player =~
+** Processing line: ~ args.state.player~
+** Processing line: ~ .shift_rect(vector.x * args.state.player_speed, # if we don't multiply by speed, then~
+** Processing line: ~ vector.y * args.state.player_speed) # the box will move extremely slow~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- 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.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Crafting - Farming Game Starting Point - tests.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 - tests.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/tests.rb~
+** Processing line: ~ # For advanced users:~
+** Processing line: ~ # You can put some quick verification tests here, any method~
+** Processing line: ~ # that starts with the `test_` will be run when you save this file.~
+** Processing line: ~~
+** Processing line: ~ # Here is an example test and game~
+** Processing line: ~~
+** Processing line: ~ # To run the test: ./dragonruby mygame --eval app/tests.rb --no-tick~
+** Processing line: ~~
+** Processing line: ~ class MySuperHappyFunGame~
+** Processing line: ~ attr_gtk~
+** Processing line: ~~
+** Processing line: ~ def tick~
+** Processing line: ~ outputs.solids << [100, 100, 300, 300]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def test_universe args, assert~
+** Processing line: ~ game = MySuperHappyFunGame.new~
+** Processing line: ~ game.args = args~
+** Processing line: ~ game.tick~
+** Processing line: ~ assert.true! args.outputs.solids.length == 1, "failure: a solid was not added after tick"~
+** Processing line: ~ assert.false! 1 == 2, "failure: some how, 1 equals 2, the world is ending"~
+** Processing line: ~ puts "test_universe completed successfully"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ puts "running tests"~
+** Processing line: ~ $gtk.reset 100~
+** Processing line: ~ $gtk.log_level = :off~
+** Processing line: ~ $gtk.tests.start~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Dev Tools - Add Buttons To Console - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -207074,12 +217997,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ label = { x: b.x + state.buttons_frame_selection.size.half,~
** Processing line: ~ y: b.y,~
** Processing line: ~ text: "#{i + 1}", r: 180, g: 180, b: 180,~
-** Processing line: ~ size_enum: -4, alignment_enum: 1 }.label~
+** Processing line: ~ size_enum: -4, alignment_enum: 1 }.label!~
** Processing line: ~~
-** Processing line: ~ selection_border = b.merge(r: 40, g: 40, b: 40).border~
+** Processing line: ~ selection_border = b.merge(r: 40, g: 40, b: 40).border!~
** Processing line: ~~
** Processing line: ~ if i == state.animation_frames_selected_index~
-** Processing line: ~ selection_border = b.merge(r: 40, g: 230, b: 200).border~
+** Processing line: ~ selection_border = b.merge(r: 40, g: 230, b: 200).border!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ [selection_border, label]~
@@ -207833,6 +218756,558 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** Dungeon Crawl - Classics Jam - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Dungeon Crawl - Classics Jam - 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: ~Dungeon Crawl - Classics Jam - 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_dungeon_crawl/classics_jam/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: ~ player.x ||= 640~
+** Processing line: ~ player.y ||= 360~
+** Processing line: ~ player.w ||= 16~
+** Processing line: ~ player.h ||= 16~
+** Processing line: ~ player.attacked_at ||= -1~
+** Processing line: ~ player.angle ||= 0~
+** Processing line: ~ player.future_player ||= future_player_position 0, 0~
+** Processing line: ~ player.projectiles ||= []~
+** Processing line: ~ player.damage ||= 0~
+** Processing line: ~ state.level ||= create_level level_one_template~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def render~
+** Processing line: ~ outputs.sprites << level.walls.map do |w|~
+** Processing line: ~ w.merge(path: 'sprites/square/gray.png')~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ outputs.sprites << level.spawn_locations.map do |s|~
+** Processing line: ~ s.merge(path: 'sprites/square/blue.png')~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ outputs.sprites << player.projectiles.map do |p|~
+** Processing line: ~ p.merge(path: 'sprites/square/blue.png')~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ outputs.sprites << level.enemies.map do |e|~
+** Processing line: ~ e.merge(path: 'sprites/square/red.png')~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ outputs.sprites << player.merge(path: 'sprites/circle/green.png', angle: player.angle)~
+** Processing line: ~~
+** Processing line: ~ outputs.labels << { x: 30, y: 30.from_top, text: "damage: #{player.damage || 0}" }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def input~
+** Processing line: ~ player.angle = inputs.directional_angle || player.angle~
+** Processing line: ~ if inputs.controller_one.key_down.a || inputs.keyboard.key_down.space~
+** Processing line: ~ player.attacked_at = state.tick_count~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc~
+** Processing line: ~ calc_player~
+** Processing line: ~ calc_projectiles~
+** Processing line: ~ calc_enemies~
+** Processing line: ~ calc_spawn_locations~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_player~
+** Processing line: ~ if player.attacked_at == state.tick_count~
+** Processing line: ~ player.projectiles << { at: state.tick_count,~
+** Processing line: ~ x: player.x,~
+** Processing line: ~ y: player.y,~
+** Processing line: ~ angle: player.angle,~
+** Processing line: ~ w: 4,~
+** Processing line: ~ h: 4 }.center_inside_rect(player)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if player.attacked_at.elapsed_time > 5~
+** Processing line: ~ future_player = future_player_position inputs.left_right * 2, inputs.up_down * 2~
+** Processing line: ~ future_player_collision = future_collision player, future_player, level.walls~
+** Processing line: ~ player.x = future_player_collision.x if !future_player_collision.dx_collision~
+** Processing line: ~ player.y = future_player_collision.y if !future_player_collision.dy_collision~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_projectile_collisions entities~
+** Processing line: ~ entities.each do |e|~
+** Processing line: ~ e.damage ||= 0~
+** Processing line: ~ player.projectiles.each do |p|~
+** Processing line: ~ if !p.collided && (p.intersect_rect? e)~
+** Processing line: ~ p.collided = true~
+** Processing line: ~ e.damage += 1~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_projectiles~
+** Processing line: ~ player.projectiles.map! do |p|~
+** Processing line: ~ dx, dy = p.angle.vector 10~
+** Processing line: ~ p.merge(x: p.x + dx, y: p.y + dy)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ calc_projectile_collisions level.walls + level.enemies + level.spawn_locations~
+** Processing line: ~ player.projectiles.reject! { |p| p.at.elapsed_time > 10000 }~
+** Processing line: ~ player.projectiles.reject! { |p| p.collided }~
+** Processing line: ~ level.enemies.reject! { |e| e.damage > e.hp }~
+** Processing line: ~ level.spawn_locations.reject! { |s| s.damage > s.hp }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_enemies~
+** Processing line: ~ level.enemies.map! do |e|~
+** Processing line: ~ dx = 0~
+** Processing line: ~ dx = 1 if e.x < player.x~
+** Processing line: ~ dx = -1 if e.x > player.x~
+** Processing line: ~ dy = 0~
+** Processing line: ~ dy = 1 if e.y < player.y~
+** Processing line: ~ dy = -1 if e.y > player.y~
+** Processing line: ~ future_e = future_entity_position dx, dy, e~
+** Processing line: ~ future_e_collision = future_collision e, future_e, level.enemies + level.walls~
+** Processing line: ~ e.next_x = e.x~
+** Processing line: ~ e.next_y = e.y~
+** Processing line: ~ e.next_x = future_e_collision.x if !future_e_collision.dx_collision~
+** Processing line: ~ e.next_y = future_e_collision.y if !future_e_collision.dy_collision~
+** Processing line: ~ e~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ level.enemies.map! do |e|~
+** Processing line: ~ e.x = e.next_x~
+** Processing line: ~ e.y = e.next_y~
+** Processing line: ~ e~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ level.enemies.each do |e|~
+** Processing line: ~ player.damage += 1 if e.intersect_rect? player~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_spawn_locations~
+** Processing line: ~ level.spawn_locations.map! do |s|~
+** Processing line: ~ s.merge(countdown: s.countdown - 1)~
+** Processing line: ~ end~
+** Processing line: ~ level.spawn_locations~
+** Processing line: ~ .find_all { |s| s.countdown.neg? }~
+** Processing line: ~ .each do |s|~
+** Processing line: ~ s.countdown = s.rate~
+** Processing line: ~ s.merge(countdown: s.rate)~
+** Processing line: ~ new_enemy = create_enemy s~
+** Processing line: ~ if !(level.enemies.find { |e| e.intersect_rect? new_enemy })~
+** Processing line: ~ level.enemies << new_enemy~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def create_enemy spawn_location~
+** Processing line: ~ to_cell(spawn_location.ordinal_x, spawn_location.ordinal_y).merge hp: 2~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def create_level level_template~
+** Processing line: ~ {~
+** Processing line: ~ walls: level_template.walls.map { |w| to_cell(w.ordinal_x, w.ordinal_y).merge(w) },~
+** Processing line: ~ enemies: [],~
+** Processing line: ~ spawn_locations: level_template.spawn_locations.map { |s| to_cell(s.ordinal_x, s.ordinal_y).merge(s) }~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def level_one_template~
+** Processing line: ~ {~
+** Processing line: ~ walls: [{ ordinal_x: 25, ordinal_y: 20},~
+** Processing line: ~ { ordinal_x: 25, ordinal_y: 21},~
+** Processing line: ~ { ordinal_x: 25, ordinal_y: 22},~
+** Processing line: ~ { ordinal_x: 25, ordinal_y: 23}],~
+** Processing line: ~ spawn_locations: [{ ordinal_x: 10, ordinal_y: 10, rate: 120, countdown: 0, hp: 5 }]~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def player~
+** Processing line: ~ state.player ||= {}~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def level~
+** Processing line: ~ state.level ||= {}~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def future_collision entity, future_entity, others~
+** Processing line: ~ dx_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dx) }~
+** Processing line: ~ dy_collision = others.find { |o| o != entity && (o.intersect_rect? future_entity.dy) }~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ dx_collision: dx_collision,~
+** Processing line: ~ x: future_entity.dx.x,~
+** Processing line: ~ dy_collision: dy_collision,~
+** Processing line: ~ y: future_entity.dy.y~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def future_entity_position dx, dy, entity~
+** Processing line: ~ {~
+** Processing line: ~ dx: entity.merge(x: entity.x + dx),~
+** Processing line: ~ dy: entity.merge(y: entity.y + dy),~
+** Processing line: ~ both: entity.merge(x: entity.x + dx, y: entity.y + dy)~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def future_player_position dx, dy~
+** Processing line: ~ future_entity_position dx, dy, player~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_cell ordinal_x, ordinal_y~
+** Processing line: ~ { x: ordinal_x * 16, y: ordinal_y * 16, w: 16, h: 16 }~
+** 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: ~ $game = nil~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~*** Fighting - Special Move Inputs - main.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~Fighting - Special Move Inputs - 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: ~Fighting - Special Move Inputs - 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_fighting/01_special_move_inputs/app/main.rb~
+** Processing line: ~ def tick args~
+** Processing line: ~ #tick_instructions args, "Use LEFT and RIGHT arrow keys to move and SPACE to jump."~
+** Processing line: ~ defaults args~
+** Processing line: ~ render args~
+** Processing line: ~ input args~
+** Processing line: ~ calc args~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # sets default values and creates empty collections~
+** Processing line: ~ # initialization only happens in the first frame~
+** Processing line: ~ def defaults args~
+** Processing line: ~ fiddle args~
+** Processing line: ~~
+** Processing line: ~ args.state.tick_count = args.state.tick_count~
+** Processing line: ~ args.state.bridge_top = 128~
+** Processing line: ~ args.state.player.x ||= 0 # initializes player's properties~
+** Processing line: ~ args.state.player.y ||= args.state.bridge_top~
+** Processing line: ~ args.state.player.w ||= 64~
+** Processing line: ~ args.state.player.h ||= 64~
+** Processing line: ~ args.state.player.dy ||= 0~
+** Processing line: ~ args.state.player.dx ||= 0~
+** Processing line: ~ args.state.player.r ||= 0~
+** Processing line: ~ args.state.game_over_at ||= 0~
+** Processing line: ~ args.state.animation_time ||=0~
+** Processing line: ~~
+** Processing line: ~ args.state.timeleft ||=0~
+** Processing line: ~ args.state.timeright ||=0~
+** Processing line: ~ args.state.lastpush ||=0~
+** Processing line: ~~
+** Processing line: ~ args.state.inputlist ||= ["j","k","l"]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # sets enemy, player, hammer values~
+** Processing line: ~ def fiddle args~
+** Processing line: ~ args.state.gravity = -0.5~
+** Processing line: ~ args.state.player_jump_power = 10 # sets player values~
+** Processing line: ~ args.state.player_jump_power_duration = 5~
+** Processing line: ~ args.state.player_max_run_speed = 20~
+** Processing line: ~ args.state.player_speed_slowdown_rate = 0.9~
+** Processing line: ~ args.state.player_acceleration = 0.9~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # outputs objects onto the screen~
+** Processing line: ~ def render args~
+** Processing line: ~ if (args.state.player.dx < 0.01) && (args.state.player.dx > -0.01)~
+** Processing line: ~ args.state.player.dx = 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ #move list~
+** Processing line: ~ (args.layout.rect_group row: 0, col_from_right: 8, drow: 0.3,~
+** Processing line: ~ merge: { vertical_alignment_enum: 0, size_enum: -2 },~
+** Processing line: ~ group: [~
+** Processing line: ~ { text: "move: WASD" },~
+** Processing line: ~ { text: "jump: Space" },~
+** Processing line: ~ { text: "attack forwards: J (while on ground" },~
+** Processing line: ~ { text: "attack upwards: K (while on groud)" },~
+** Processing line: ~ { text: "attack backwards: J (while on ground and holding A)" },~
+** Processing line: ~ { text: "attack downwards: K (while in air)" },~
+** Processing line: ~ { text: "dash attack: J, K in quick succession." },~
+** Processing line: ~ { text: "shield: hold J, K at the same time." },~
+** Processing line: ~ { text: "dash backwards: A, A in quick succession." },~
+** Processing line: ~ ]).into args.outputs.labels~
+** Processing line: ~~
+** Processing line: ~ # registered moves~
+** Processing line: ~ args.outputs.labels << { x: 0.to_layout_col,~
+** Processing line: ~ y: 0.to_layout_row,~
+** Processing line: ~ text: "input history",~
+** Processing line: ~ size_enum: -2,~
+** Processing line: ~ vertical_alignment_enum: 0 }~
+** Processing line: ~~
+** Processing line: ~ (args.state.inputlist.take(5)).map do |s|~
+** Processing line: ~ { text: s, size_enum: -2, vertical_alignment_enum: 0 }~
+** Processing line: ~ end.yield_self do |group|~
+** Processing line: ~ (args.layout.rect_group row: 0.3, col: 0, drow: 0.3, group: group).into args.outputs.labels~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~~
+** Processing line: ~ #sprites~
+** Processing line: ~ player = [args.state.player.x, args.state.player.y,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/square/white.png",~
+** Processing line: ~ args.state.player.r]~
+** Processing line: ~~
+** Processing line: ~ playershield = [args.state.player.x - 20, args.state.player.y - 10,~
+** Processing line: ~ args.state.player.w + 20, args.state.player.h + 20,~
+** Processing line: ~ "sprites/square/blue.png",~
+** Processing line: ~ args.state.player.r,~
+** Processing line: ~ 0]~
+** Processing line: ~~
+** Processing line: ~ playerjab = [args.state.player.x + 32, args.state.player.y,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/indigo.png",~
+** Processing line: ~ args.state.player.r,~
+** Processing line: ~ 0]~
+** Processing line: ~~
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y + 32,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/indigo.png",~
+** Processing line: ~ args.state.player.r+90,~
+** Processing line: ~ 0]~
+** Processing line: ~~
+** Processing line: ~ if ((args.state.tick_count - args.state.lastpush) <= 15)~
+** Processing line: ~ if (args.state.inputlist[0] == "<<")~
+** Processing line: ~ player = [args.state.player.x, args.state.player.y,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/square/yellow.png", args.state.player.r]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (args.state.inputlist[0] == "shield")~
+** Processing line: ~ player = [args.state.player.x, args.state.player.y,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/square/indigo.png", args.state.player.r]~
+** Processing line: ~~
+** Processing line: ~ playershield = [args.state.player.x - 10, args.state.player.y - 10,~
+** Processing line: ~ args.state.player.w + 20, args.state.player.h + 20,~
+** Processing line: ~ "sprites/square/blue.png", args.state.player.r, 50]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (args.state.inputlist[0] == "back-attack")~
+** Processing line: ~ playerjab = [args.state.player.x - 20, args.state.player.y,~
+** Processing line: ~ args.state.player.w - 10, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r, 255]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (args.state.inputlist[0] == "forward-attack")~
+** Processing line: ~ playerjab = [args.state.player.x + 32, args.state.player.y,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r, 255]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (args.state.inputlist[0] == "up-attack")~
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y + 32,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (args.state.inputlist[0] == "dair")~
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y - 32,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/indigo.png", args.state.player.r + 90, 255]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if (args.state.inputlist[0] == "dash-attack")~
+** Processing line: ~ playerupper = [args.state.player.x, args.state.player.y + 32,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/violet.png", args.state.player.r + 90, 255]~
+** Processing line: ~~
+** Processing line: ~ playerjab = [args.state.player.x + 32, args.state.player.y,~
+** Processing line: ~ args.state.player.w, args.state.player.h,~
+** Processing line: ~ "sprites/isometric/violet.png", args.state.player.r, 255]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.sprites << playerjab~
+** Processing line: ~ args.outputs.sprites << playerupper~
+** Processing line: ~ args.outputs.sprites << player~
+** Processing line: ~ args.outputs.sprites << playershield~
+** Processing line: ~~
+** Processing line: ~ args.outputs.solids << 20.map_with_index do |i| # uses 20 squares to form bridge~
+** Processing line: ~ [i * 64, args.state.bridge_top - 64, 64, 64]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Performs calculations to move objects on the screen~
+** Processing line: ~ def calc args~
+** Processing line: ~ # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.~
+** Processing line: ~ args.state.player.x += args.state.player.dx~
+** Processing line: ~ args.state.player.y += args.state.player.dy~
+** Processing line: ~~
+** Processing line: ~ # Since acceleration is the change in velocity, the change in y (dy) increases every frame~
+** Processing line: ~ args.state.player.dy += args.state.gravity~
+** Processing line: ~~
+** Processing line: ~ # player's y position is either current y position or y position of top of~
+** Processing line: ~ # bridge, whichever has a greater value~
+** Processing line: ~ # ensures that the player never goes below the bridge~
+** Processing line: ~ args.state.player.y = args.state.player.y.greater(args.state.bridge_top)~
+** Processing line: ~~
+** Processing line: ~ # player's x position is either the current x position or 0, whichever has a greater value~
+** Processing line: ~ # ensures that the player doesn't go too far left (out of the screen's scope)~
+** Processing line: ~ args.state.player.x = args.state.player.x.greater(0)~
+** Processing line: ~~
+** Processing line: ~ # player is not falling if it is located on the top of the bridge~
+** Processing line: ~ args.state.player.falling = false if args.state.player.y == args.state.bridge_top~
+** Processing line: ~ #args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Resets the player by changing its properties back to the values they had at initialization~
+** Processing line: ~ def reset_player args~
+** Processing line: ~ args.state.player.x = 0~
+** Processing line: ~ args.state.player.y = args.state.bridge_top~
+** Processing line: ~ args.state.player.dy = 0~
+** Processing line: ~ args.state.player.dx = 0~
+** Processing line: ~ args.state.enemy.hammers.clear # empties hammer collection~
+** Processing line: ~ args.state.enemy.hammer_queue.clear # empties hammer_queue~
+** Processing line: ~ args.state.game_over_at = args.state.tick_count # game_over_at set to current frame (or passage of time)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # Processes input from the user to move the player~
+** Processing line: ~ def input args~
+** Processing line: ~ if args.state.inputlist.length > 5~
+** Processing line: ~ args.state.inputlist.pop~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ should_process_special_move = (args.inputs.keyboard.key_down.j) ||~
+** Processing line: ~ (args.inputs.keyboard.key_down.k) ||~
+** Processing line: ~ (args.inputs.keyboard.key_down.a) ||~
+** Processing line: ~ (args.inputs.keyboard.key_down.d) ||~
+** Processing line: ~ (args.inputs.controller_one.key_down.y) ||~
+** Processing line: ~ (args.inputs.controller_one.key_down.x) ||~
+** Processing line: ~ (args.inputs.controller_one.key_down.left) ||~
+** Processing line: ~ (args.inputs.controller_one.key_down.right)~
+** Processing line: ~~
+** Processing line: ~ if (should_process_special_move)~
+** Processing line: ~ if (args.inputs.keyboard.key_down.j && args.inputs.keyboard.key_down.k) ||~
+** Processing line: ~ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.y)~
+** Processing line: ~ args.state.inputlist.unshift("shield")~
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&~
+** Processing line: ~ (args.state.inputlist[0] == "forward-attack") && ((args.state.tick_count - args.state.lastpush) <= 15)~
+** Processing line: ~ args.state.inputlist.unshift("dash-attack")~
+** Processing line: ~ args.state.player.dx = 20~
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.j && args.inputs.keyboard.a) ||~
+** Processing line: ~ (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.left)~
+** Processing line: ~ args.state.inputlist.unshift("back-attack")~
+** Processing line: ~ elsif ( args.inputs.controller_one.key_down.x || args.inputs.keyboard.key_down.j)~
+** Processing line: ~ args.state.inputlist.unshift("forward-attack")~
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) &&~
+** Processing line: ~ (args.state.player.y > 128)~
+** Processing line: ~ args.state.inputlist.unshift("dair")~
+** Processing line: ~ elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y)~
+** Processing line: ~ args.state.inputlist.unshift("up-attack")~
+** Processing line: ~ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a) &&~
+** Processing line: ~ (args.state.inputlist[0] == "<") &&~
+** Processing line: ~ ((args.state.tick_count - args.state.lastpush) <= 10)~
+** Processing line: ~ args.state.inputlist.unshift("<<")~
+** Processing line: ~ args.state.player.dx = -15~
+** Processing line: ~ elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a)~
+** Processing line: ~ args.state.inputlist.unshift("<")~
+** Processing line: ~ args.state.timeleft = args.state.tick_count~
+** Processing line: ~ elsif (args.inputs.controller_one.key_down.right || args.inputs.keyboard.key_down.d)~
+** Processing line: ~ args.state.inputlist.unshift(">")~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.state.lastpush = args.state.tick_count~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.keyboard.space || args.inputs.controller_one.r2 # if the user presses the space bar~
+** Processing line: ~ args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame~
+** Processing line: ~~
+** Processing line: ~ # if the time that has passed since the jump is less than the player's jump duration and~
+** Processing line: ~ # the player is not falling~
+** Processing line: ~ if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling~
+** Processing line: ~ args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ # if the space bar is in the "up" state (or not being pressed down)~
+** Processing line: ~ if args.inputs.keyboard.key_up.space || args.inputs.controller_one.key_up.r2~
+** Processing line: ~ args.state.player.jumped_at = nil # jumped_at is empty~
+** Processing line: ~ args.state.player.falling = true # the player is falling~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if args.inputs.left # if left key is pressed~
+** Processing line: ~ if args.state.player.dx < -5~
+** Processing line: ~ args.state.player.dx = args.state.player.dx~
+** Processing line: ~ else~
+** Processing line: ~ args.state.player.dx = -5~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ elsif args.inputs.right # if right key is pressed~
+** Processing line: ~ if args.state.player.dx > 5~
+** Processing line: ~ args.state.player.dx = args.state.player.dx~
+** Processing line: ~ else~
+** Processing line: ~ args.state.player.dx = 5~
+** Processing line: ~ end~
+** Processing line: ~ else~
+** Processing line: ~ args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ if ((args.state.player.dx).abs > 5) #&& ((args.state.tick_count - args.state.lastpush) <= 10)~
+** Processing line: ~ args.state.player.dx *= 0.95~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def tick_instructions args, text, y = 715~
+** Processing line: ~ return if args.state.key_event_occurred~
+** Processing line: ~ if args.inputs.mouse.click ||~
+** Processing line: ~ args.inputs.keyboard.directional_vector ||~
+** Processing line: ~ args.inputs.keyboard.key_down.enter ||~
+** Processing line: ~ args.inputs.keyboard.key_down.space ||~
+** Processing line: ~ args.inputs.keyboard.key_down.escape~
+** Processing line: ~ args.state.key_event_occurred = true~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ args.outputs.debug << [0, y - 50, 1280, 60].solid~
+** Processing line: ~ args.outputs.debug << [640, y, text, 1, 1, 255, 255, 255].label~
+** Processing line: ~ args.outputs.debug << [640, y - 25, "(click to dismiss instructions)" , -2, 1, 255, 255, 255].label~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** Lowrez - Nokia 3310 - main.rb~
- H3 detected.
- Determining if line is a header.
@@ -208456,7 +219931,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ text: text,~
** Processing line: ~ size_enum: -1.5,~
** Processing line: ~ r: 255, g: 255, b: 255~
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ args.outputs.debug << {~
@@ -208466,7 +219941,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ size_enum: -0.5,~
** Processing line: ~ alignment_enum: 1,~
** Processing line: ~ r: 255, g: 255, b: 255~
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def snake_demo args~
@@ -208733,7 +220208,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 240,~
** Processing line: ~ b: 216,~
** Processing line: ~ a: 100~
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ (NOKIA_WIDTH + 1).map_with_index do |i|~
@@ -208746,7 +220221,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 240,~
** Processing line: ~ b: 216,~
** Processing line: ~ a: 100~
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ @args.state.overlay_rendered = true~
@@ -209528,7 +221003,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 128,~
** Processing line: ~ b: 128,~
** Processing line: ~ a: 80~
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
** Processing line: ~~
** Processing line: ~ args.outputs.static_debug << {~
** Processing line: ~ x: LOWREZ_X_OFFSET + (i * 10),~
@@ -209539,7 +221014,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 128,~
** Processing line: ~ b: 128,~
** Processing line: ~ a: 80~
-** Processing line: ~ }.line~
+** Processing line: ~ }.line!~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -209566,7 +221041,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ y: 720 - (i * 20),~
** Processing line: ~ text: text,~
** Processing line: ~ size_enum: -1.5~
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ args.outputs.debug << {~
@@ -209575,7 +221050,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ text: "INFO: dev mode is currently enabled. Comment out the invocation of ~render_debug~ within the ~tick~ method to hide the debug layer.",~
** Processing line: ~ size_enum: -0.5,~
** Processing line: ~ alignment_enum: 1~
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ $gtk.reset~
@@ -218579,58 +230054,21 @@ 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: ~~
-** Processing line: ~ # Contains information related to input devices and input events.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Inputs]~
** Processing line: ~ attr_accessor :inputs~
-** Processing line: ~~
-** Processing line: ~ # Contains the means to interact with output devices such as the screen.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Outputs]~
** Processing line: ~ attr_accessor :outputs~
-** Processing line: ~~
-** Processing line: ~ # Contains the means to interact with the audio mixer.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Hash]~
** Processing line: ~ attr_accessor :audio~
-** Processing line: ~~
-** Processing line: ~ # Contains display size information to assist in positioning things on the screen.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Grid]~
** Processing line: ~ attr_accessor :grid~
-** Processing line: ~~
-** Processing line: ~ # Provides access to game play recording facilities within Game Toolkit.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Recording]~
** Processing line: ~ attr_accessor :recording~
-** Processing line: ~~
-** Processing line: ~ # Gives you access to geometry related functions.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Geometry]~
** Processing line: ~ attr_accessor :geometry~
-** Processing line: ~~
** Processing line: ~ attr_accessor :fn~
-** Processing line: ~~
-** Processing line: ~ # This is where you'll put state associated with your video game.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [OpenEntity]~
** Processing line: ~ attr_accessor :state~
-** Processing line: ~~
-** Processing line: ~ # Gives you access to the top level DragonRuby runtime.~
-** Processing line: ~ #~
-** Processing line: ~ # @return [Runtime]~
+** Processing line: ~ attr_accessor :temp_state~
** Processing line: ~ attr_accessor :runtime~
** Processing line: ~ alias_method :gtk, :runtime~
-** Processing line: ~~
** Processing line: ~ attr_accessor :passes~
-** Processing line: ~~
** Processing line: ~ attr_accessor :wizards~
-** Processing line: ~~
** Processing line: ~ attr_accessor :layout~
-** Processing line: ~~
** Processing line: ~ attr_accessor :easing~
-** Processing line: ~~
** Processing line: ~ attr_accessor :string~
** Processing line: ~~
** Processing line: ~ def initialize runtime, recording~
@@ -218639,6 +230077,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @audio = {}~
** Processing line: ~ @passes = []~
** Processing line: ~ @state = OpenEntity.new~
+** Processing line: ~ @temp_state = OpenEntity.new~
** Processing line: ~ @state.tick_count = -1~
** Processing line: ~ @runtime = runtime~
** Processing line: ~ @recording = recording~
@@ -218668,11 +230107,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def serialize~
** Processing line: ~ {~
-** Processing line: ~ state: state.as_hash,~
-** Processing line: ~ inputs: inputs.serialize,~
-** Processing line: ~ passes: passes.serialize,~
-** Processing line: ~ outputs: outputs.serialize,~
-** Processing line: ~ grid: grid.serialize~
+** Processing line: ~ state: state.as_hash,~
+** Processing line: ~ temp_state: temp_state.as_hash,~
+** Processing line: ~ inputs: inputs.serialize,~
+** Processing line: ~ passes: passes.serialize,~
+** Processing line: ~ outputs: outputs.serialize,~
+** Processing line: ~ grid: grid.serialize~
** Processing line: ~ }~
** Processing line: ~ end~
** Processing line: ~~
@@ -218853,10 +230293,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ class Assert~
** Processing line: ~ def custom_assertion actual, expected, message = nil~
-** Processing line: ~ # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).~
+** Processing line: ~ # this tells Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).~
** Processing line: ~ @assertion_performed = true~
** Processing line: ~~
-** Processing line: ~ # perform your custom logic here and rais an exception to denote a failure.~
+** Processing line: ~ # perform your custom logic here and raise an exception to denote a failure.~
** Processing line: ~~
** Processing line: ~ raise "Some Error. #{message}."~
** Processing line: ~ end~
@@ -218866,14 +230306,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ attr :assertion_performed~
** Processing line: ~~
** Processing line: ~ =begin~
-** Processing line: ~ Us this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).~
+** Processing line: ~ Use this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).~
** Processing line: ~ =end~
** Processing line: ~ def ok!~
** Processing line: ~ @assertion_performed = true~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ =begin~
-** Processing line: ~ Assert if a value is a thruthy value. All assert method take an optional final parameter that is the message to display to the user.~
+** Processing line: ~ Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.~
** Processing line: ~~
** Processing line: ~ @example~
** Processing line: ~~
@@ -218927,7 +230367,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @assertion_performed = true~
** Processing line: ~ if actual != expected~
** Processing line: ~ actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip~
-** Processing line: ~ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}"~
+** Processing line: ~ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}\n#{message}"~
** Processing line: ~ raise message~
** Processing line: ~ end~
** Processing line: ~ nil~
@@ -218937,7 +230377,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @assertion_performed = true~
** Processing line: ~ if actual == expected~
** Processing line: ~ actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip~
-** Processing line: ~ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}"~
+** Processing line: ~ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}\n#{message}"~
** Processing line: ~ raise message~
** Processing line: ~ end~
** Processing line: ~ nil~
@@ -219007,6 +230447,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.state~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def temp_state~
+** Processing line: ~ args.temp_state~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def inputs~
** Processing line: ~ args.inputs~
** Processing line: ~ end~
@@ -219034,6 +230478,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def layout~
** Processing line: ~ args.layout~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def new_entity entity_type, init_hash = nil, &block~
+** Processing line: ~ args.state.new_entity entity_type, init_hash, &block~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def new_entity_strict entity_type, init_hash = nil, &block~
+** Processing line: ~ args.state.new_entity_strict entity_type, init_hash, &block~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
@@ -219095,7 +230547,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :tile_x,~
** Processing line: ~ :tile_y, :tile_w, :tile_h, :flip_horizontally,~
** Processing line: ~ :flip_vertically, :angle_anchor_x, :angle_anchor_y, :id,~
-** Processing line: ~ :source_x, :source_y, :source_w, :source_h~
+** Processing line: ~ :source_x, :source_y, :source_w, :source_h, :blendmode_enum~
** Processing line: ~~
** Processing line: ~ def primitive_marker~
** Processing line: ~ :sprite~
@@ -219155,7 +230607,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ :font_style, :menu~
** Processing line: ~~
** Processing line: ~ def initialize~
-** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1, line_height: 1.1)~
+** Processing line: ~ @font_style = FontStyle.new(font: 'font.ttf', size_enum: -1.5, line_height: 1.1)~
** Processing line: ~ @menu = Menu.new self~
** Processing line: ~ @disabled = false~
** Processing line: ~ @log_offset = 0~
@@ -219175,6 +230627,8 @@ Follows is a source code listing for all files that have been open sourced. This
** 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: ~ @animation_duration = 1.seconds~
** Processing line: ~ @shown_at = -1~
** Processing line: ~ load_history~
@@ -219449,6 +230903,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ if cmd == 'quit' || cmd == ':wq' || cmd == ':q!' || cmd == ':q' || cmd == ':wqa'~
** Processing line: ~ $gtk.request_quit~
+** Processing line: ~ elsif cmd.start_with? ':'~
+** Processing line: ~ send ((cmd.gsub '-', '_').gsub ':', '')~
** Processing line: ~ else~
** Processing line: ~ puts "-> #{cmd}"~
** Processing line: ~ begin~
@@ -219457,13 +230913,19 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ if $results.nil?~
** Processing line: ~ puts "=> nil"~
** Processing line: ~ elsif $results == :console_silent_eval~
+** Processing line: ~ # do nothing since the console is silent~
** Processing line: ~ else~
** Processing line: ~ puts "=> #{$results}"~
** Processing line: ~ end~
** Processing line: ~ @last_command_errored = false~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ try_search_docs e~
-** Processing line: ~ puts "* EXCEPTION: #{e}"~
+** Processing line: ~ # if an exception is thrown and the bactrace includes something helpful, then show it~
+** Processing line: ~ if (e.backtrace || []).first && (e.backtrace.first.include? "(eval)")~
+** Processing line: ~ puts "* EXCEPTION: #{e}"~
+** Processing line: ~ else~
+** Processing line: ~ puts "* EXCEPTION: #{e}\n#{e.__backtrace_to_org__}"~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -219690,6 +231152,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ render_log_offset args~
+** Processing line: ~~
+** Processing line: ~ args.outputs.reserved << { x: 10.from_right, y: @bottom + 10,~
+** Processing line: ~ text: "Press CTRL+g or ESCAPE to clear the prompt.",~
+** Processing line: ~ vertical_alignment_enum: 0,~
+** Processing line: ~ alignment_enum: 2, r: 80, g: 80, b: 80 }.label!~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def render_log_offset args~
@@ -219712,7 +231179,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def include_subdued_markers? text~
-** Processing line: ~ include_any_words? text, subdued_markers~
+** Processing line: ~ (text.start_with? "* INFO: ") && (include_any_words? text, subdued_markers)~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def include_any_words? text, words~
@@ -219858,8 +231325,32 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ (log_entry.start_with? "**** ")~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def code? log_entry~
+** Processing line: ~ (just_symbol? log_entry) || (codeblock_marker? log_entry)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def just_symbol? log_entry~
+** Processing line: ~ scrubbed = log_entry.gsub("*", "").strip~
+** Processing line: ~ (scrubbed.start_with? ":") && (!scrubbed.include? " ") && (!scrubbed.include? "=>")~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def code_comment? log_entry~
+** Processing line: ~ return true if log_entry.strip.start_with?("# ")~
+** Processing line: ~ return false~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def codeblock_marker? log_entry~
+** Processing line: ~ return true if log_entry.strip.start_with?("#+begin_src")~
+** Processing line: ~ return true if log_entry.strip.start_with?("#+end_src")~
+** Processing line: ~ return false~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def color_for_log_entry(log_entry)~
-** Processing line: ~ if include_row_marker? log_entry~
+** Processing line: ~ if code? log_entry~
+** Processing line: ~ @code_color~
+** Processing line: ~ elsif code_comment? log_entry~
+** Processing line: ~ @comment_color~
+** Processing line: ~ elsif include_row_marker? log_entry~
** Processing line: ~ @text_color~
** Processing line: ~ elsif include_error_marker? log_entry~
** Processing line: ~ @error_color~
@@ -219949,6 +231440,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @color~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def to_s~
+** Processing line: ~ "GTK::Console::Color #{to_h}"~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def to_h~
** Processing line: ~ { r: @color[0], g: @color[1], b: @color[2], a: @color[3] }~
** Processing line: ~ end~
@@ -220011,7 +231506,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ size_enum: size_enum,~
** Processing line: ~ alignment_enum: alignment_enum,~
** Processing line: ~ **color.to_h,~
-** Processing line: ~ }.label~
+** Processing line: ~ }.label!~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -220090,7 +231585,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def itch_wizard_clicked~
** Processing line: ~ @console.scroll_to_bottom~
-** Processing line: ~ $wizards.itch.start~
+** Processing line: ~ $wizards.itch.restart~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def docs_clicked~
@@ -220115,6 +231610,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @buttons = [~
** Processing line: ~ (button id: :record, row: 0, col: 9, text: "record gameplay", method: :record_clicked),~
** Processing line: ~ (button id: :replay, row: 0, col: 10, text: "start replay", method: :replay_clicked),~
+** Processing line: ~ *custom_buttons~
** Processing line: ~ ]~
** Processing line: ~ elsif @menu_shown == :hidden~
** Processing line: ~ @buttons = [~
@@ -220173,8 +231669,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ method: method~
** Processing line: ~ }.let do |entity|~
** Processing line: ~ primitives = []~
-** Processing line: ~ primitives << entity[:rect].merge(a: 164).solid~
-** Processing line: ~ primitives << entity[:rect].merge(r: 255, g: 255, b: 255).border~
+** Processing line: ~ primitives << entity[:rect].solid!(a: 164)~
+** Processing line: ~ primitives << entity[:rect].border!(r: 255, g: 255, b: 255)~
** Processing line: ~ primitives << text.wrapped_lines(5)~
** Processing line: ~ .map_with_index do |l, i|~
** Processing line: ~ [~
@@ -220393,17 +231889,17 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ "#{" " * (string_width.length - c.length) } #{c} |"~
** Processing line: ~ end.join~
** Processing line: ~~
-** Processing line: ~ # remove seperators between empty values~
+** Processing line: ~ # remove separators between empty values~
** Processing line: ~ formated_row = formated_row.gsub(" | ", " ")~
** Processing line: ~~
** Processing line: ~ puts formated_row~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def pretty_print_row_seperator string_width, cell_width, column_width, columns~
+** Processing line: ~ def pretty_print_row_separator string_width, cell_width, column_width, columns~
** Processing line: ~ # this is a joint: +--------~
** Processing line: ~ column_joint = "+#{"-" * cell_width}"~
** Processing line: ~~
-** Processing line: ~ # multiple joints create a row seperator: +----+----+~
+** Processing line: ~ # multiple joints create a row separator: +----+----+~
** Processing line: ~ puts (column_joint * columns) + "+"~
** Processing line: ~ end~
** Processing line: ~~
@@ -220412,12 +231908,12 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 0.5,~
** Processing line: ~ y: y + 5,~
** Processing line: ~ x2: x + @cursor_position_px + 0.5,~
-** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~
+** Processing line: ~ y2: y + @font_style.letter_size.y + 4)~
** Processing line: ~~
** Processing line: ~ args.outputs.reserved << (@cursor_color.to_h.merge x: x + @cursor_position_px + 1,~
** Processing line: ~ y: y + 5,~
** Processing line: ~ x2: x + @cursor_position_px + 1,~
-** Processing line: ~ y2: y + @font_style.letter_size.y + 5)~
+** Processing line: ~ y2: y + @font_style.letter_size.y + 4)~
** Processing line: ~~
** Processing line: ~ # debugging rectangle for string~
** Processing line: ~ # args.outputs.reserved << (@cursor_color.to_h.merge x: x,~
@@ -221090,7 +232586,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ :l1, :r1,~
** Processing line: ~ :l2, :r2,~
** Processing line: ~ :l3, :r3,~
-** Processing line: ~ :start, :select,~
+** Processing line: ~ :start, :select, :home,~
** Processing line: ~ :directional_up, :directional_down, :directional_left, :directional_right~
** Processing line: ~ ].freeze~
** Processing line: ~~
@@ -221098,6 +232594,22 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ attr label~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def back~
+** Processing line: ~ @select~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def back= value~
+** Processing line: ~ @select = value~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def guide~
+** Processing line: ~ @home~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def guide= value~
+** Processing line: ~ @home = value~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ # Activate a key.~
** Processing line: ~ #~
** Processing line: ~ # @return [void]~
@@ -221161,7 +232673,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ error_message = <<-S~
** Processing line: ~ * ERROR~
-** Processing line: ~ The GTK::DirectionalKeys module should only be included in objects that respond to the following api heirarchy:~
+** Processing line: ~ The GTK::DirectionalKeys module should only be included in objects that respond to the following api hierarchy:~
** Processing line: ~~
** Processing line: ~ - (#{ directional_methods.join("|") })~
** Processing line: ~ - key_held.(#{ directional_methods.join("|") })~
@@ -221218,6 +232730,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 directional_angle~
+** Processing line: ~ return nil unless directional_vector~
+** Processing line: ~~
+** Processing line: ~ Math.atan2(up_down, left_right).to_degrees~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def method_missing m, *args~
** Processing line: ~ # combine the key with ctrl_~
** Processing line: ~ if m.to_s.start_with?("ctrl_")~
@@ -221495,6 +233013,22 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** 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: ~ px = point.x~
+** Processing line: ~ py = point.y~
+** Processing line: ~ cx = 0~
+** Processing line: ~ cy = 0~
+** Processing line: ~ if around~
+** Processing line: ~ cx = around.x~
+** Processing line: ~ cy = around.y~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ point.merge(x: ((px - cx) * c - (py - cy) * s) + cx,~
+** Processing line: ~ y: ((px - cx) * s + (py - cy) * c) + cy)~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ # Returns f(t) for a cubic Bezier curve.~
** Processing line: ~ def self.cubic_bezier t, a, b, c, d~
** Processing line: ~ s = 1 - t~
@@ -221576,7 +233110,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise e, <<-S~
** Processing line: ~ * ERROR:~
-** Processing line: ~ center_inside_rect for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~
+** Processing line: ~ center_inside_rect for self #{self} and other_rect #{other_rect}.\n#{e}.~
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
@@ -221593,7 +233127,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise e, <<-S~
** Processing line: ~ * ERROR:~
-** Processing line: ~ center_inside_rect_x for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~
+** Processing line: ~ center_inside_rect_x for self #{self} and other_rect #{other_rect}.\n#{e}.~
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
@@ -221610,7 +233144,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise e, <<-S~
** Processing line: ~ * ERROR:~
-** Processing line: ~ center_inside_rect_y for self #{self} and other_rect #{other_rect}. Failed with exception #{e}.~
+** Processing line: ~ center_inside_rect_y for self #{self} and other_rect #{other_rect}.\n#{e}.~
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
@@ -221619,7 +233153,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~ # Returns a primitive that is anchored/repositioned based off its retangle.~
+** Processing line: ~ # Returns a primitive that is anchored/repositioned based off its rectangle.~
** Processing line: ~ # @gtk~
** Processing line: ~ def anchor_rect anchor_x, anchor_y~
** Processing line: ~ current_w = self.w~
@@ -221755,10 +233289,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def self.intersect_rect? rect_one, rect_two, tolerance = 0.1~
-** Processing line: ~ return false if rect_one.right - tolerance < rect_two.left + tolerance~
-** Processing line: ~ return false if rect_one.left + tolerance > rect_two.right - tolerance~
-** Processing line: ~ return false if rect_one.top - tolerance < rect_two.bottom + tolerance~
-** Processing line: ~ return false if rect_one.bottom + tolerance > rect_two.top - tolerance~
+** Processing line: ~ return false if ((rect_one.x + rect_one.w) - tolerance) < (rect_two.x + tolerance)~
+** Processing line: ~ return false if (rect_one.x + tolerance) > ((rect_two.x + rect_two.w) - tolerance)~
+** Processing line: ~ return false if ((rect_one.y + rect_one.h) - tolerance) < (rect_two.y + tolerance)~
+** Processing line: ~ return false if (rect_one.y + tolerance) > ((rect_two.y + rect_two.h) - tolerance)~
** Processing line: ~ return true~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ context_help_rect_one = (rect_one.__help_contract_implementation contract_intersect_rect?)[:not_implemented_methods]~
@@ -221786,6 +233320,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ - rect_one: #{rect_one}~
** Processing line: ~ - rect_two: #{rect_two}~
** Processing line: ~ #{context_help}~
+** Processing line: ~ \n#{e}~
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
@@ -221796,14 +233331,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ y = y.shift_down(size * anchor_y)~
** Processing line: ~ [x, y, size, size]~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}."~
+** Processing line: ~ raise e, ":to_square failed for size: #{size} x: #{x} y: #{y} anchor_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def self.distance point_one, point_two~
** Processing line: ~ Math.sqrt((point_two.x - point_one.x)**2 + (point_two.y - point_one.y)**2)~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}."~
+** Processing line: ~ raise e, ":distance failed for point_one: #{point_one} point_two #{point_two}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
@@ -221812,31 +233347,34 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ d_x = end_point.x - start_point.x~
** Processing line: ~ Math::PI.+(Math.atan2(d_y, d_x)).to_degrees~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}."~
+** Processing line: ~ raise e, ":angle_from failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def self.angle_to start_point, end_point~
** Processing line: ~ angle_from end_point, start_point~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}."~
+** Processing line: ~ raise e, ":angle_to failed for start_point: #{start_point} end_point: #{end_point}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def self.point_inside_circle? point, circle_center_point, radius~
** Processing line: ~ (point.x - circle_center_point.x) ** 2 + (point.y - circle_center_point.y) ** 2 < radius ** 2~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}"~
+** Processing line: ~ raise e, ":point_inside_circle? failed for point: #{point} circle_center_point: #{circle_center_point} radius: #{radius}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def self.inside_rect? inner_rect, outer_rect, tolerance = 0.0~
+** Processing line: ~ return nil if !inner_rect~
+** Processing line: ~ return nil if !outer_rect~
+** Processing line: ~~
** Processing line: ~ inner_rect.x + tolerance >= outer_rect.x - tolerance &&~
-** Processing line: ~ inner_rect.right - tolerance <= outer_rect.right + tolerance &&~
+** Processing line: ~ (inner_rect.x + inner_rect.w) - tolerance <= (outer_rect.x + outer_rect.w) + tolerance &&~
** Processing line: ~ inner_rect.y + tolerance >= outer_rect.y - tolerance &&~
-** Processing line: ~ inner_rect.top - tolerance <= outer_rect.top + tolerance~
+** Processing line: ~ (inner_rect.y + inner_rect.h) - tolerance <= (outer_rect.y + outer_rect.h) + tolerance~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}."~
+** Processing line: ~ raise e, ":inside_rect? failed for inner_rect: #{inner_rect} outer_rect: #{outer_rect}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
@@ -221871,7 +233409,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ return rect~
** Processing line: ~ end~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}."~
+** Processing line: ~ raise e, ":scale_rect_extended failed for rect: #{rect} percentage_x: #{percentage_x} percentage_y: #{percentage_y} anchors_x: #{anchor_x} anchor_y: #{anchor_y}.\n#{e}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # @gtk~
@@ -221885,7 +233423,21 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ anchor_x: anchor_x,~
** Processing line: ~ anchor_y: anchor_y~
** Processing line: ~ rescue Exception => e~
-** Processing line: ~ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)]."~
+** Processing line: ~ raise e, ":scale_rect failed for rect: #{rect} percentage: #{percentage} anchors [#{anchor_x} (x), #{anchor_y} (y)].\n#{e}"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def self.rect_to_line rect~
+** Processing line: ~ l = rect.to_hash.line~
+** Processing line: ~ l.merge(x2: l.x + l.w - 1,~
+** Processing line: ~ y2: l.y + l.h)~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def self.rect_center_point rect~
+** Processing line: ~ { x: rect.x + rect.w.half, y: rect.y + rect.h.half }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def rect_center_point~
+** Processing line: ~ Geometry.rect_center_point self~
** Processing line: ~ end~
** Processing line: ~ end # module Geometry~
** Processing line: ~ end # module GTK~
@@ -222097,6 +233649,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def bottom_right~
** Processing line: ~ [@right, @bottom].point~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def x~
+** Processing line: ~ 0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def y~
+** Processing line: ~ 0~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -222313,6 +233873,30 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ }~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def self.method_to_key_hash~
+** Processing line: ~ return @method_to_key_hash if @method_to_key_hash~
+** Processing line: ~ @method_to_key_hash = {}~
+** Processing line: ~ string_representation_overrides ||= {~
+** Processing line: ~ backspace: '\b'~
+** Processing line: ~ }~
+** Processing line: ~ char_to_method_hash.each do |k, v|~
+** Processing line: ~ v.each do |vi|~
+** Processing line: ~ t = { char_or_raw_key: k }~
+** Processing line: ~~
+** Processing line: ~ if k.is_a? Numeric~
+** Processing line: ~ t[:raw_key] = k~
+** Processing line: ~ t[:string_representation] = "raw_key == #{k}"~
+** Processing line: ~ else~
+** Processing line: ~ t[:char] = k~
+** Processing line: ~ t[:string_representation] = "\"#{k.strip}\""~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ @method_to_key_hash[vi] = t~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ @method_to_key_hash~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def self.char_to_method char, int = nil~
** Processing line: ~ methods = char_to_method_hash[char] || char_to_method_hash[int]~
** Processing line: ~ methods ? methods.dup : [char.to_sym || int]~
@@ -222427,24 +234011,32 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def method_missing m, *args~
-** Processing line: ~ begin~
-** Processing line: ~ define_singleton_method(m) do~
-** Processing line: ~ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~
-** Processing line: ~ clear_key m~
-** Processing line: ~ return r~
-** Processing line: ~ end~
+** Processing line: ~ if KeyboardKeys.method_to_key_hash[m.without_ending_bang]~
+** Processing line: ~ begin~
+** Processing line: ~ define_singleton_method(m) do~
+** Processing line: ~ r = self.instance_variable_get("@#{m.without_ending_bang}".to_sym)~
+** Processing line: ~ clear_key m~
+** Processing line: ~ return r~
+** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ return self.send m~
-** Processing line: ~ rescue Exception => e~
-** Processing line: ~ log_important "#{e}"~
+** Processing line: ~ return self.send m~
+** Processing line: ~ rescue Exception => e~
+** Processing line: ~ log_important "#{e}"~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ did_you_mean = KeyboardKeys.method_to_key_hash.find_all do |k, v|~
+** Processing line: ~ k.to_s[0..1] == m.to_s[0..1]~
+** Processing line: ~ end.map {|k, v| ":#{k} (#{v[:string_representation]})" }~
+** Processing line: ~ did_you_mean_string = ""~
+** Processing line: ~ did_you_mean_string = ". Did you mean #{did_you_mean.join ", "}?"~
+** Processing line: ~~
** Processing line: ~ raise <<-S~
** Processing line: ~ * ERROR:~
-** Processing line: ~ There is no member on the keyboard called #{m}. Here is a to_s representation of what's available:~
-** Processing line: ~~
-** Processing line: ~ #{KeyboardKeys.char_to_method_hash.map { |k, v| "[#{k} => #{v.join(",")}]" }.join(" ")}~
+** Processing line: ~ #{KeyboardKeys.method_to_key_hash.map { |k, v| "** :#{k} #{v.string_representation}" }.join("\n")}~
** Processing line: ~~
+** Processing line: ~ There is no key on the keyboard called :#{m}#{did_you_mean_string}.~
+** Processing line: ~ Full list of available keys =:points_up:=.~
** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
@@ -222828,6 +234420,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ (controller_one && controller_one.directional_vector)~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def directional_angle~
+** Processing line: ~ keyboard.directional_angle || (controller_one && controller_one.directional_angle)~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ # Returns a signal indicating right (`1`), left (`-1`), or neither ('0').~
** Processing line: ~ #~
** Processing line: ~ # @return [Integer]~
@@ -222914,19 +234510,12 @@ 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: ~ # ./dragon/ios_wizard.rb~
+** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński~
** Processing line: ~ # Copyright 2019 DragonRuby LLC~
** Processing line: ~ # MIT License~
** Processing line: ~ # ios_wizard.rb has been released under MIT (*only this file*).~
** Processing line: ~~
-** Processing line: ~ class WizardException < Exception~
-** Processing line: ~ attr_accessor :console_primitives~
-** Processing line: ~~
-** Processing line: ~ def initialize *console_primitives~
-** Processing line: ~ @console_primitives = console_primitives~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ class IOSWizard~
+** Processing line: ~ class IOSWizard < Wizard~
** Processing line: ~ def initialize~
** Processing line: ~ @doctor_executed_at = 0~
** Processing line: ~ end~
@@ -222939,23 +234528,45 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @steps ||= []~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def steps_development_build~
+** Processing line: ~ def prerequisite_steps~
** Processing line: ~ [~
** Processing line: ~ :check_for_xcode,~
** Processing line: ~ :check_for_brew,~
** Processing line: ~ :check_for_certs,~
-** Processing line: ~ :check_for_device,~
-** Processing line: ~ :check_for_dev_profile,~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def app_metadata_retrieval_steps~
+** Processing line: ~ [~
** Processing line: ~ :determine_team_identifier,~
** Processing line: ~ :determine_app_name,~
** Processing line: ~ :determine_app_id,~
-** Processing line: ~ :blow_away_temp,~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def steps_development_build~
+** Processing line: ~ [~
+** Processing line: ~ *prerequisite_steps,~
+** Processing line: ~~
+** Processing line: ~ :check_for_device,~
+** Processing line: ~ :check_for_dev_profile,~
+** Processing line: ~~
+** Processing line: ~ *app_metadata_retrieval_steps,~
+** Processing line: ~~
+** Processing line: ~ :clear_tmp_directory,~
** Processing line: ~ :stage_app,~
+** Processing line: ~~
** Processing line: ~ :development_write_info_plist,~
+** Processing line: ~~
** Processing line: ~ :write_entitlements_plist,~
** Processing line: ~ :compile_icons,~
-** Processing line: ~ :create_payload_directory,~
+** Processing line: ~ :clear_payload_directory,~
+** Processing line: ~~
+** Processing line: ~ :create_payload_directory_dev,~
+** Processing line: ~~
+** Processing line: ~ :create_payload,~
** Processing line: ~ :code_sign_payload,~
+** Processing line: ~~
** Processing line: ~ :create_ipa,~
** Processing line: ~ :deploy~
** Processing line: ~ ]~
@@ -222963,20 +234574,27 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def steps_production_build~
** Processing line: ~ [~
-** Processing line: ~ :check_for_xcode,~
-** Processing line: ~ :check_for_brew,~
-** Processing line: ~ :check_for_certs,~
+** Processing line: ~ *prerequisite_steps,~
+** Processing line: ~~
** Processing line: ~ :check_for_distribution_profile,~
-** Processing line: ~ :determine_team_identifier,~
-** Processing line: ~ :determine_app_name,~
-** Processing line: ~ :determine_app_id,~
-** Processing line: ~ :blow_away_temp,~
+** Processing line: ~ :determine_app_version,~
+** Processing line: ~~
+** Processing line: ~ *app_metadata_retrieval_steps,~
+** Processing line: ~~
+** Processing line: ~ :clear_tmp_directory,~
** Processing line: ~ :stage_app,~
+** Processing line: ~~
** Processing line: ~ :production_write_info_plist,~
+** Processing line: ~~
** Processing line: ~ :write_entitlements_plist,~
** Processing line: ~ :compile_icons,~
-** Processing line: ~ :create_payload_directory,~
+** Processing line: ~ :clear_payload_directory,~
+** Processing line: ~~
+** Processing line: ~ :create_payload_directory_prod,~
+** Processing line: ~~
+** Processing line: ~ :create_payload,~
** Processing line: ~ :code_sign_payload,~
+** Processing line: ~~
** Processing line: ~ :create_ipa,~
** Processing line: ~ :print_publish_help~
** Processing line: ~ ]~
@@ -223012,6 +234630,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @steps = steps_development_build~
** Processing line: ~ @steps = steps_production_build if @production_build~
** Processing line: ~ @certificate_name = nil~
+** Processing line: ~ @app_version = opts[:version]~
+** Processing line: ~ @app_version = "1.0" if @opts[:env] == :dev && !@app_version~
** Processing line: ~ init_wizard_status~
** Processing line: ~ log_info "Starting iOS Wizard so we can deploy to your device."~
** Processing line: ~ @start_at = Kernel.global_tick_count~
@@ -223033,8 +234653,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ log "=" * $console.console_text_width~
** Processing line: ~ else~
** Processing line: ~ log_error e.to_s~
+** Processing line: ~ log e.__backtrace_to_org__~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ init_wizard_status~
** Processing line: ~ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}"~
** Processing line: ~ end~
** Processing line: ~~
@@ -223141,13 +234763,66 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ return "profiles/development.mobileprovision"~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def ios_metadata_template~
+** Processing line: ~ <<-S~
+** 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: ~ S~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def ios_metadata~
+** Processing line: ~ contents = $gtk.read_file 'metadata/ios_metadata.txt'~
+** Processing line: ~~
+** Processing line: ~ if !contents~
+** Processing line: ~ $gtk.write_file 'metadata/ios_metadata.txt', ios_metadata_template~
+** Processing line: ~ contents = $gtk.read_file 'metadata/ios_metadata.txt'~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ kvps = contents.each_line~
+** Processing line: ~ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }~
+** Processing line: ~ .map do |l|~
+** Processing line: ~ key, value = l.split("=")~
+** Processing line: ~ [key.strip.to_sym, value.strip]~
+** Processing line: ~ end.flatten~
+** Processing line: ~ Hash[*kvps]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def game_metadata~
+** Processing line: ~ contents = $gtk.read_file 'metadata/game_metadata.txt'~
+** Processing line: ~~
+** Processing line: ~ kvps = contents.each_line~
+** Processing line: ~ .reject { |l| l.strip.length == 0 || (l.strip.start_with? "#") }~
+** Processing line: ~ .map do |l|~
+** Processing line: ~ key, value = l.split("=")~
+** Processing line: ~ [key.strip.to_sym, value.strip]~
+** Processing line: ~ end.flatten~
+** Processing line: ~ Hash[*kvps]~
+** Processing line: ~ end~
+** Processing line: ~~
+** 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: ~ "Instructions for where the values should come from are within metadata/ios_metadata.txt."~
+** Processing line: ~ )~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def determine_team_identifier~
-** Processing line: ~ @team_name = (team_identifier_from_provisioning_profile @opts[:env])~
-** Processing line: ~ log_info "Team Identifer is: #{@team_name}"~
+** Processing line: ~ @team_id = (ios_metadata.teamid || "")~
+** Processing line: ~ raise_ios_metadata_required if @team_id.strip.length == 0~
+** Processing line: ~ log_info "Team Identifer is: #{@team_id}"~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def determine_app_name~
-** Processing line: ~ @app_name = (provisioning_profile_xml @opts[:env])[:children].first[:children].first[:children][1][:children].first[:data]~
+** Processing line: ~ @app_name = (ios_metadata.appname || "")~
+** Processing line: ~ raise_ios_metadata_required if @app_name.strip.length == 0~
** Processing line: ~ log_info "App name is: #{@app_name}."~
** Processing line: ~ end~
** Processing line: ~~
@@ -223171,36 +234846,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ $gtk.parse_xml scrubbed~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def app_id_from_provisioning_profile environment~
-** Processing line: ~ application_identifier_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]~
-** Processing line: ~ (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|~
-** Processing line: ~ if node[:children] && node[:children][0] && node[:children][0][:data] == "application-identifier"~
-** Processing line: ~ application_identifier_index = i~
-** Processing line: ~ break~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ app_id_with_team_identifier = (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][application_identifier_index + 1][:children].first[:data]~
-** Processing line: ~ team_identifer = team_identifier_from_provisioning_profile environment~
-** Processing line: ~ app_id_with_team_identifier.gsub "#{team_identifer}.", ""~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def team_identifier_from_provisioning_profile environment~
-** Processing line: ~ team_identifer_index = (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children][0][:children][0][:data]~
-** Processing line: ~~
-** Processing line: ~ (provisioning_profile_xml environment)[:children][0][:children][0][:children][13][:children].each.with_index do |node, i|~
-** Processing line: ~ if node[:children] && node[:children][0] && node[:children][0][:data] == "com.apple.developer.team-identifier"~
-** Processing line: ~ team_identifer_index = i~
-** Processing line: ~ break~
-** Processing line: ~ end~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ (provisioning_profile_xml environment)[:children].first[:children].first[:children][13][:children][team_identifer_index + 1][:children].first[:data]~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def determine_app_id~
-** Processing line: ~ @app_id = app_id_from_provisioning_profile @opts[:env]~
-** Processing line: ~~
+** 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: ~ end~
** Processing line: ~~
@@ -223219,7 +234867,7 @@ 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 blow_away_temp~
+** Processing line: ~ def clear_tmp_directory~
** Processing line: ~ sh "rm -rf #{tmp_directory}"~
** Processing line: ~ end~
** Processing line: ~~
@@ -223360,7 +235008,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ log_info "Creating Entitlements.plist"~
** Processing line: ~~
-** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_name}.#{@app_id}").strip~
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.plist", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip~
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Entitlements.txt", entitlement_plist_string.gsub(":app_id", "#{@team_id}.#{@app_id}").strip~
** Processing line: ~~
** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{tmp_directory}/Entitlements.plist\""~
** Processing line: ~ sh "/usr/bin/plutil -convert xml1 \"#{tmp_directory}/Entitlements.plist\""~
@@ -223398,15 +235047,15 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ <key>CFBundleExecutable</key>~
** Processing line: ~ <string>:app_name</string>~
** Processing line: ~ <key>CFBundleInfoDictionaryVersion</key>~
-** Processing line: ~ <string>6.0</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundlePackageType</key>~
** Processing line: ~ <string>APPL</string>~
** Processing line: ~ <key>CFBundleShortVersionString</key>~
-** Processing line: ~ <string>5.6</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundleSignature</key>~
** Processing line: ~ <string>????</string>~
** Processing line: ~ <key>CFBundleVersion</key>~
-** Processing line: ~ <string>5.6</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundleIcons</key>~
** Processing line: ~ <dict>~
** Processing line: ~ <key>CFBundlePrimaryIcon</key>~
@@ -223555,13 +235204,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ <key>CFBundleIdentifier</key>~
** Processing line: ~ <string>:app_id</string>~
** Processing line: ~ <key>CFBundleInfoDictionaryVersion</key>~
-** Processing line: ~ <string>6.0</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundleName</key>~
** Processing line: ~ <string>:app_name</string>~
** Processing line: ~ <key>CFBundlePackageType</key>~
** Processing line: ~ <string>APPL</string>~
** Processing line: ~ <key>CFBundleShortVersionString</key>~
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundleSignature</key>~
** Processing line: ~ <string>????</string>~
** Processing line: ~ <key>CFBundleSupportedPlatforms</key>~
@@ -223569,7 +235218,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ <string>iPhoneOS</string>~
** Processing line: ~ </array>~
** Processing line: ~ <key>CFBundleVersion</key>~
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>DTCompiler</key>~
** Processing line: ~ <string>com.apple.compilers.llvm.clang.1_0</string>~
** Processing line: ~ <key>DTPlatformBuild</key>~
@@ -223655,6 +235304,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ info_plist_string.gsub!(":app_id", @app_id)~
** Processing line: ~~
** Processing line: ~ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip~
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip~
** Processing line: ~~
** Processing line: ~ @info_plist_written = true~
** Processing line: ~ end~
@@ -223708,13 +235358,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ <key>CFBundleIdentifier</key>~
** Processing line: ~ <string>:app_id</string>~
** Processing line: ~ <key>CFBundleInfoDictionaryVersion</key>~
-** Processing line: ~ <string>6.0</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundleName</key>~
** Processing line: ~ <string>:app_name</string>~
** Processing line: ~ <key>CFBundlePackageType</key>~
** Processing line: ~ <string>APPL</string>~
** Processing line: ~ <key>CFBundleShortVersionString</key>~
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>CFBundleSignature</key>~
** Processing line: ~ <string>????</string>~
** Processing line: ~ <key>CFBundleSupportedPlatforms</key>~
@@ -223722,7 +235372,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ <string>iPhoneOS</string>~
** Processing line: ~ </array>~
** Processing line: ~ <key>CFBundleVersion</key>~
-** Processing line: ~ <string>5.2</string>~
+** Processing line: ~ <string>:app_version</string>~
** Processing line: ~ <key>DTCompiler</key>~
** Processing line: ~ <string>com.apple.compilers.llvm.clang.1_0</string>~
** Processing line: ~ <key>DTPlatformBuild</key>~
@@ -223806,8 +235456,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ info_plist_string.gsub!(":app_name", @app_name)~
** Processing line: ~ info_plist_string.gsub!(":app_id", @app_id)~
+** Processing line: ~ info_plist_string.gsub!(":app_version", @app_version)~
** Processing line: ~~
** Processing line: ~ $gtk.write_file_root "tmp/ios/#{@app_name}.app/Info.plist", info_plist_string.strip~
+** Processing line: ~ $gtk.write_file_root "tmp/ios/Info.txt", info_plist_string.strip~
** Processing line: ~~
** Processing line: ~ @info_plist_written = true~
** Processing line: ~ end~
@@ -223829,28 +235481,53 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ "#{relative_path}/#{$gtk.cli_arguments[:dragonruby]}"~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def write_ip_address~
+** Processing line: ~ def embed_mobileprovision~
+** Processing line: ~ sh %Q[cp #{@provisioning_profile_path} "#{app_path}/embedded.mobileprovision"]~
+** Processing line: ~ sh %Q[/usr/bin/plutil -convert binary1 "#{app_path}/Info.plist"]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def clear_payload_directory~
+** Processing line: ~ sh %Q[rm "#{@app_name}".ipa]~
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/app"]~
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/sounds"]~
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/sprites"]~
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/data"]~
+** Processing line: ~ sh %Q[rm -rf "#{app_path}/fonts"]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def stage_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/"]~
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/data/" "#{app_path}/data/"]~
+** Processing line: ~ sh %Q[cp -r "#{root_folder}/fonts/" "#{app_path}/fonts/"]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def create_payload~
+** Processing line: ~ sh %Q[mkdir -p #{tmp_directory}/ipa_root/Payload]~
+** Processing line: ~ sh %Q[cp -r "#{app_path}" "#{tmp_directory}/ipa_root/Payload"]~
+** Processing line: ~ sh %Q[chmod -R 755 "#{tmp_directory}/ipa_root/Payload"]~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def create_payload_directory_dev~
+** Processing line: ~ # write dev machine's ip address for hotloading~
** Processing line: ~ $gtk.write_file "app/server_ip_address.txt", $gtk.ffi_misc.get_local_ip_address.strip~
+** Processing line: ~~
+** Processing line: ~ embed_mobileprovision~
+** Processing line: ~ clear_payload_directory~
+** Processing line: ~ stage_app~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def create_payload_directory~
-** Processing line: ~ sh "cp #{@provisioning_profile_path} \"#{app_path}/embedded.mobileprovision\""~
-** Processing line: ~ sh "/usr/bin/plutil -convert binary1 \"#{app_path}/Info.plist\""~
-** Processing line: ~ write_ip_address~
-** Processing line: ~ sh "rm \"#{@app_name}\".ipa"~
-** Processing line: ~ sh "rm -rf \"#{app_path}/app\""~
-** Processing line: ~ sh "rm -rf \"#{app_path}/sounds\""~
-** Processing line: ~ sh "rm -rf \"#{app_path}/sprites\""~
-** Processing line: ~ sh "rm -rf \"#{app_path}/data\""~
-** Processing line: ~ sh "rm -rf \"#{app_path}/fonts\""~
-** Processing line: ~ sh "cp -r \"#{root_folder}/app/\" \"#{app_path}/app/\""~
-** Processing line: ~ sh "cp -r \"#{root_folder}/sounds/\" \"#{app_path}/sounds/\""~
-** Processing line: ~ sh "cp -r \"#{root_folder}/sprites/\" \"#{app_path}/sprites/\""~
-** Processing line: ~ sh "cp -r \"#{root_folder}/data/\" \"#{app_path}/data/\""~
-** Processing line: ~ sh "cp -r \"#{root_folder}/fonts/\" \"#{app_path}/fonts/\""~
-** Processing line: ~ sh "mkdir -p #{tmp_directory}/ipa_root/Payload"~
-** Processing line: ~ sh "cp -r \"#{app_path}\" \"#{tmp_directory}/ipa_root/Payload\""~
-** Processing line: ~ sh "chmod -R 755 \"#{tmp_directory}/ipa_root/Payload\""~
+** Processing line: ~ def create_payload_directory_prod~
+** Processing line: ~ # production builds does not hotload ip address~
+** Processing line: ~ sh %Q[rm "#{root_folder}/app/server_ip_address.txt"]~
+** Processing line: ~~
+** Processing line: ~ embed_mobileprovision~
+** Processing line: ~ stage_app~
+** Processing line: ~~
+** Processing line: ~ # production build marker~
+** Processing line: ~ sh %Q[mkdir -p "#{app_path}/metadata/"]~
+** Processing line: ~ sh %Q[touch metadata/DRAGONRUBY_PRODUCTION_BUILD]~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def create_ipa~
@@ -223883,10 +235560,22 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def print_publish_help~
-** Processing line: ~ log_info "Go to https://appstoreconnect.apple.com/apps and create an App if you haven't already done so."~
-** Processing line: ~ log_info "Go to https://appleid.apple.com and create a 'Application Specific Password'."~
-** Processing line: ~ log_info "To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."~
-** Processing line: ~ log_info "Your app is located at ./tmp/ios/#{@app_name}.ipa"~
+** Processing line: ~ has_transporter = (sh "ls /Applications/Transporter.app").include? "Contents"~
+** Processing line: ~ if !has_transporter~
+** Processing line: ~ $gtk.openurl "https://apps.apple.com/us/app/transporter/id1450874784?mt=12"~
+** Processing line: ~ $console.set_command "$wizards.ios.start env: :#{@opts[:env]}, version: \"#{@opts[:version]}\""~
+** Processing line: ~ raise WizardException.new(~
+** Processing line: ~ "* To upload your app, Download Transporter from the App Store https://apps.apple.com/us/app/transporter/id1450874784?mt=12."~
+** Processing line: ~ )~
+** Processing line: ~ else~
+** Processing line: ~ sh "mkdir ./tmp/ios/intermediary_artifacts"~
+** Processing line: ~ sh "mv \"#{tmp_directory}/#{@app_name}.app\" #{tmp_directory}/intermediary_artifacts/"~
+** Processing line: ~ sh "mv \"#{tmp_directory}/do_zip.sh\" #{tmp_directory}/intermediary_artifacts"~
+** Processing line: ~ sh "mv \"#{tmp_directory}/Entitlements.plist\" #{tmp_directory}/intermediary_artifacts"~
+** Processing line: ~ sh "mv \"#{tmp_directory}/ipa_root\" #{tmp_directory}/intermediary_artifacts/"~
+** Processing line: ~ sh "open /Applications/Transporter.app"~
+** Processing line: ~ sh "open ./tmp/ios/"~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def compile_icons~
@@ -223907,6 +235596,26 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ sh "cp -r \"#{root_folder}/native/\" \"#{app_path}/native/\""~
** Processing line: ~ sh "CODESIGN_ALLOCATE=\"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate\" /usr/bin/codesign -f -s \"#{@certificate_name}\" --entitlements #{tmp_directory}/Entitlements.plist \"#{tmp_directory}/#{@app_name}.app/native/ios-device/ext.dylib\""~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def set_version version~
+** Processing line: ~ @app_version = version~
+** Processing line: ~ start env: @opts[:env], version: version~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def app_version~
+** Processing line: ~ log_info "Attempting to retrieve App Version from metadata/ios_metadata.txt."~
+** Processing line: ~ ios_version_number = (ios_metadata.version || "").strip~
+** Processing line: ~ if ios_version_number.length == 0~
+** Processing line: ~ log_info "Not found. Attempting to retrieve App Version from metadata/game_metadata.txt."~
+** Processing line: ~ ios_version_number = (game_metadata.version || "").strip~
+** Processing line: ~ end~
+** Processing line: ~ ios_version_number~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def determine_app_version~
+** Processing line: ~ @app_version = app_version~
+** Processing line: ~ return if @app_version~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
@@ -223933,38 +235642,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # MIT License~
** Processing line: ~ # itch_wizard.rb has been released under MIT (*only this file*).~
** Processing line: ~~
-** Processing line: ~ class ItchWizard~
+** Processing line: ~ class ItchWizard < Wizard~
** Processing line: ~ def steps~
** Processing line: ~ [~
** Processing line: ~ :check_metadata,~
-** Processing line: ~ :deploy~
+** Processing line: ~ :deploy,~
** Processing line: ~ ]~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def metadata_file_path~
-** Processing line: ~ "metadata/game_metadata.txt"~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ def get_metadata~
-** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
-** Processing line: ~~
-** Processing line: ~ if !metadata~
-** Processing line: ~ write_blank_metadata~
-** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~
-** Processing line: ~~
-** Processing line: ~ {~
-** Processing line: ~ dev_id: dev_id.strip,~
-** Processing line: ~ dev_title: dev_title.strip,~
-** Processing line: ~ game_id: game_id.strip,~
-** Processing line: ~ game_title: game_title.strip,~
-** Processing line: ~ version: version.strip,~
-** Processing line: ~ icon: icon.strip~
-** Processing line: ~ }~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ def write_blank_metadata~
** Processing line: ~ $gtk.write_file metadata_file_path, <<-S.strip~
** Processing line: ~ #devid=myname~
@@ -223982,7 +235667,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ write_blank_metadata~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ if metadata_text.each_line.to_a.length != 6~
+** Processing line: ~ if metadata_text.strip.each_line.to_a.length < 6~
** Processing line: ~ write_blank_metadata~
** Processing line: ~ end~
** Processing line: ~~
@@ -223994,70 +235679,67 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ if metadata[:dev_id].start_with?("#") || !@dev_id~
** Processing line: ~ log "* PROMPT: Please provide your username for Itch."~
-** Processing line: ~ $console.set_command "$wizards.itch.set_dev_id \"your-itch-username\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_dev_id \"#{metadata[:dev_id]}\""~
** Processing line: ~ return :need_dev_id~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if metadata[:dev_title].start_with?("#") || !@dev_title~
** Processing line: ~ log "* PROMPT: Please provide developer's/company's name that you want displayed."~
-** Processing line: ~ $console.set_command "$wizards.itch.set_dev_title \"Your Name\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_dev_title \"#{metadata[:dev_title]}\""~
** Processing line: ~ return :need_dev_title~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if metadata[:game_id].start_with?("#") || !@game_id~
** Processing line: ~ log "* PROMPT: Please provide the id for you game. This is the id you specified when you set up a new game page on Itch."~
-** Processing line: ~ $console.set_command "$wizards.itch.set_game_id \"your-game-id\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_game_id \"#{metadata[:game_id]}\""~
** Processing line: ~ return :need_game_id~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if metadata[:game_title].start_with?("#") || !@game_title~
** Processing line: ~ log "* PROMPT: Please provide the display name for your game. (This can include spaces)"~
-** Processing line: ~ $console.set_command "$wizards.itch.set_game_title \"Your Game\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_game_title \"#{metadata[:game_title]}\""~
** Processing line: ~ return :need_game_title~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if metadata[:version].start_with?("#") || !@version~
** Processing line: ~ log "* PROMPT: Please provide the version for your game."~
-** Processing line: ~ $console.set_command "$wizards.itch.set_version \"1.0\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_version \"#{metadata[:version]}\""~
** Processing line: ~ return :need_version~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if metadata[:icon].start_with?("#") || !@icon~
** Processing line: ~ log "* PROMPT: Please provide icon path for your game."~
-** Processing line: ~ $console.set_command "$wizards.itch.set_icon \"icon.png\""~
+** Processing line: ~ $console.set_command "$wizards.itch.set_icon \"#{metadata[:icon]}\""~
** Processing line: ~ return :need_icon~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ puts "here!! success!!!"~
+** Processing line: ~~
** Processing line: ~ return :success~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def set_dev_id value~
** Processing line: ~ @dev_id = value~
-** Processing line: ~ write_metadata~
** Processing line: ~ start~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def set_dev_title value~
** Processing line: ~ @dev_title = value~
-** Processing line: ~ write_metadata~
** Processing line: ~ start~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def set_game_id value~
** Processing line: ~ @game_id = value~
-** Processing line: ~ write_metadata~
** Processing line: ~ start~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def set_game_title value~
** Processing line: ~ @game_title = value~
-** Processing line: ~ write_metadata~
** Processing line: ~ start~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def set_version value~
** Processing line: ~ @version = value~
-** Processing line: ~ write_metadata~
** Processing line: ~ start~
** Processing line: ~ end~
** Processing line: ~~
@@ -224100,7 +235782,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ if @icon~
-** Processing line: ~ text += "icon=metadata/#{@icon}\n"~
+** Processing line: ~ text += "icon=#{@icon}\n"~
** Processing line: ~ else~
** Processing line: ~ text += "#icon=metadata/icon.png\n"~
** Processing line: ~ end~
@@ -224118,10 +235800,25 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def deploy~
** Processing line: ~ log_info "* Running dragonruby-publish: #{package_command}"~
-** Processing line: ~ results = $gtk.exec package_command~
+** Processing line: ~ $gtk.openurl "http://itch.io/dashboard" if $gtk.platform == "Mac OS X"~
+** Processing line: ~ if $gtk.platform? :mac~
+** Processing line: ~ $gtk.exec "rm -rf ./builds"~
+** Processing line: ~ end~
+** Processing line: ~ results = $gtk.exec "#{package_command} --only-package"~
+** Processing line: ~ puts File.expand_path("./builds")~
+** Processing line: ~~
** Processing line: ~ log "#+begin_src"~
** Processing line: ~ log results~
** Processing line: ~ log "#+end_src"~
+** Processing line: ~~
+** Processing line: ~ if $gtk.platform? :mac~
+** Processing line: ~ $gtk.exec "open ./builds/"~
+** Processing line: ~ elsif $gtk.platform? :windows~
+** Processing line: ~ $gtk.exec "powershell \"ii .\""~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ $gtk.openurl "https://itch.io/dashboard"~
+** Processing line: ~~
** Processing line: ~ :success~
** Processing line: ~ end~
** Processing line: ~~
@@ -224132,7 +235829,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ steps.each do |m|~
** Processing line: ~ begin~
** Processing line: ~ log_info "Running Itch Wizard Step: ~$wizards.itch.#{m}~"~
-** Processing line: ~ result = (send m) || :success if @wizard_status[m][:result] != :success~
+** Processing line: ~ result = (send m) || :success~
** Processing line: ~ @wizard_status[m][:result] = result~
** Processing line: ~ if result != :success~
** Processing line: ~ log_info "Exiting wizard. :#{result}"~
@@ -224496,10 +236193,18 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ device.grid_area.row_count~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def row_max_index~
+** Processing line: ~ row_count - 1~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def col_count~
** Processing line: ~ device.grid_area.col_count~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def col_max_index~
+** Processing line: ~ col_count - 1~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def gutter_height~
** Processing line: ~ device.grid_area.gutter~
** Processing line: ~ end~
@@ -224522,18 +236227,124 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def rect_defaults~
** Processing line: ~ {~
-** Processing line: ~ row: nil,~
-** Processing line: ~ col: nil,~
-** Processing line: ~ h: 1,~
-** Processing line: ~ w: 1,~
-** Processing line: ~ dx: 0,~
-** Processing line: ~ dy: 0,~
-** Processing line: ~ rect: :control_rect~
+** Processing line: ~ row: nil,~
+** Processing line: ~ col: nil,~
+** Processing line: ~ h: 1,~
+** Processing line: ~ w: 1,~
+** Processing line: ~ dx: 0,~
+** Processing line: ~ dx_ratio: 1,~
+** Processing line: ~ dy: 0,~
+** Processing line: ~ dy_ratio: 1,~
+** Processing line: ~ dh_ratio: 1,~
+** Processing line: ~ dw_ratio: 1,~
+** Processing line: ~ merge: nil,~
+** Processing line: ~ rect: :control_rect~
** Processing line: ~ }~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def rect opts~
+** Processing line: ~ def row n~
+** Processing line: ~ (rect row: n, col: 0, w: 0, h: 0).x~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def row_from_bottom n~
+** Processing line: ~ (rect row: row_count - n, col: 0, w: 0, h: 0).x~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def col n~
+** Processing line: ~ (rect row: 0, col: n, w: 0, h: 0).y~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def col_from_right n~
+** Processing line: ~ (rect row: 0, col: col_max_index - n, w: 0, h: 0).y~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def w n~
+** Processing line: ~ (rect row: 0, col: 0, w: n, h: 1).w~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def h n~
+** Processing line: ~ (rect row: 0, col: 0, w: 1, h: n).h~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def rect_group opts~
+** Processing line: ~ group = opts.group~
+** Processing line: ~ r = opts.row || 0~
+** Processing line: ~ r = row_max_index - opts.row_from_bottom if opts.row_from_bottom~
+** Processing line: ~ c = opts.col || 0~
+** Processing line: ~ c = col_max_index - opts.col_from_right if opts.col_from_right~
+** Processing line: ~ drow = opts.drow || 0~
+** Processing line: ~ dcol = opts.dcol || 0~
+** Processing line: ~ w = opts.w || 0~
+** Processing line: ~ h = opts.h || 0~
+** Processing line: ~ merge = opts[:merge]~
+** Processing line: ~~
+** Processing line: ~ running_row = r~
+** Processing line: ~ running_col = c~
+** Processing line: ~~
+** Processing line: ~ running_col = calc_col_offset(opts.col_offset) if opts.col_offset~
+** Processing line: ~ running_row = calc_row_offset(opts.row_offset) if opts.row_offset~
+** Processing line: ~~
+** Processing line: ~ group.map do |i|~
+** Processing line: ~ group_layout_opts = i.layout || {}~
+** Processing line: ~ group_layout_opts = group_layout_opts.merge row: running_row,~
+** Processing line: ~ col: running_col,~
+** Processing line: ~ merge: merge,~
+** Processing line: ~ w: w, h: h~
+** Processing line: ~ result = (rect group_layout_opts).merge i~
+** Processing line: ~~
+** Processing line: ~ if (i.is_a? Hash) && (i.primitive_marker == :label)~
+** Processing line: ~ if i.alignment_enum == 1~
+** Processing line: ~ result.x += result.w.half~
+** Processing line: ~ elsif i.alignment_enum == 2~
+** Processing line: ~ result.x += result.w~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ running_row += drow~
+** Processing line: ~ running_col += dcol~
+** Processing line: ~ result~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_row_offset opts = {}~
+** Processing line: ~ count = opts[:count] || opts[:length] || 0~
+** Processing line: ~ h = opts.h || 1~
+** Processing line: ~ (row_count - (count * h)) / 2.0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def calc_col_offset opts = {}~
+** Processing line: ~ count = opts[:count] || opts[:length] || 0~
+** Processing line: ~ w = opts.w || 1~
+** Processing line: ~ (col_count - (count * w)) / 2.0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def point opts = {}~
+** Processing line: ~ opts.w = 1~
+** Processing line: ~ opts.h = 1~
+** Processing line: ~ opts.row ||= 0~
+** Processing line: ~ opts.col ||= 0~
+** Processing line: ~ r = rect opts~
+** Processing line: ~ r.x += r.w * opts.col_anchor if opts.col_anchor~
+** Processing line: ~ r.y += r.h * opts.row_anchor if opts.row_anchor~
+** Processing line: ~ r~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def rect *all_opts~
+** Processing line: ~ if all_opts.length == 1~
+** Processing line: ~ opts = all_opts.first~
+** Processing line: ~ else~
+** Processing line: ~ opts = {}~
+** Processing line: ~ all_opts.each do |o|~
+** Processing line: ~ opts.merge! o~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ opts.row = row_max_index - opts.row_from_bottom if opts.row_from_bottom~
+** Processing line: ~ opts.col = col_max_index - opts.col_from_right if opts.col_from_right~
** Processing line: ~ opts = rect_defaults.merge opts~
+** Processing line: ~ opts.row ||= 0~
+** Processing line: ~ opts.col ||= 0~
+** Processing line: ~~
** Processing line: ~ result = send opts[:rect]~
** Processing line: ~ if opts[:row] && opts[:col] && opts[:w] && opts[:h]~
** Processing line: ~ col = rect_col opts[:col], opts[:w]~
@@ -224541,7 +236352,9 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ result = control_rect.merge x: col.x,~
** Processing line: ~ y: row.y,~
** Processing line: ~ w: col.w,~
-** Processing line: ~ h: row.h~
+** Processing line: ~ h: row.h,~
+** Processing line: ~ center_x: col.center_x,~
+** Processing line: ~ center_y: row.center_y~
** Processing line: ~ elsif opts[:row] && !opts[:col]~
** Processing line: ~ result = rect_row opts[:row], opts[:h]~
** Processing line: ~ elsif !opts[:row] && opts[:col]~
@@ -224579,13 +236392,21 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ result[:h] += device.grid_area.gutter * 2~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ result[:x] += opts[:dx] if opts[:dx]~
-** Processing line: ~ result[:y] += opts[:dy] if opts[:dy]~
-** Processing line: ~ result[:w] += opts[:dw] if opts[:dw]~
-** Processing line: ~ result[:h] += opts[:dh] if opts[:dh]~
+** Processing line: ~ result[:x] += opts[:dx] if opts[:dx]~
+** Processing line: ~ result[:x] *= opts[:dx_ratio] if opts[:dx_ratio]~
+** Processing line: ~ result[:y] += opts[:dy] if opts[:dy]~
+** Processing line: ~ result[:y] *= opts[:dy_ratio] if opts[:dy_ratio]~
+** Processing line: ~ result[:w] += opts[:dw] if opts[:dw]~
+** Processing line: ~ result[:w] *= opts[:dw_ratio] if opts[:dw_ratio]~
+** Processing line: ~ result[:h] += opts[:dh] if opts[:dh]~
+** Processing line: ~ result[:h] *= opts[:dh_ratio] if opts[:dh_ratio]~
+** Processing line: ~ result.merge! opts[:merge] if opts[:merge]~
** Processing line: ~ result[:row] = opts[:row]~
** Processing line: ~ result[:col] = opts[:col]~
** Processing line: ~~
+** Processing line: ~ result[:h] = result[:h].clamp 0~
+** Processing line: ~ result[:w] = result[:w].clamp 0~
+** Processing line: ~~
** Processing line: ~ if $gtk.args.grid.name == :center~
** Processing line: ~ result[:x] -= 640~
** Processing line: ~ result[:y] -= 360~
@@ -224620,7 +236441,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ row_y = device.h - row_y - row_h~
** Processing line: ~~
-** Processing line: ~ result = control_rect.merge y: row_y, h: row_h~
+** Processing line: ~ result = control_rect.merge y: row_y, h: row_h, center_y: (row_y + row_h.half)~
** Processing line: ~ @rect_cache[:row][index][h] = result~
** Processing line: ~ @rect_cache[:row][index][h]~
** Processing line: ~ end~
@@ -224643,7 +236464,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ col_w = col_w.to_i~
** Processing line: ~ col_w -= 1 if col_w.odd?~
** Processing line: ~~
-** Processing line: ~ result = control_rect.merge x: col_x, w: col_w~
+** Processing line: ~ result = control_rect.merge x: col_x, w: col_w, center_x: (col_x + col_w.half)~
** Processing line: ~ @rect_cache[:col][index][w] = result~
** Processing line: ~ @rect_cache[:col][index][w]~
** Processing line: ~ end~
@@ -224694,6 +236515,26 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ @device~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def debug_primitives opts = {}~
+** Processing line: ~ @primitives ||= col_count.map_with_index do |col|~
+** Processing line: ~ row_count.map_with_index do |row|~
+** Processing line: ~ cell = rect row: row, col: col~
+** Processing line: ~ center = Geometry.rect_center_point cell~
+** Processing line: ~ [~
+** Processing line: ~ cell.merge(opts).border,~
+** Processing line: ~ cell.merge(opts)~
+** Processing line: ~ .label!(x: center.x,~
+** Processing line: ~ y: center.y,~
+** Processing line: ~ text: "#{row},#{col}",~
+** Processing line: ~ size_enum: -3,~
+** Processing line: ~ vertical_alignment_enum: 1,~
+** Processing line: ~ alignment_enum: 1)~
+** Processing line: ~ ]~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ @primitives~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def serialize~
** Processing line: ~ {~
** Processing line: ~ device: @device.serialize,~
@@ -224707,6 +236548,13 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def to_s~
** Processing line: ~ serialize.to_s~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def reset~
+** Processing line: ~ @primitives = nil~
+** Processing line: ~ @rect_cache ||= {}~
+** Processing line: ~ @rect_cache.clear~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
@@ -224861,6 +236709,11 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ self.puts message~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def self.reset~
+** Processing line: ~ @once = {}~
+** Processing line: ~ nil~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def self.puts_once *ids, message~
** Processing line: ~ id = "#{ids}"~
** Processing line: ~ @once ||= {}~
@@ -224999,6 +236852,68 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~*** metadata.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~metadata.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: ~metadata.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/metadata.rb~
+** Processing line: ~ # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński~
+** Processing line: ~ # Copyright 2021 DragonRuby LLC~
+** Processing line: ~ # MIT License~
+** Processing line: ~ # metadata.rb has been released under MIT (*only this file*).~
+** Processing line: ~~
+** Processing line: ~ module Metadata~
+** Processing line: ~ def metadata_file_path~
+** Processing line: ~ "metadata/game_metadata.txt"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_metadata~
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+** Processing line: ~~
+** Processing line: ~ if !metadata~
+** Processing line: ~ write_blank_metadata~
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ dev_id: dev_id.strip,~
+** Processing line: ~ dev_title: dev_title.strip,~
+** Processing line: ~ game_id: game_id.strip,~
+** Processing line: ~ game_title: game_title.strip,~
+** Processing line: ~ version: version.strip,~
+** Processing line: ~ icon: icon.strip~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def write_blank_metadata~
+** Processing line: ~ $gtk.write_file metadata_file_path, <<-S.strip~
+** Processing line: ~ #devid=myname~
+** Processing line: ~ #devtitle=My Name~
+** Processing line: ~ #gameid=mygame~
+** Processing line: ~ #gametitle=My Game~
+** Processing line: ~ #version=0.1~
+** Processing line: ~ #icon=metadata/icon.png~
+** Processing line: ~ S~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~#+end_src~
+- PRE end detected.
+** Processing line: ~~
+** Processing line: ~~
** Processing line: ~*** numeric.rb~
- H3 detected.
- Determining if line is a header.
@@ -225030,6 +236945,35 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ alias_method :lte, :<=~
** Processing line: ~ alias_method :__original_eq_eq__, :== unless Numeric.instance_methods.include? :__original_eq_eq__~
** Processing line: ~~
+** Processing line: ~ def to_layout_row opts = {}~
+** Processing line: ~ $layout.rect(row: self,~
+** Processing line: ~ col: opts.col || 0,~
+** Processing line: ~ w: opts.w || 0,~
+** Processing line: ~ h: opts.h || 0).y~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_layout_col opts = {}~
+** Processing line: ~ $layout.rect(row: 0,~
+** Processing line: ~ col: self,~
+** Processing line: ~ w: opts.w || 0,~
+** Processing line: ~ h: opts.h || 0).x~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_layout_w~
+** Processing line: ~ $layout.rect(row: 0, col: 0, w: self, h: 1).w~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_layout_h~
+** Processing line: ~ $layout.rect(row: 0, col: 0, w: 1, h: self).h~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_layout_row_from_bottom opts = {}~
+** Processing line: ~ ($layout.row_max_index - self).to_layout_row opts~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def to_layout_col_from_right opts = {}~
+** Processing line: ~ ($layout.col_max_index - self).to_layout_col opts~
+** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ # Converts a numeric value representing seconds into frames.~
** Processing line: ~ #~
@@ -225045,10 +236989,26 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ self / 2.0~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def third~
+** Processing line: ~ self / 3.0~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def quarter~
+** Processing line: ~ self / 4.0~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def to_byte~
** Processing line: ~ clamp(0, 255).to_i~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def clamp *opts~
+** Processing line: ~ min = (opts.at 0)~
+** Processing line: ~ max = (opts.at 1)~
+** Processing line: ~ return min if min && self < min~
+** Processing line: ~ return max if max && self > max~
+** Processing line: ~ return self~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def clamp_wrap min, max~
** Processing line: ~ max, min = min, max if min > max~
** Processing line: ~ return self if self >= min && self <= max~
@@ -225273,7 +237233,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ self * Math::PI.fdiv(180)~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # Converts a number representing an angle in radians to degress.~
+** Processing line: ~ # Converts a number representing an angle in radians to degrees.~
** Processing line: ~ #~
** Processing line: ~ # @gtk~
** Processing line: ~ def to_degrees~
@@ -225290,21 +237250,21 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ GTK::Geometry.to_square(self, x, y, anchor_x, anchor_y)~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # Returns a normal vector for a number that represents an angle in degress.~
+** Processing line: ~ # Returns a normal vector for a number that represents an angle in degrees.~
** Processing line: ~ #~
** Processing line: ~ # @gtk~
** Processing line: ~ def vector max_value = 1~
** Processing line: ~ [vector_x(max_value), vector_y(max_value)]~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # Returns the y component of a normal vector for a number that represents an angle in degress.~
+** Processing line: ~ # Returns the y component of a normal vector for a number that represents an angle in degrees.~
** Processing line: ~ #~
** Processing line: ~ # @gtk~
** Processing line: ~ def vector_y max_value = 1~
** Processing line: ~ max_value * Math.sin(self.to_radians)~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # Returns the x component of a normal vector for a number that represents an angle in degress.~
+** Processing line: ~ # Returns the x component of a normal vector for a number that represents an angle in degrees.~
** Processing line: ~ #~
** Processing line: ~ # @gtk~
** Processing line: ~ def vector_x max_value = 1~
@@ -225331,6 +237291,18 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ (self % n) == 0~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def multiply n~
+** Processing line: ~ self * n~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def fmult n~
+** Processing line: ~ self * n.to_f~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def imult n~
+** Processing line: ~ (self * n).to_i~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def mult n~
** Processing line: ~ self * n~
** Processing line: ~ end~
@@ -225452,12 +237424,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ return gt other~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ def == other~
-** Processing line: ~ return true if __original_eq_eq__ other~
-** Processing line: ~ return __original_eq_eq__ other.entity_id if other.is_a? OpenEntity~
-** Processing line: ~ return false~
-** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ # @gtk~
** Processing line: ~ def map~
** Processing line: ~ unless block_given?~
@@ -225544,29 +237510,29 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def - other~
-** Processing line: ~ return nil unless other~
-** Processing line: ~ super~
+** 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 nil unless other~
-** Processing line: ~ super~
+** 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 nil unless other~
-** Processing line: ~ super~
+** 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 nil unless other~
-** Processing line: ~ super~
+** 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~
@@ -225596,6 +237562,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def self.clamp n, min, max~
** Processing line: ~ n.clamp min, max~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def mid? l, r~
+** Processing line: ~ (between? l, r) || (between? r, l)~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ class Fixnum~
@@ -225622,39 +237592,33 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def + other~
-** Processing line: ~ return nil unless other~
-** Processing line: ~ super~
+** 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 nil unless other~
-** Processing line: ~ super~
+** 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 nil unless other~
-** Processing line: ~ super~
+** 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 nil unless other~
-** Processing line: ~ super~
+** 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 true if __original_eq_eq__ other~
-** Processing line: ~ return __original_eq_eq__ other.entity_id if other.is_a? GTK::OpenEntity~
-** Processing line: ~ return false~
-** 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: ~ #~
@@ -225711,28 +237675,28 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ alias_method :__original_divide__, :- unless Float.instance_methods.include? :__original_divide__~
** Processing line: ~~
** Processing line: ~ def - other~
-** Processing line: ~ return nil unless 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 nil unless 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 nil unless 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 nil unless other~
+** Processing line: ~ return self unless other~
** Processing line: ~ super~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ __raise_arithmetic_exception__ other, :/, e~
@@ -225779,6 +237743,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def nan?~
** Processing line: ~ false~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def center other~
+** Processing line: ~ (self - other).abs.fdiv(2)~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~#+end_src~
@@ -225850,7 +237818,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def local_state~
** Processing line: ~ @local_state ||= OpenEntity.new~
** Processing line: ~ @local_state.hotload_client ||= @local_state.new_entity(:hotload_client,~
-** Processing line: ~ notes: "This enitity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",~
+** Processing line: ~ notes: "This entity is used by DragonRuby Game Toolkit to provide you hotloading on remote machines.",~
** Processing line: ~ changes: { },~
** Processing line: ~ changes_queue: [],~
** Processing line: ~ reloaded_files_times: [])~
@@ -226041,7 +238009,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ sub_index = index - previous_line[:sum]~
** Processing line: ~ word = (cursor_line[:line][0..sub_index - 1]).strip~
** Processing line: ~ token = (word.split " ")[-1]~
-** Processing line: ~ dots = (token.split ".")~
+** Processing line: ~ dots = (token.split ".").flat_map { |s| s.split "[" }.flat_map { |s| s.split "]" }.flat_map { |s| s.split "(" }.flat_map { |s| s.split ")" }~
** Processing line: ~ dot = dots[-1]~
** Processing line: ~ end~
** Processing line: ~~
@@ -226062,6 +238030,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ ignores ||= []~
** Processing line: ~ ignores = [ignores].flatten~
** Processing line: ~ keys = keys.map { |k| k.to_s }~
+** Processing line: ~ keys = keys.reject { |k| k.include? '"' }~
+** Processing line: ~ .reject { |k| k.start_with? "'" }~
+** Processing line: ~ .reject { |k| k.include? "," }~
+** Processing line: ~ .reject { |k| k.start_with? "#" }~
** Processing line: ~ others = ["def", "end"] +~
** Processing line: ~ [ :entity_keys_by_ref,~
** Processing line: ~ :entity_name,~
@@ -226119,6 +238091,10 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ return autocomplete_filter_methods lookup_result.call if lookup_result~
** Processing line: ~~
+** Processing line: ~ if dot[0].upcase == dot[0] && (Object.const_defined? dot.to_sym)~
+** Processing line: ~ return (Object.const_get dot.to_sym).autocomplete_methods~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ start_collecting = false~
** Processing line: ~ dots_after_state = dots.find_all do |s|~
** Processing line: ~ if s == "state"~
@@ -226134,10 +238110,16 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ target = target.as_hash[k.to_sym] if target.respond_to? :as_hash~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ return autocomplete_filter_methods target.as_hash.keys~
+** Processing line: ~ if target.respond_to? :as_hash~
+** Processing line: ~ return autocomplete_filter_methods target.as_hash.keys~
+** Processing line: ~ else~
+** Processing line: ~ return autocomplete_filter_methods target.autocomplete_methods~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~~
+** Processing line: ~ text = text.each_line.reject { |l| l.strip.start_with? "#" }.join "\n"~
+** Processing line: ~ text = text.each_line.map { |l| l.split("#").first }.join "\n"~
** Processing line: ~ text.gsub!("[", " ")~
** Processing line: ~ text.gsub!("]", " ")~
** Processing line: ~ text.gsub!("(", " ")~
@@ -226156,167 +238138,186 @@ Follows is a source code listing for all files that have been open sourced. This
- PRE end detected.
** Processing line: ~~
** Processing line: ~~
-** Processing line: ~*** runtime/draw.rb~
+** Processing line: ~*** runtime/benchmark.rb~
- H3 detected.
- Determining if line is a header.
- Line contains ~*** ~... gsub-ing empty string
-- Formatting line: ~runtime/draw.rb~
+- Formatting line: ~runtime/benchmark.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: ~runtime/draw.rb~
+- Formatting line: ~runtime/benchmark.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/runtime/draw.rb~
+** Processing line: ~ # ./dragon/runtime/benchmark.rb~
** Processing line: ~ # Copyright 2019 DragonRuby LLC~
** Processing line: ~ # MIT License~
-** Processing line: ~ # draw.rb has been released under MIT (*only this file*).~
+** Processing line: ~ # benchmark.rb has been released under MIT (*only this file*).~
** Processing line: ~~
** Processing line: ~ module GTK~
** Processing line: ~ class Runtime~
-** Processing line: ~ module Draw~
-** Processing line: ~ def primitives pass~
-** Processing line: ~ if $top_level.respond_to? :primitives_override~
-** Processing line: ~ return $top_level.tick_render @args, pass~
-** Processing line: ~ end~
-** Processing line: ~~
-** Processing line: ~ # Don't change this draw order unless you understand~
-** Processing line: ~ # the implications.~
-** Processing line: ~~
-** Processing line: ~ # pass.solids.each { |s| draw_solid s }~
-** Processing line: ~ # while loops are faster than each with block~
+** Processing line: ~ module Benchmark~
+** Processing line: ~ def benchmark_single iterations, name, proc~
+** Processing line: ~ log <<-S~
+** Processing line: ~ ** Invoking :#{name}...~
+** Processing line: ~ S~
+** Processing line: ~ time_start = Time.now~
** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.solids.length~
-** Processing line: ~ while idx < pass.solids.length~
-** Processing line: ~ draw_solid (pass.solids.at idx) # accessing an array using .value instead of [] is faster~
+** Processing line: ~ r = nil~
+** Processing line: ~ while idx < iterations~
+** Processing line: ~ r = proc.call~
** Processing line: ~ idx += 1~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.static_solids.each { |s| draw_solid s }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_solids.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_solid (pass.static_solids.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ result = (Time.now - time_start).round 3~
** Processing line: ~~
-** Processing line: ~ # pass.sprites.each { |s| draw_sprite s }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.sprites.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_sprite (pass.sprites.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ { name: name,~
+** Processing line: ~ time: result,~
+** Processing line: ~ time_ms: (result * 1000).to_i }~
+** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.static_sprites.each { |s| draw_sprite s }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_sprites.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_sprite (pass.static_sprites.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ def benchmark opts = {}~
+** Processing line: ~ iterations = opts.iterations~
** Processing line: ~~
-** Processing line: ~ # pass.primitives.each { |p| draw_primitive p }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.primitives.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_primitive (pass.primitives.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * BENCHMARK: Started~
+** Processing line: ~ ** Caller: #{(caller || []).first}~
+** Processing line: ~ ** Iterations: #{iterations}~
+** Processing line: ~ S~
+** Processing line: ~ procs = opts.find_all { |k, v| v.respond_to? :call }~
+** Processing line: ~~
+** Processing line: ~ times = procs.map do |(name, proc)|~
+** Processing line: ~ benchmark_single iterations, name, proc~
+** Processing line: ~ end.sort_by { |r| r.time }~
+** Processing line: ~~
+** Processing line: ~ first_place = times.first~
+** Processing line: ~ second_place = times.second || first_place~
+** Processing line: ~~
+** Processing line: ~ times = times.map do |candidate|~
+** Processing line: ~ average_time = first_place.time~
+** Processing line: ~ .add(candidate.time)~
+** Processing line: ~ .abs~
+** Processing line: ~ .fdiv(2)~
+** Processing line: ~~
+** Processing line: ~ difference_percentage = 0~
+** Processing line: ~ if average_time == 0~
+** Processing line: ~ difference_percentage = 0~
+** Processing line: ~ else~
+** Processing line: ~ difference_percentage = first_place.time~
+** Processing line: ~ .subtract(candidate.time)~
+** Processing line: ~ .abs~
+** Processing line: ~ .fdiv(average_time)~
+** Processing line: ~ .imult(100)~
+** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.static_primitives.each { |p| draw_primitive p }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_primitives.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_primitive (pass.static_primitives.at idx)~
-** Processing line: ~ idx += 1~
+** Processing line: ~ difference_time = ((first_place.time - candidate.time) * 1000).round~
+** Processing line: ~ candidate.merge(difference_percentage: difference_percentage,~
+** Processing line: ~ difference_time: difference_time)~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.labels.each { |l| draw_label l }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.labels.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_label (pass.labels.at idx)~
-** Processing line: ~ idx += 1~
+** Processing line: ~ too_small_to_measure = false~
+** Processing line: ~ if (first_place.time + second_place.time) == 0~
+** Processing line: ~ too_small_to_measure = true~
+** Processing line: ~ difference_percentage = 0~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * BENCHMARK: Average time for experiments were too small. Increase the number of iterations.~
+** Processing line: ~ S~
+** Processing line: ~ else~
+** Processing line: ~ difference_percentage = (((first_place.time - second_place.time).abs.fdiv((first_place.time + second_place.time).abs.fdiv(2))) * 100).round~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.static_labels.each { |l| draw_label l }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_labels.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_label (pass.static_labels.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ difference_time = first_place.time.-(second_place.time).*(1000).abs.round~
** Processing line: ~~
-** Processing line: ~ # pass.lines.each { |l| draw_line l }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.lines.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_line (pass.lines.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ r = {~
+** Processing line: ~ iterations: iterations,~
+** Processing line: ~ first_place: first_place,~
+** Processing line: ~ second_place: second_place,~
+** Processing line: ~ difference_time: difference_time,~
+** Processing line: ~ difference_percentage: difference_percentage,~
+** Processing line: ~ times: times,~
+** Processing line: ~ too_small_to_measure: too_small_to_measure~
+** Processing line: ~ }~
** Processing line: ~~
-** Processing line: ~ # pass.static_lines.each { |l| draw_line l }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_lines.length~
-** Processing line: ~ while idx < pass.static_lines.length~
-** Processing line: ~ draw_line (pass.static_lines.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ log_message = []~
+** Processing line: ~ only_one_result = first_place.name == second_place.name~
** Processing line: ~~
-** Processing line: ~ # pass.borders.each { |b| draw_border b }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.borders.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_border (pass.borders.at idx)~
-** Processing line: ~ idx += 1~
+** Processing line: ~ if only_one_result~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * BENCHMARK: #{r.first_place.name} completed in #{r.first_place.time_ms}ms."~
+** Processing line: ~ S~
+** Processing line: ~ else~
+** Processing line: ~ log <<-S~
+** Processing line: ~ * BENCHMARK: #{r.message}~
+** Processing line: ~ ** Fastest: #{r.first_place.name.inspect}~
+** Processing line: ~ ** Second: #{r.second_place.name.inspect}~
+** Processing line: ~ ** Margin: #{r.difference_percentage}% (#{r.difference_time.abs}ms) #{r.first_place.time_ms}ms vs #{r.second_place.time_ms}ms.~
+** Processing line: ~ ** Times:~
+** Processing line: ~ #{r.times.map { |t| "*** #{t.name}: #{t.time_ms}ms (#{t.difference_percentage}% #{t.difference_time.abs}ms)." }.join("\n")}~
+** Processing line: ~ S~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.static_borders.each { |b| draw_border b }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_borders.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_border (pass.static_borders.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~ r~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ if !$gtk.production~
-** Processing line: ~ # pass.debug.each { |r| draw_primitive r }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.debug.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_primitive (pass.debug.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
+** Processing line: ~#+end_src~
+- PRE end detected.
** Processing line: ~~
-** Processing line: ~ # pass.static_debug.each { |r| draw_primitive r }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_debug.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_primitive (pass.static_debug.at idx)~
-** Processing line: ~ idx += 1~
-** Processing line: ~ end~
-** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.reserved.each { |r| draw_primitive r }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.reserved.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_primitive (pass.reserved.at idx)~
-** Processing line: ~ idx += 1~
+** Processing line: ~*** runtime/draw.rb~
+- H3 detected.
+- Determining if line is a header.
+- Line contains ~*** ~... gsub-ing empty string
+- Formatting line: ~runtime/draw.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: ~runtime/draw.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/runtime/draw.rb~
+** Processing line: ~ # Copyright 2019 DragonRuby LLC~
+** Processing line: ~ # MIT License~
+** Processing line: ~ # draw.rb has been released under MIT (*only this file*).~
+** Processing line: ~~
+** Processing line: ~ module GTK~
+** Processing line: ~ class Runtime~
+** Processing line: ~ module Draw~
+** Processing line: ~ def primitives pass~
+** Processing line: ~ if $top_level.respond_to? :primitives_override~
+** Processing line: ~ return $top_level.tick_render @args, pass~
** Processing line: ~ end~
** Processing line: ~~
-** Processing line: ~ # pass.static_reserved.each { |r| draw_primitive r }~
-** Processing line: ~ idx = 0~
-** Processing line: ~ length = pass.static_reserved.length~
-** Processing line: ~ while idx < length~
-** Processing line: ~ draw_primitive (pass.static_reserved.at idx)~
-** Processing line: ~ idx += 1~
+** Processing line: ~ fn.each_send pass.solids, self, :draw_solid~
+** Processing line: ~ fn.each_send pass.static_solids, self, :draw_solid~
+** Processing line: ~ fn.each_send pass.sprites, self, :draw_sprite~
+** Processing line: ~ fn.each_send pass.static_sprites, self, :draw_sprite~
+** Processing line: ~ fn.each_send pass.primitives, self, :draw_primitive~
+** Processing line: ~ fn.each_send pass.static_primitives, self, :draw_primitive~
+** Processing line: ~ fn.each_send pass.labels, self, :draw_label~
+** Processing line: ~ fn.each_send pass.static_labels, self, :draw_label~
+** Processing line: ~ fn.each_send pass.lines, self, :draw_line~
+** Processing line: ~ fn.each_send pass.static_lines, self, :draw_line~
+** 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: ~ fn.each_send pass.debug, self, :draw_primitive~
+** Processing line: ~ fn.each_send pass.static_debug, self, :draw_primitive~
** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ fn.each_send pass.reserved, self, :draw_primitive~
+** Processing line: ~ fn.each_send pass.static_reserved, self, :draw_primitive~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ pause!~
** Processing line: ~ pretty_print_exception_and_export! e~
@@ -226327,7 +238328,9 @@ 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: ~ @ffi_draw.draw_solid s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a~
+** 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)~
** Processing line: ~ end~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise_conversion_for_rendering_failed s, e, :solid~
@@ -226338,14 +238341,15 @@ 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: ~ @ffi_draw.draw_sprite_3 s.x, s.y, s.w, s.h,~
-** Processing line: ~ s.path.s_or_default,~
+** 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,~
** Processing line: ~ s.a, s.r, s.g, s.b,~
** Processing line: ~ s.tile_x, s.tile_y, s.tile_w, s.tile_h,~
** Processing line: ~ !!s.flip_horizontally, !!s.flip_vertically,~
** Processing line: ~ s.angle_anchor_x, s.angle_anchor_y,~
-** Processing line: ~ s.source_x, s.source_y, s.source_w, s.source_h~
+** Processing line: ~ s.source_x, s.source_y, s.source_w, s.source_h,~
+** Processing line: ~ (s.blendmode_enum || 1)~
** Processing line: ~ end~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise_conversion_for_rendering_failed s, e, :sprite~
@@ -226356,7 +238360,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: ~ @ffi_draw.draw_screenshot s.path.s_or_default,~
+** Processing line: ~ @ffi_draw.draw_screenshot (s.path || '').to_s,~
** Processing line: ~ s.x, s.y, s.w, s.h,~
** Processing line: ~ s.angle,~
** Processing line: ~ s.a, s.r, s.g, s.b,~
@@ -226374,10 +238378,13 @@ 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: ~ @ffi_draw.draw_label l.x, l.y, l.text.s_or_default,~
-** Processing line: ~ l.size_enum, l.alignment_enum,~
-** Processing line: ~ l.r, l.g, l.b, l.a,~
-** Processing line: ~ l.font.s_or_default(nil)~
+** 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,~
+** Processing line: ~ l.r, l.g, l.b, l.a,~
+** Processing line: ~ l.font,~
+** Processing line: ~ (l.vertical_alignment_enum || 2),~
+** Processing line: ~ (l.blendmode_enum || 1)~
** Processing line: ~ end~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise_conversion_for_rendering_failed l, e, :label~
@@ -226388,7 +238395,21 @@ 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: ~ @ffi_draw.draw_line l.x, l.y, l.x2, l.y2, l.r, l.g, l.b, l.a~
+** 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,~
+** Processing line: ~ (l.blendmode_enum || 1)~
+** Processing line: ~ else~
+** Processing line: ~ w = l.w || 0~
+** Processing line: ~ w = 1 if w == 0~
+** Processing line: ~ h = l.h || 0~
+** Processing line: ~ h = 1 if h == 0~
+** Processing line: ~ @ffi_draw.draw_line_2 l.x, l.y,~
+** Processing line: ~ l.x + w - 1,~
+** Processing line: ~ l.y + h - 1,~
+** Processing line: ~ l.r, l.g, l.b, l.a,~
+** Processing line: ~ (l.blendmode_enum || 1)~
+** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise_conversion_for_rendering_failed l, e, :line~
@@ -226399,7 +238420,9 @@ 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: ~ @ffi_draw.draw_border s.x, s.y, s.w, s.h, s.r, s.g, s.b, s.a~
+** 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)~
** Processing line: ~ end~
** Processing line: ~ rescue Exception => e~
** Processing line: ~ raise_conversion_for_rendering_failed s, e, :border~
@@ -226419,7 +238442,6 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ pause!~
** Processing line: ~ pretty_print_exception_and_export! e~
** Processing line: ~ end~
-** Processing line: ~~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -226665,7 +238687,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~~
** Processing line: ~ def framerate_diagnostics_primitives~
** Processing line: ~ [~
-** Processing line: ~ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid,~
+** Processing line: ~ { x: 0, y: 93.from_top, w: 500, h: 93, a: 128 }.solid!,~
** Processing line: ~ {~
** Processing line: ~ x: 5,~
** Processing line: ~ y: 5.from_top,~
@@ -226674,7 +238696,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 255,~
** Processing line: ~ b: 255,~
** Processing line: ~ size_enum: -2~
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
** Processing line: ~ {~
** Processing line: ~ x: 5,~
** Processing line: ~ y: 20.from_top,~
@@ -226683,7 +238705,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 255,~
** Processing line: ~ b: 255,~
** Processing line: ~ size_enum: -2~
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
** Processing line: ~ {~
** Processing line: ~ x: 5,~
** Processing line: ~ y: 35.from_top,~
@@ -226692,7 +238714,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 255,~
** Processing line: ~ b: 255,~
** Processing line: ~ size_enum: -2~
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
** Processing line: ~ {~
** Processing line: ~ x: 5,~
** Processing line: ~ y: 50.from_top,~
@@ -226701,7 +238723,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 255,~
** Processing line: ~ b: 255,~
** Processing line: ~ size_enum: -2~
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
** Processing line: ~ {~
** Processing line: ~ x: 5,~
** Processing line: ~ y: 65.from_top,~
@@ -226710,7 +238732,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ g: 255,~
** Processing line: ~ b: 255,~
** Processing line: ~ size_enum: -2~
-** Processing line: ~ }.label,~
+** Processing line: ~ }.label!,~
** Processing line: ~ ]~
** Processing line: ~ end~
** Processing line: ~~
@@ -226750,7 +238772,14 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ def hotload_init~
** Processing line: ~ @hotload_if_needed = 0~
** Processing line: ~ @mailbox_if_needed = 0~
+** Processing line: ~~
+** Processing line: ~ # schema for file_mtimes~
+** Processing line: ~ # { FILE_PATH: { current: (Time as Fixnum),~
+** Processing line: ~ # last: (Time as Fixnum) },~
+** Processing line: ~ # FILE_PATH: { current: (Time as Fixnum),~
+** Processing line: ~ # last: (Time as Fixnum) } }~
** Processing line: ~ @file_mtimes = { }~
+** Processing line: ~~
** Processing line: ~ @suppress_mailbox = true~
** Processing line: ~ files_to_reload.each { |f| init_mtimes f }~
** Processing line: ~ init_mtimes 'app/mailbox.rb'~
@@ -226788,6 +238817,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ 'dragon/symbol.rb',~
** Processing line: ~ 'dragon/numeric_deprecated.rb',~
** Processing line: ~ 'dragon/numeric.rb',~
+** Processing line: ~ 'dragon/hash_deprecated.rb',~
** Processing line: ~ 'dragon/hash.rb',~
** Processing line: ~ 'dragon/outputs_deprecated.rb',~
** Processing line: ~ 'dragon/array_docs.rb',~
@@ -226820,6 +238850,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ 'dragon/trace.rb',~
** Processing line: ~ 'dragon/readme_docs.rb',~
** Processing line: ~ 'dragon/hotload_client.rb',~
+** Processing line: ~ 'dragon/wizards.rb',~
** Processing line: ~ 'dragon/ios_wizard.rb',~
** Processing line: ~ 'dragon/itch_wizard.rb',~
** Processing line: ~ ] + core_files_to_reload + @required_files~
@@ -226838,10 +238869,8 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def init_mtimes file~
-** Processing line: ~ current_key = "current_#{file}".to_sym~
-** Processing line: ~ last_key = "last_#{file}".to_sym~
-** Processing line: ~ @file_mtimes[current_key] ||= @ffi_file.mtime(file)~
-** Processing line: ~ @file_mtimes[last_key] ||= @ffi_file.mtime(file)~
+** Processing line: ~ @file_mtimes[file] ||= { current: @ffi_file.mtime(file),~
+** Processing line: ~ last: @ffi_file.mtime(file) }~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def hotload_source_files~
@@ -226873,25 +238902,36 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def hotload_if_needed~
+** Processing line: ~ return if Kernel.tick_count < 0~
** Processing line: ~ hotload_source_files~
** Processing line: ~ check_mailbox~
** Processing line: ~ end~
** Processing line: ~~
** Processing line: ~ def on_load_succeeded file~
-** Processing line: ~ @rcb_sender.files_reloaded << file~
-** Processing line: ~ @rcb_sender.reloaded_files << file~
+** Processing line: ~ self.files_reloaded << file~
+** Processing line: ~ self.reloaded_files << file~
** Processing line: ~ Trace.untrace_classes!~
** Processing line: ~ end~
** Processing line: ~~
+** Processing line: ~ def reset_all_mtimes~
+** Processing line: ~ @file_mtimes.each do |file, _|~
+** Processing line: ~ @file_mtimes[file].current = @ffi_file.mtime(file)~
+** Processing line: ~ @file_mtimes[file].last = @file_mtimes[file].current~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ files_to_reload.each do |file, _|~
+** Processing line: ~ @file_mtimes[file] ||= {}~
+** Processing line: ~ @file_mtimes[file].current = @ffi_file.mtime(file)~
+** Processing line: ~ @file_mtimes[file].last = @file_mtimes[file].current~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def reload_if_needed file, force = false~
-** Processing line: ~ current_key = "current_#{file}".to_sym~
-** Processing line: ~ last_key = "last_#{file}".to_sym~
-** Processing line: ~ @file_mtimes[current_key] ||= nil~
-** Processing line: ~ @file_mtimes[last_key] ||= nil~
-** Processing line: ~ @file_mtimes[current_key] = @ffi_file.mtime(file)~
-** Processing line: ~ return if !force && @file_mtimes[last_key] == @file_mtimes[current_key]~
+** Processing line: ~ @file_mtimes[file] ||= { current: @ffi_file.mtime(file), last: @ffi_file.mtime(file) }~
+** Processing line: ~ @file_mtimes[file].current = @ffi_file.mtime(file)~
+** Processing line: ~ return if !force && @file_mtimes[file].current == @file_mtimes[file].last~
** Processing line: ~ on_load_succeeded file if reload_ruby_file file~
-** Processing line: ~ @file_mtimes[last_key] = @file_mtimes[current_key]~
+** Processing line: ~ @file_mtimes[file].last = @file_mtimes[file].current~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -226948,6 +238988,30 @@ 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 char_byte~
+** Processing line: ~ return nil if self.length == 0~
+** Processing line: ~ c = self.each_char.first.bytes~
+** Processing line: ~ c = c.first if c.is_a? Enumerable~
+** Processing line: ~ c~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def insert_character_at index, char~
+** Processing line: ~ t = each_char.to_a~
+** Processing line: ~ t = (t.insert index, char)~
+** Processing line: ~ t.join~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def excluding_character_at index~
+** Processing line: ~ t = each_char.to_a~
+** Processing line: ~ t.delete_at index~
+** Processing line: ~ t.join~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def excluding_last_character~
+** Processing line: ~ return "" if self.length <= 1~
+** Processing line: ~ return excluding_character_at(self.length - 1)~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ def end_with_bang?~
** Processing line: ~ self[-1] == "!"~
** Processing line: ~ end~
@@ -227180,7 +239244,7 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ log "#{self.failed.length} test(s) failed."~
** Processing line: ~ self.failed.each do |h|~
** Processing line: ~ log "**** Test name: :#{h[:m]}"~
-** Processing line: ~ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}"~
+** Processing line: ~ log "#{h[:e].to_s.gsub("* ERROR:", "").strip}\n#{h[:e].__backtrace_to_org__}"~
** Processing line: ~ end~
** Processing line: ~ end~
** Processing line: ~ end~
@@ -227415,6 +239479,40 @@ Follows is a source code listing for all files that have been open sourced. This
** Processing line: ~ # MIT License~
** Processing line: ~ # wizards.rb has been released under MIT (*only this file*).~
** Processing line: ~~
+** Processing line: ~ class Wizard~
+** Processing line: ~ def metadata_file_path~
+** Processing line: ~ "metadata/game_metadata.txt"~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ def get_metadata~
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+** Processing line: ~~
+** Processing line: ~ if !metadata~
+** Processing line: ~ write_blank_metadata~
+** Processing line: ~ metadata = $gtk.read_file metadata_file_path~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ dev_id, dev_title, game_id, game_title, version, icon = *metadata.each_line.to_a~
+** Processing line: ~~
+** Processing line: ~ {~
+** Processing line: ~ dev_id: dev_id.strip.gsub("#", "").gsub("devid=", ""),~
+** Processing line: ~ dev_title: dev_title.strip.gsub("#", "").gsub("devtitle=", ""),~
+** Processing line: ~ game_id: game_id.strip.gsub("#", "").gsub("gameid=", ""),~
+** Processing line: ~ game_title: game_title.strip.gsub("#", "").gsub("gametitle=", ""),~
+** Processing line: ~ version: version.strip.gsub("#", "").gsub("version=", ""),~
+** Processing line: ~ icon: icon.strip.gsub("#", "").gsub("icon=", "")~
+** Processing line: ~ }~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
+** Processing line: ~ class WizardException < Exception~
+** Processing line: ~ attr_accessor :console_primitives~
+** Processing line: ~~
+** Processing line: ~ def initialize *console_primitives~
+** Processing line: ~ @console_primitives = console_primitives~
+** Processing line: ~ end~
+** Processing line: ~ end~
+** Processing line: ~~
** Processing line: ~ module GTK~
** Processing line: ~ class Wizards~
** Processing line: ~ attr_accessor :ios, :itch~
diff --git a/docs/todo/03-solids-and-borders.md b/docs/todo/03-solids-and-borders.md
index 34acc96..0ed2fc9 100644
--- a/docs/todo/03-solids-and-borders.md
+++ b/docs/todo/03-solids-and-borders.md
@@ -33,7 +33,7 @@ args.outputs.borders << [100, 100, 160, 90]
## RGBA - Colors and Alpha
-The value for the color and alpha is a number between `0` and `255`. The
+The value for the color and alpha is an number between `0` and `255`. The
alpha property is optional and will be set to `255` if not specified.
Creates a green solid rectangle with an opacity of 50%.
@@ -93,7 +93,7 @@ args.outputs.borders << {
## Duck Typing (Advanced)
You can also create a class with solid/border properties and render it as a primitive.
-ALL properties must be on the class. ADDITIONALLY, a method called `primitive_marker`
+ALL properties must on the class. ADDITIONALLY, a method called `primitive_marker`
must be defined on the class.
Here is an example:
diff --git a/docs/todo/04-lines.md b/docs/todo/04-lines.md
index 20faa44..03c1abc 100644
--- a/docs/todo/04-lines.md
+++ b/docs/todo/04-lines.md
@@ -35,7 +35,7 @@ args.outputs.lines << [ 0, 360, 1280, 360]
## RGBA - Colors and Alpha
-The value for the color and alpha is a number between `0` and `255`. The
+The value for the color and alpha is an number between `0` and `255`. The
alpha property is optional and will be set to `255` if not specified.
Creates a green horizontal line through the center of the scene with an opacity of 50%.
@@ -75,7 +75,7 @@ args.outputs.lines << {
## Duck Typing (Advanced)
You can also create a class with line properties and render it as a primitive.
-ALL properties must be on the class. ADDITIONALLY, a method called `primitive_marker`
+ALL properties must on the class. ADDITIONALLY, a method called `primitive_marker`
must be defined on the class.
Here is an example:
diff --git a/docs/todo/05-sprites.md b/docs/todo/05-sprites.md
index 773a007..e8030ab 100644
--- a/docs/todo/05-sprites.md
+++ b/docs/todo/05-sprites.md
@@ -29,7 +29,7 @@ args.outputs.sprites << [100, 100, 32, 64, "sprites/player.png"]
## Rotation / Angle
-Unlike `solids` and `borders`, sprites can be rotated. This is how you rotate a sprite 90 degrees.
+Unlike `solids` and `borders`, sprites can be rotated. This is how you rotate a sprite 90 degress.
Note: All angles in DragonRuby Game Toolkit are represented in degrees (not radians).
@@ -180,7 +180,7 @@ args.outputs.sprites << {
## Duck Typing (Advanced)
You can also create a class with sprite properties and render it as a primitive.
-ALL properties must be on the class. ADDITIONALLY, a method called `primitive_marker`
+ALL properties must on the class. ADDITIONALLY, a method called `primitive_marker`
must be defined on the class.
Here is an example:
diff --git a/docs/todo/08-controllers.md b/docs/todo/08-controllers.md
index 9ed9199..aa85ee8 100644
--- a/docs/todo/08-controllers.md
+++ b/docs/todo/08-controllers.md
@@ -33,7 +33,7 @@ end
# Truthy Keys
-You can access all triggered keys through `truthy_keys` on `keyboard`, `controller_one`, and `controller_two`.
+You can access all triggered keys through `thruthy_keys` on `keyboard`, `controller_one`, and `controller_two`.
This is how you would write all keys to a file. The game must be in the foreground and have focus for this data
to be recorded.